In addition, one must
add a column to the weak or ID-dependent relation that will hold the foreign key of the strong entity tuple to
which it is related.
A foreign key is a column in a relation, which establishes a relationship with data in another relation.
For instance, suppose our data model includes entity type ???StudentComputer???, and that ???StudentComputer??? is
a weak entity associated with ???Student???. That is, the database will track the information about each student??™s
computer only as long as the student is part of the database.
In addition to attributes of the student??™s computer such as make and serial number, the StudentComputer
relation will have a column identifying the student who owns the computer. If SSN is the key of the Student relation,
the foreign key in the StudentComputer relation will contain values of student social security numbers. It is not
necessary for the column names in the two relations to be the same. Thus, even though the key column of the
Student relation is named ???SSN???, the foreign key column in StudentComputer might be called ???StudentSSN???.
The new relation created for the weak entity must also have a primary key of its own. Choosing the primary key
for the weak entity relation involves the same considerations as choosing the primary key for a strong entity relation.
Pages:
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402