10.07.2015 Views

Using Data Modeler

Using Data Modeler

Using Data Modeler

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CardinalityCardinality is the minimum and maximum number of possible instantiations of arelationship between two tables. Cardinality is used to enforce referential integrity. Ifa table has a cardinality of 1, then that signifies the table must exist in the relationship.This cardinality is especially important for parent tables to prevent orphan records inthe child tables.Cardinality can also determine if a foreign key is unique and can be nullable. It is theforeign key’s ability to be NULL that can determine if you should use an identifyingor non-identifying relationship. If the parent table has a cardinality of one or more theforeign key cannot be NULL. Below is a table specifying the necessary cardinalities tomake a foreign key nullable and/or unique.Table 1Cardinalities for Foreign Key ConstraintsRequired ConstraintsParent TableCardinalityChild TableCardinalityForeign key is nullable and unique 0..1 0..1 or 1Foreign key is nullable and not unique 0..1 0..* or 1..*Foreign key is not nullable and not unique 1 1..* or 0..*Foreign key is not nullable, but is unique 1 0..1 or 1RolesRoles in a relationship explain how the table acts in the relationship, giving meaning tocardinality. You can apply roles to either one table or both tables in a relationship.Roles combined with cardinality create a grammatical statement of what is occurringin the relationship. So as each parent table in a relationship acts as a noun, the role actsas a verb and the child table acts as a direct object, and vice versa. For example inFigure 18 on page 38 the role of the relationship between a clinic and the services itprovides is stated: One clinic provides one or more services.Building a New <strong>Data</strong> Model 37

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!