You are here

Mandatory

19 January, 2016 - 14:28

One entity occurrence requires a corresponding entity occurrence in a relationship

media/image8.png

This example shows one or many. The many side is mandatory. 

media/image9.png
Figure 9.2
 

media/image10.png

This example shows one or many. The many side is mandatory. 

media/image11.png
Figure 9.3

So far we have seen that the right hand side can have

media/image12.png

a 0 (zero) cardinality and a connectivity of many or one.

The left hand side can also have a cardinality

media/image13.png

of 0 (zero).

However, it cannot have a connectivity of 0 only 1 (as shown). The connectivity symbols show maximums. So if you think about it logically, if the connectivity symbol on the left hand side shows 0, then there would be no connection between the tables. The way to read the left hand side is: The CustID in the Order table must be found in the Customer table a minimum of 0 and a maximum of 1 time. The 0 means that the CustID in the Order table may be null. The left most 1 (right before the 0 representing connectiv ity) says that if there is a CustID in the Order table it can only be in the Customer table once. When you see the 0 symbol for cardinality you can assume two things. The FK in the Order table allows nulls, and the FK is not part of the PK since PKs must not contain null values.

media/image14.png
Figure 9.4