database design - One-to-Many relation definition: correct interpretation of the relationship direction -
i have trouble interpretation of "direction" of one-to-many relation. imagine relation person:city
between person
, city
describes unique residence of each individual. person can live in 1 city , each city inhabited lot of persons, hence possible tuples (p1,c1),(p2,c1),(p3,c1)
. found 2 different definitions of kind of rel:
- person:city one-to-many relation because same instances of city participate more times different instance of relation (eg. reference here)
- person:city many-to-one relation because 1 row in table
city
(eg.c1
) may linked many rows in tableperson
, 1 row in tableperson
linked 1 row in tablecity
(eg. reference here)
my doubt semantic: many refer (i) city
multiple participation of identical instances relation or refer (ii) person
since different people linked same city?
although definition not affect structure of data, lead misunderstandings. correct one?
in example, person:city many-to-one relationship. more precisely, each city associated 0 or more people (one-city-to-many-people), , each person associated 1 city (one-person-to-one-city). both cardinalities significant, simplify one-to-many since one-to-one in opposite direction assumed (else many-to-many decompose multiple one-to-many relationships).
note cardinality doesn't indicate row linkage describes association between person , city domains. rows physical structures while cardinality describes logical relations. difference significant when using different physical formats normalized tables, e.g. dbmss support multivalued attributes or may display data graphs rather tables.
i couldn't find usage described in first reference, regardless it's not tutorial recommend anyone.
Comments
Post a Comment