April 2013 Archive


The Modeling of Constraints

We have studied so far how to model a slice of the real world using entity sets and relationships. However, there are a number of other important features of the real world that

Keys in the E/R Model

A key for an entity set E is a set K of one or more attributes such that, given any two separate entities e1 and e2 in E, e1 and e2 cannot have the same values for each of the

Representing Keys in the E/R Model

In our E/R diagram notation, we underline the attributes belonging to a key for an entity set. For instance, the following figure reproduces our E/R diagram for movies, stars, and studios

Single-Value Constraints

Sometimes, an important property of a database design is that there is at most one value playing a specific role. For instance, we assume that a movie entity has a unique title, year,

Referential Integrity

While single-value constraints show that at most one value exists in a given role, a referential integrity constraint asserts that exactly one value exists in that role. We could see

Referential Integrity in E/R Diagrams

We can extend the arrow notation in E/R diagrams to show whether a relationship is expected to support referential integrity in one or more directions. Suppose R is a relationship from

Other Kinds of Constraints

As already mentioned at the beginning of this section, there are other kinds of constraints one could wish to enforce in a database. We shall only touch briefly on these here, with the

Weak Entity Sets

There is a special condition in which an entity set's key is consisting of attributes some or all of which belong to another entity set. Such an entity set is called a weak entity set.

Requirements for Weak Entity Sets

We cannot get key attributes for a weak entity set indiscriminately. Rather, if E is a weak entity set then its key comprises:

Weak Entity Set Notation

We shall adopt the following principles to show that an entity set is weak and to declare its key attributes.

Page 2 of 3 Previous 1 2 3 Next