ER Model Concepts
Entities
- Specific things or objects (e.g. student, course)
- Analogous to class of OOP
- Holds Set/Collection of objects : Entity set
Weak Entity
- An entity
without
a key. But has partial key
- Dependent on other entity (owner entity)
Attributes
- Properties to describe an entity
- Elements in each entity have
value
for each attributes
Types of Attributes
- Simple: single/atomic value
- Derived: Derived from another attribute
- Composite: Combination of simple attributes - e.g. name is a combination of first name and last name
- Multi-valued: Multiple values for an attribute - e.g. phone number
- key: an attribute which has unique values - e.g. Social security number
- Composite key: Combination of attributes make it unique
→ 비유하자면 전화번호가 있다. 전화번호 자체는 겹칠 수 있지만, country code를 엮으면 unique함을 보장할 수 있는 것과 관련해서 이해할 수 있다.
Relationship
- Relationship:
relates
two entities - e.g. employee works for a department
Additionally, relationships can have a lot of attributes.
Constraints on Relationships
- Cardinality Ratio / Ratio constraints
Note : Chen Notation
- Participation Constraint / Dependency Constraint
- Zero / optional : 원형으로 표시
- One or more/mandatory/total-participation: 수직선으로 표시
Note : Chen Notation
Recursive Relationship
Database design : full picture
If we have an entity-relationship diagram, it can release ambiguity.
Relational model: database-specific model
Why a conceptual model (e.g. ER)?
- Implementation independent
- Comes with model transformations to be mapped to an implementation data model