DBMS Lecture: Entity Relationship Model (ER Model)
Introduction
- The ER model describes data as:
- Entities
- Attributes
- Relationships (to be covered in future lectures)
Entities
- Defined as things with an independent existence in the real world.
- Physical Entities: House, Person, Employee
- Conceptual Entities: Course, Job
Attributes
- Properties that describe entities.
- Example:
- For a "Person" entity, attributes might include Name, Age, Address, Phone Number.
Types of Attributes
-
Composite Attributes
- Can be divided into parts.
- Example: Name (First Name, Middle Name, Last Name)
-
Simple Attributes
- Cannot be divided further.
- Examples: Weight, Salary, Age
-
Single-Valued Attributes
- Have one value for a particular entity.
- Example: Age of a person
-
Multi-Valued Attributes
- Can have multiple values for a particular entity.
- Examples: College Degrees, Languages Known
-
Derived Attributes
- Can be derived from other attributes.
- Example: Age (derived from Date of Birth)
-
Stored Attributes
- From which values of other attributes are derived.
- Example: Date of Birth
-
Complex Attributes
- Contain both multi-valued and composite components.
- Example: College Degrees (multi-valued), components within parentheses (composite attributes)
Null Values
- Used when an attribute value is not applicable or unknown.
- Not Applicable: E.g., College Degree for someone without one.
- Unknown: E.g., Phone number of Jeremy if unknown.
Categories of Null
- Value Exists but Missing: E.g., Joshua's age exists but is missing.
- Existence Unknown: E.g., Unknown if Jeremy has a phone number.
Entity Type
- A collection of entities with the same attributes.
- Example: Student (entities with age attribute)
Entity Set
- A collection of entities of a specific type at a point in time.
- Example: Students aged between 19 and 23.
Key Attribute
- Identifies an entity uniquely.
- Example: Roll number or Student ID for students.
Value Set of Attributes
- Specifies the possible set of values for an attribute.
- Example: Age of an employee (integers between 22 and 60).
These terminologies form the foundation of understanding the ER model in a DBMS context.