Degree
- number of attributes (when talking about relations)
- for a table with 4 columns / attributes, the degree is 4
- number of entity type or entity sets associated (when talking about relationships)
- types - unary, binary, ternary, n-nary
- note:
typeof entities involved isnt same thenumberof entities (Studentenrolled in aCoursehas a degree of 2, no matter how many students or courses are present)
Cardinality
- number of instances of one entity that can be associated with instances of another entity
- describes the relationship’s multiplicity
- types:
- 1:1 - one instance of A can be mapped to one instance of B
- 1:N - one instance of A can be mapped to N instances of B
- M:N - M instances of A can be mapped to N instances of B
- implemented using primary & foreign keys, and join tables for M:N relationships
A relationship connects entities.
Cardinality describes how many instances of one entity relate to instances of another within that relationship.
Types of relationships:
- based on cardinality
- one to one (1:1)
- one to many (1:N)
- many to many (M:N)
- based on degree of relationship
- unary (degree: 1)
- binary (degree: 2)
- ternary (degree: 3)
- n-ary (degree: 4)
- based on participation
- total participation: all instances of the entity are involved in the relationship
- partial participation: only some instances of the entity are involved