Modeling: Map real-world entities and relationships into a database
(a scaled-down version of the real world with pieces we care about)
Entity/Relationship Model: A diagram-based data model
Schema: Structure for entities & relationships
- Entity Set: Category of objects (e.g. professors, courses)
- Relationship Set: Interactions between tables (e.g. professors teach courses)
- Attributes: Properties of entities or relationships
- Keys: Filled circle for single-attr key, a connected line with circles for multi-attr key.
- Foreign Key: Keys accross relationships
Weak Entity Set: An entity set that doesn’t have a key among its attrs.
- Relationship-set Key: Combined key from entities that uniquely identifies a rel~

Instance: Specific entries following a schema
- Entity: A tuple. (e.g. Prof. Mario)
- Relationship: Link between ≥2 entity sets. (e.g. Prof. Mario teaches CSC258)
Recursive Relationship: Link between an entity to itself.
(e.g. employee - <colleague> - employee)
Ternary Relationship: Link between 3 entities
Cardinality & Multiplicity
Relationship Cardinality: (min, max) specifies how many target entities can be in a R~
(e.g. employee - (1, 5) - <assign> - (0, 50) - task:
an employee can be assigned 1-5 tasks, a task can have 0-50 employees assigned)
- Intuition: it's the # of lines from each entity connecting outward through the relationship
- Minimum Cardinality:
If min = 0, optional participation (e.g. a task can have no employees assigned)
If min = 1, mandatory participation (e.g. an employee must be assigned a task)
- A foreign key must come from a relationship where the participating entity is (1,1)