質問

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?

役に立ちましたか?

解決

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?

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top