31271 Lecture Notes - Lecture 2: Unique Key, Foreign Key, Associative Entity
Lecture 2: Data Modelling Part II
Relationship
Relationship Type and Instances
• A relationship type is modelled as lines between entity types, whereas a relationship
instance is between specific entity instances. Relationship instances relate instances
providing more information than the relationship type.
Degree of Relationships
• The degree of a relationship is the number of entity types that participate in it.
o Unary
▪ One entity related to another of the same entity type.
o Binary
▪ Entities of two different types related to each other.
o Ternary
▪ Entities of three different types related to each other
Cardinality of Relationships
• Cardinality tells you how many instances of one entity are related to how many
instances of another entity.
o One-to-One
▪ Each entity in the relationship will have exactly one related entity
o One-to-Many
▪ An entity on one side of the relationship can have many related
entities, but an entity on the other side will have a maximum of one
related entry
o Many-to-Many
▪ Entities on both sides of the relationship can have many related
entities on the other side.
• Cardinality Constraints are the number of instances of one entity that can or must
be associated with each instance of another entity.
o Minimum Cardinality
▪ If zero, then its optional. If one or more then it is mandatory.
o Maximum Cardinality
▪ The maximum number possible.
Multiple Relationships between Entities
• Two entities can have more than one type of relationship between them (multiple
relationships)
find more resources at oneclass.com
find more resources at oneclass.com