The primary key of a relationship set in an E-R data model
Posted by: Eus Kevin
Date: February 24, 2008 07:16AM

Hi Ho!

On a book, which is published by McGraw Hill, titled Database System Concepts, 4th Edition, by Silberschatz, Korth, and Sudarshan, I found a contradiction that I would like to clarify with you.

The problem is within chapter 2, which starts on page 27 and ends on page 77, that discusses Entity-Relationship Model.
On page 36 in a section that discusses the key to distinguish among the various relationships of a relationship set, there is the following statement:

"Let R be a relationship set involving entity sets E1, E2, ..., En.
Let primary-key(Ei) denote the set of attributes that forms the primary key for entity set Ei.
Assume for now that the attribute names of all primary keys are unique, and each entity set participates only once in the relationship.
The composition of the primary key for a relationship set depends on the set of attributes associated with the relationship set R."

In my opinion, the last sentence is wrong. The right one should be as follows:

"The composition of the primary key for a relationship set _does not_ depend on the set of attributes associated with the relationship set R."

The following evidences support my argument:
1. On page 32 in a section that discusses Relationship Sets there is the following statement:

"A relationship instance in a given relationship set must be uniquely identifiable from its participating entities, without using the descriptive attributes."

Previously, the descriptive attributes are defined as attributes that are associated with a relationship set.

2. On page 36 just below the concerned statement, it is written that:

"If the relationship set R has no attributes associated with it, then the set of attributes
primary-key(E1) U primary-key(E2) U ... U primary-key(En)
describes an individual relationship in set R.

If the relationship set R has attributes a1, a2, ..., am associated with it, then the set of attributes
primary-key(E1) U primary-key(E2) U ... U primary-key(En) U {a1, a2, ..., am}
describes an individual relationship in set R.

In both of the above cases, the set of attributes
primary-key(E1) U primary-key(E2) U ... U primary-key(En)
forms a superkey for the relationship set."

Because in both of the above cases the superkey (i.e., a set of one or more attributes that, taken collectively, allow us to identify uniquely a relation in a relationship set) is just
primary-key(E1) U primary-key(E2) U ... U primary-key(En),
the composition of the primary key for a relationship set does not depend on {a1, a2, ..., am} (i.e., the set of attributes associated with the relationship set R).

Would you please help me clarify this fact? It is because in reality there are some examples that require the use of descriptive attributes to form the primary key of a relationship set. One such examples is as follows:

Consider two entity sets: Student and Course along with one relationship set: Took that describes a many-to-many relationship between Student and Course, as well as one descriptive attribute associated with the relationship set: Quarter.

If one student is only permitted to take a course once, then the primary key of the relationship set will be
primary-key(Student) U primary-key(Course).

But, if one student is permitted to take a course more than once, then the primary key of the relationship set will be
primary-key(Student) U primary-key(Course) U {Quarter}.

If it is true that:
"The composition of the primary key for a relationship set _does not_ depend on the set of attributes associated with the relationship set R.",
the relationship set of the aforementioned example must be transformed to an entity set named: Academic Quarter in spite of the fact that we are still working on the E-R data model (usually we start creating bridging-tables and other necessary transformations when we translate the E-R data model into the relational data model).

Is this the truth?

Thank you very much.

Best regards,
Eus

Options: ReplyQuote


Subject
Written By
Posted
The primary key of a relationship set in an E-R data model
February 24, 2008 07:16AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.