ScholarQuill logoScholarQuillUniversity Notes
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
Study Tools
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
Contact
ScholarQuill logo
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
ScholarQuill logoScholarQuillUniversity Notes
Study PortalCC-215Attributes In Entity R…
Ctrl + K
Login
Explore
Search
Semester
Papers
CGPA
    CC-215

    Database Systems

    Progress0 / 34 done
    Topics34
    1Basic Database Concepts2Database Approach vs File Based System3Database Architecture4Three Level Schema Architecture5Data Independence6Relational Data Model7Attributes8Schemas9Tuples10Domains11Relation Instances12Keys of Relations13Integrity Constraints14Relational Algebra15Selection in Relational Algebra16Projection in Relational Algebra17Cartesian Product in Relational Algebra18Types of Joins19Normalization20Functional Dependencies21Normal Forms22Entity-Relationship Model23Entity Sets24Attributes in Entity-Relationship Model25Relationship in Entity-Relationship Model26Entity-Relationship Diagrams27Structured Query Language (SQL)28Joins in SQL29Sub-Queries in SQL30Grouping and Aggregation in SQL31Concurrency Control32Database Backup and Recovery33Indexes34NoSQL Systems
    5 min read
    Topic 24 of 34
    Topic Study Note Illustration
    24

    Attributes in Entity-Relationship Model

    In the Entity-Relationship (ER) Model , attributes are the properties or characteristics that describe entities and relationships. They define the data that is stored for each entity...

    Attributes in the Entity-Relationship (ER) Model

    In the Entity-Relationship (ER) Model, attributes are the properties or characteristics that describe entities and relationships. They define the data that is stored for each entity or relationship and help in differentiating between instances of entities. For example, an Employee entity might have attributes such as EmployeeID, Name, Salary, and DateOfBirth.


    Types of Attributes in ER Model

    1. Simple (Atomic) Attributes:
      A simple attribute is an indivisible, basic attribute that cannot be further divided. These are also known as atomic attributes.

      • Example: Age, EmployeeID, ZipCode (cannot be broken down into smaller meaningful components).

      • Diagram Representation: Simple attributes are represented as ovals connected to their respective entity set or relationship.

    2. Composite Attributes:
      A composite attribute is an attribute that can be divided into smaller sub-attributes, each of which has its own meaning. A composite attribute is made up of two or more simple attributes.

      • Example: FullName can be a composite attribute consisting of FirstName and LastName.

      • Diagram Representation: Composite attributes are represented as ovals connected to the attribute itself, and the sub-attributes are connected to the composite oval.

    3. Derived Attributes:
      A derived attribute is an attribute whose value can be calculated or derived from other attributes in the database. These attributes are not directly stored in the database, but are instead computed when needed.

      • Example: Age could be derived from the DateOfBirth attribute.

      • Diagram Representation: Derived attributes are represented by dashed ovals.

    4. Multi-valued Attributes:
      A multi-valued attribute is an attribute that can have multiple values for a single entity. For example, a person can have multiple phone numbers or email addresses.

      • Example: A PhoneNumbers attribute might have multiple values such as (123-4567, 987-6543) for a single entity.

      • Diagram Representation: Multi-valued attributes are represented by double ovals.

    5. Key Attributes:
      A key attribute is an attribute that uniquely identifies an entity within an entity set. For instance, EmployeeID in an Employee entity is a key attribute because it uniquely identifies each employee.

      • Example: StudentID in a Student entity set.

      • Diagram Representation: Key attributes are typically underlined in the ER diagram.


    Examples of Attributes for Entities

    1. Employee Entity:

      • Attributes:
        • EmployeeID (Primary Key)
        • Name
        • DOB (Date of Birth)
        • Salary
        • Department
        • Address

      In this case:

      • EmployeeID is a simple attribute.
      • Name could be a composite attribute (with sub-attributes FirstName and LastName).
      • DOB is a simple attribute.
      • Salary is a simple attribute.
      • Department might refer to a relationship between Employee and Department entities.
      • Address might be a composite attribute (with sub-attributes Street, City, and ZipCode).
    2. Course Entity:

      • Attributes:
        • CourseID (Primary Key)
        • CourseName
        • Credits
        • Instructor

      Here:

      • CourseID is a simple attribute (the primary key).
      • CourseName is a simple attribute.
      • Credits is a simple attribute.
      • Instructor could refer to an Instructor entity, potentially creating a relationship.

    Attribute Types Based on Usage

    1. Atomic (Simple) vs. Composite Attributes:

      • Atomic: These attributes have a single value and cannot be divided further.
      • Composite: These attributes are formed by combining simpler attributes.

      Example:

      • Atomic: Age
      • Composite: FullName (FirstName, LastName)
    2. Single-valued vs. Multi-valued Attributes:

      • Single-valued: An attribute that has only one value for an entity instance.
      • Multi-valued: An attribute that can have multiple values for an entity instance.

      Example:

      • Single-valued: EmployeeID (one ID per employee)
      • Multi-valued: PhoneNumbers (one or more phone numbers per employee)
    3. Derived Attributes:
      Attributes that are calculated or derived from other existing attributes.

      Example:

      • Age derived from DateOfBirth.

    Diagram Representation of Attributes

    • Simple Attribute: Represented as a single oval connected to the entity or relationship.
    • Composite Attribute: Represented as an oval connected to a main oval (entity) with additional ovals representing sub-attributes.
    • Multi-valued Attribute: Represented as a double oval.
    • Derived Attribute: Represented as a dashed oval.
    • Key Attribute: Represented by underlining the name of the attribute.

    Relationships Between Attributes

    Attributes can also be related to relationships in the ER model. A relationship in an ER diagram can have its own set of attributes, known as relationship attributes.

    For example, in a Course Enrollment relationship between Student and Course entities, the relationship might have an attribute like EnrollmentDate, which is an additional property of the relationship (not the entities themselves).


    Example ER Diagram for a University System

    Consider the following example ER diagram for a university system:

    • Entity: Student
      • Attributes: StudentID (Primary Key), Name, DOB, Email, PhoneNumbers (multi-valued)
    • Entity: Course
      • Attributes: CourseID (Primary Key), CourseName, Credits
    • Relationship: EnrollsIn (between Student and Course)
      • Attributes: EnrollmentDate (Derived from the relationship between Student and Course)

    Conclusion

    In the Entity-Relationship (ER) Model, attributes are crucial for describing entities and relationships. They define the properties of the entities and provide a structured way to store and retrieve data. Understanding the different types of attributes—simple, composite, derived, multi-valued, and key—is essential for creating an efficient and well-structured database design.

    ← Previous topic 23
    Entity Sets
    Next topic 25 →
    Relationship in Entity-Relationship Model

    Past Papers

    Open this section to view and download past papers

    Click on Show Past Papers to load available exam papers.

    Reading Progress
    0%
    5mremaining
    849words
    Beginnerlevel
    On This Page

    No headings found

    Study Toolkit

    Subject Portal

    Database Systems