Relationship Cardinality

The many in a one-to-many relationship does not mean that there must be more than one instance of the child connected to a parent. The many in one-to-many really means that there are zero, one, or more instances of the child paired up to the parent.

Cardinality is the relational property that defines exactly how many instances appear in a child table for each corresponding instance in the parent table. IDEF1X and IE differ in the symbols that are used to specify cardinality. However, both methods provide symbols to denote one or more, zero or more, zero or one, or exactly N, as explained in the following table:

Cardinality Description

IDEF1X Notation Identifying Nonidentifying

IE Notation Identifying Nonidentifying

One to zero, one, or more

One to one or more

One to zero or one

Zero or one to zero, one, or more (nonidentifying only)

Zero or one to zero or one (nonidentifying only)

Cardinality lets you specify additional business rules that apply to the relationship. In the following figure, the business has decided to identify each MOVIE COPY based on both the foreign key �movie-number� and a surrogate key �copy-number.� Also, each MOVIE is available as one or more MOVIE COPYs. The business has also stated that the relationship is identifying, that MOVIE COPY cannot exist unless there is a corresponding MOVIE.

An example of relationship cardinality using the MOVIE and MOVIE COPY entities

The MOVIE/MOVIE COPY model also specifies the cardinality for the relationship. The relationship line shows that there is exactly one MOVIE, and only one, participating in a relationship. MOVIE is the parent in the relationship.

By making MOVIE COPY the child in the relationship, the business defined a MOVIE COPY as one of several rentable copies of a movie title. The business also determined that to be included in the database, a MOVIE must have at least one MOVIE COPY. Therefore, the cardinality of the is available as relationship is one-to-one or more. The P symbol next to the dot represents cardinality of one or more. As a result, you also know that a MOVIE with no copies is not a legitimate instance in this database.

In contrast, the business may want to know about all of the MOVIEs in the world, even MOVIEs for which they have no copies. So their business rule is that for a MOVIE to exist (be recorded in their information system) there can be zero, one, or more copies. To record this business rule, the P is removed. When cardinality is not explicitly indicated in the diagram, cardinality is one-to-zero, one, or more.