From Entity Sets to Relations

From Entity Sets to Relations

We shall first consider entity sets that are not weak. We shall take up the modifications required to accommodate weak entity sets in "Handling Weak Entity Sets". For each non-weak entity set, we shall make a relation of the same name and with the same set of attributes. This relation will not have any indication of the relationships in which the entity set partakes; we'll handle relationships with separate relations, as discussed in "From E/R Relationships to Relations".

Example : Consider the three entity sets Movies, Stars and Studios from "Representing Keys in the E/R Model" figure , which we reproduce here. The attributes for the Movies entity set are title, year, length, and filmType. Thus, the relation Movies looks just like the relation Movies of "The Relational Data Model" figure.

E/R diagram for the movie database

Next, consider the entity set Stars from above figure. There are two attributes, name and address. Thus, we would expect the corresponding Stars relation to have schema Stars(name, address) and for a typical instance of the relation to look like:

From Entity Sets to Relations



Tags