0

I have 2 tables: department(id and department name) employee(employee id and name) How can I write 1 trigger so that when inserting each department there is a maximum of 5 people.

nervo5699
  • 1
  • 1
  • What have you tried so far? And what was your problem implementing such a trigger? To get the count of rows in the table or to prevent the insert if your limit was reached? – t.niese Jun 18 '22 at 15:30
  • Not the exact duplicate, but there is not much to change, there is basically everything in there that you need. And I'm pretty sure that there is also an exact duplicate for the question here on SO. – t.niese Jun 18 '22 at 15:33
  • Here some more related question: [How can I set a maximum number of rows in MySQL table?](https://stackoverflow.com/questions/8048001/how-can-i-set-a-maximum-number-of-rows-in-mysql-table), [How to limit number of rows can be store in mysql table?](https://stackoverflow.com/questions/45073861/how-to-limit-number-of-rows-can-be-store-in-mysql-table) – t.niese Jun 18 '22 at 15:34

0 Answers0