Understanding Entity Relationship Model Concepts

Nov 19, 2024

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

  1. Composite Attributes

    • Can be divided into parts.
    • Example: Name (First Name, Middle Name, Last Name)
  2. Simple Attributes

    • Cannot be divided further.
    • Examples: Weight, Salary, Age
  3. Single-Valued Attributes

    • Have one value for a particular entity.
    • Example: Age of a person
  4. Multi-Valued Attributes

    • Can have multiple values for a particular entity.
    • Examples: College Degrees, Languages Known
  5. Derived Attributes

    • Can be derived from other attributes.
    • Example: Age (derived from Date of Birth)
  6. Stored Attributes

    • From which values of other attributes are derived.
    • Example: Date of Birth
  7. 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

  1. Value Exists but Missing: E.g., Joshua's age exists but is missing.
  2. 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.