Recursive relationships sound difficult to create, but they are not. Suppose some students are student
advisors. The relationship is 1:N. One can create this recursive relationship by adding a column to the Student
relation named ???StudentAdvisor???. The StudentAdvisor column is essentially a foreign key column that contains
values of the primary key from the same relation. Creating a 1:N recursive relationship is just like creating
a standard 1:N relationship, except that the ???parent??? foreign key links to the same table that contains the ???child???
entity. A 1:1 recursive relationship is handled similarly.
An M:N recursive relationship requires creating an intersection table, just as for standard M:N relationships.
In this case, however, the foreign key columns will both contain primary key values from the same relation.
Imagine the recursive roommates relationship. Each row in the intersection table will associate one student with
a roommate, another student.
NORMALIZATION
Some models are better than others. In particular, poor decisions regarding entity definitions can increase
data redundancy and lead to update anomalies. Update anomalies include behavior such as requiring information
about a second entity (e.
Pages:
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406