Cardinality of Relationships
- Maximal cardinality
- one to one
- An employee has only one badge, each badge is assigned to only one employee
- many to one
- An employee may have many computers. Each computer is assigned to exactly one employee.
- many to many
- An employee may have many skills. Each skill may be attached to many employees.
- These are has a relationships.
- Minimal cardinality
- As we discussed before, is an item required or optional.
- We represent these using "Crow's Foot Diagrams"
- Minimal cardinality bar or 0 (Inside)
- Maximal cardinality bar or crow's foot (Outside)
- No good options for E=R Diagram tools
- I use DIA
- Database mode, tables are not quite there, but they will do.
-
- An entity is strong if it can exist on it's own.
- In the above example, we can have a SKU without having an ORDER_ITEM.
- So SKU is a strong entity.
- But we can not have an Order_Item without a SKU, so it is a weak entity
- He gives the example of a person and an automobile, both would be strong,
- But an Automobile and a registration would be weak.
- Or a room in a building
- Weak entities are drawn with rounded corners.
- ID-Dependent Relationships
- The identifier includes the identifier in another entity.
- ORDER_ITEM is ID-Dependent
- If a relation is id-dependent it is normally drawn with solid lines
- Otherwise it is drawn with dashed lines.