You have 3 free guides left 😟
Unlock your guides
You have 3 free guides left 😟
Unlock your guides

- (ER) modeling is a crucial part of database design. It helps us visualize and organize data relationships. In this section, we'll learn how to create ER diagrams, which are visual representations of these relationships.

We'll cover the key components of ER models, including entities, attributes, and relationships. We'll also explore different notation styles like Chen and Crow's Foot, and dive into various relationship types. This knowledge will help you design effective database structures.

Entity-Relationship Model Components

Core Components of ER Models

Top images from around the web for Core Components of ER Models
Top images from around the web for Core Components of ER Models
  • Entity Set represents a collection of entities of the same type that share similar properties (Employee, Department, Project)
  • Relationship Set defines associations or interactions between two or more entity sets (works_for, manages, assigned_to)
  • Attributes describe the properties or characteristics of an entity or relationship set and can be of different types such as simple, composite, single-valued, or multi-valued (Employee: employee_id, name, address; Department: department_id, name, location)
  • Key Attributes uniquely identify each entity instance in an entity set and can be a single or a combination of attributes (Employee: employee_id; Department: department_id)

Advanced ER Model Concepts

  • Participation Constraint determines whether the existence of an entity depends on its relationship with another entity and can be either total participation or partial participation
    • Total Participation means every entity instance in one entity set must be associated with at least one entity instance in the related entity set (every Employee must be assigned to a Department)
    • Partial Participation means an entity instance in one entity set may or may not be associated with an entity instance in the related entity set (an Employee may or may not be assigned to a Project)
  • Recursive Relationship occurs when an entity set participates in a relationship with itself, representing a hierarchical or network structure (an Employee can manage other Employees)
  • Set depends on the existence of another entity set, called the identifying entity set, and cannot be uniquely identified by its own attributes (Dependent entity set relies on the Employee entity set)
    • Weak entities are represented by double rectangles in ER diagrams
    • Identifying relationship connects a weak entity set to its identifying entity set and is represented by a double

ER Diagram Notations

Chen Notation

  • , introduced by Peter Chen in 1976, is a popular way to represent ER diagrams
  • Entities are represented by rectangles
  • Relationships are represented by diamonds
  • Attributes are represented by ovals and are connected to their respective entities or relationships
  • Cardinality is represented by placing numbers or symbols near the connection between entities and relationships (1:1, 1:N, M:N)
  • Chen notation provides a clear and intuitive way to visualize the structure of a database schema

Crow's Foot Notation

  • , also known as Information Engineering (IE) notation, is another widely used ER diagram notation
  • Entities are represented by rectangles
  • Relationships are represented by lines connecting the entities
  • Cardinality is represented by symbols at the ends of the relationship lines
    • A single line indicates a (1:1) relationship
    • A crow's foot (three lines) indicates a (1:N) relationship
    • A crow's foot at both ends indicates a (M:N) relationship
  • Attributes are listed inside the entity rectangles
  • Crow's Foot notation emphasizes the cardinality and directionality of relationships, making it easier to understand the data flow and dependencies

Relationship Types

Identifying Relationship

  • An identifying relationship is a type of relationship where the child entity's primary key includes the primary key of the parent entity
  • The child entity is considered a weak entity because its existence depends on the parent entity
  • Identifying relationships are represented by solid lines in ER diagrams
  • An example of an identifying relationship is the relationship between Order (parent) and OrderItem (child), where the primary key of OrderItem consists of the Order's primary key and an additional attribute (order_id, item_number)

Non-identifying Relationship

  • A non-identifying relationship is a type of relationship where the child entity's primary key does not include the primary key of the parent entity
  • The child entity is considered a because it can exist independently of the parent entity
  • Non-identifying relationships are represented by dashed lines in ER diagrams
  • An example of a non-identifying relationship is the relationship between Student and Course, where a Student can enroll in multiple Courses, but the primary key of the Student entity (student_id) is not included in the primary key of the Course entity (course_id)
© 2024 Fiveable Inc. All rights reserved.
AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.


© 2024 Fiveable Inc. All rights reserved.
AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.

© 2024 Fiveable Inc. All rights reserved.
AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.
Glossary
Glossary