Relational databases/SQL: What are typical use cases for one-to-one parent-child (non-inheritance, tree-like to self/super table) relationships? -


possible duplicate:
when need use 1-to-1 relationship in database design?

relational databases/sql: typical use cases one-to-one parent-child (non-inheritance, tree-like self/super table) relationships?

of course, implement/become parent-child list instead of tree (assuming regular one-to-many).

think sports leagues, see http://en.wikipedia.org/wiki/english_football_league_system: english premier league (soccer) of same type league (single) child, football league championship. @ lower point can see children "split" conference north , conference south. can modeled many-to-one relationship league league, resulting in regular tree.

if changed described many-to-one parent-child relationship one-to-one, list instead of tree, top part of english soccer leagues. i'm asking for. consequence children of node become child or next element (because of fact list now).

i wonder when regularly need list structure in relational databases, given are technically possible.

so again, typical use cases / examples parent-child one-to-one relationships? (doesn't have complete list, can't think of real-life examples)

note: don't mean inheritance relationships here. these should one-to-one @ (?) times, that's not question...

edit: note, "parent-child" relationships mean foreign keys same (or super) table. forgot "parents" , "children" used in false contexts. not 1 table entity owning table's entity via simple one-to-one relationship, people believe parent-child relationships. i'm talking "one-to-one trees" here.

in sql practical purposes impossible (or @ least extremely difficult) use mandatory one-to-one (bijection) constraint between 2 tables. sql allows insert 1 table @ time, constraint violated insert first table. meant "one-to-one" in sql context one-to- zero/one. sql "foreign key" constraints optional on 1 side of constraint.

in principle, if dbms can handle such constraints useful wherever business rules require 2 distinct entities have one-to-one relationship. e.g. 1 husband, 1 wife. 1 manager per department , 1 department per manager.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -