简体   繁体   中英

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM