Pregunta

I was wondering about various business scenario where one can design hierarchy structure where one or more tables are creating a loop.

Eg. Employee - Manager relationship in one to many Employee(empid, name, managerid) Manager id is referencing to empid

User-Friend relationship as many to many similar to many social media sites User(userid, name, gender) UserFriendMap(userid, friendid) UserId is referencing to user table and FriendId is also referencing to User table. UserId not equal to FriendId

What are the other possible cases you have used in your career or can think of?

¿Fue útil?

Solución

Test-test, where a test contains multiple subtests that need to execute.

People in a table for genealogy, through a join table that denotes children.

Servers where one server is a master and the other(s) replicate.

And, since this question is remarkably open-ended, might as well give some docs on parent-child dimensions.

Looking at stack overflow a bit more, it appears this is a dupe of here, though: When we need to use 1-to-1 relationship in database design?

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top