Mohamed Gamal
Mohamed Gamal

Reputation: 110

one-to-many with specific number in mysql

I'm build Reporting System. This system has 3 admins and each admin has 6 supervisors. I know that is one to many relationship but how to specify 1 admin to 6 supervisors in mysql. Thanks

Upvotes: 1

Views: 39

Answers (1)

user2009750
user2009750

Reputation: 3187

You need to apply such constraints in your business logic, MySQL won't give you ability to apply such constraints.

If you are specifying supervisors for admin or admin for super visors, max limiting constraint should be implemented from your programming languages, or better yet, implement such logic in store procedures.

Upvotes: 1

Related Questions