0% found this document useful (0 votes)
42 views

ERD Notes A Level

An entity-relationship diagram (ERD) models the entities and relationships within an information system. Entities represent objects like people or items, attributes describe entity properties, and relationships link entities. An ERD defines the cardinality and modality of each relationship, specifying the minimum and maximum number of relationships between entities. ERDs help design relational databases by mapping entities and attributes to tables and columns.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views

ERD Notes A Level

An entity-relationship diagram (ERD) models the entities and relationships within an information system. Entities represent objects like people or items, attributes describe entity properties, and relationships link entities. An ERD defines the cardinality and modality of each relationship, specifying the minimum and maximum number of relationships between entities. ERDs help design relational databases by mapping entities and attributes to tables and columns.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Entity Relationship Diagram (ERD)

An entity-relationship diagram—otherwise known as an ERD—is


a data modeling technique that creates an illustration of an
information system's entities and the relationships between those
entities.
3 ingredients of entity-relationship diagram

Entities: which represent people, places, items, events,


concepts.
Attributes: which represent properties or descriptive qualities of
an entity. These are also known as data elements.

Relationships: which represent the link between different entities.

ER Diagram Symbols and Notations

Entity Relationship Diagram – Notes by Sir M Zeeshan Shafique - +923334706615


Cardinality and Modality
Cardinality and Modality work together to define the relationship.

 Cardinality indicates the maximum number of times an


instance in one entity can be associated with instances in the
related entity
 Modality indicates the minimum number of times an
instance in one entity can be associated with an instance in
the related entity.

Thus, Modality is also called participation because it denotes


whether or not an instance of an entity MUST participate in the
relationship.

Cardinality and Modality are both shown on the relationship line


by symbols. We will go over each of the symbols and how to
interpret them.

Cardinality

Cardinality indicates the maximum number of times an instance of


one entity can be associated with instances in the related entity.
Cardinality can have the values of one or many, no more detail
than that. It is either one or more than one. On the relationship
line, the cardinality is the closest to the entity box. The cardinality
symbol in the diagram on the slide is in the red circle. Cardinality
is indicated at BOTH ends of the relationship line, so there is a left
to right cardinality and a right to left cardinality.

Entity Relationship Diagram – Notes by Sir M Zeeshan Shafique - +923334706615


Modality

Modality indicates the minimum number of times an instance in


one entity can be associated with an instance in the related entity.
Modality can have the values of zero or one, two or three are not
allowed. The modality symbol is located next to the cardinality
symbol, on the inside, i.e., NOT next to the entity box. A modality
of one is denoted by a straight vertical line and a modality of zero
is denoted by a circle. Like cardinality, modality is indicated at
both ends of the relationship. Reading Modality and Cardinality

Types of Attributes
• Simple attribute − Simple attributes are atomic values, which
cannot be divided further. For example, a student's phone
number is an atomic value of 10 digits.

• Composite attribute − Composite attributes are made of more


than one simple attribute. For example, a student's complete
name may have first_name and last_name.

• Derived attribute − Derived attributes are the attributes that


do not exist in the physical database, but their values are
derived from other attributes present in the database. For
Entity Relationship Diagram – Notes by Sir M Zeeshan Shafique - +923334706615
example, average_salary in a department should not be saved
directly in the database, instead it can be derived. For another
example, age can be derived from data_of_birth.
• Single-value attribute − Single-value attributes contain single
value. For example − Social_Security_Number.

• Multi-value attribute − Multi-value attributes may contain


more than one values. For example, a person can have more
than one phone number, email_address, etc.

Types of Entity –

Strong Entity Types

Recursive Entity Types

Weak Entity Types

Composite Entity Types or Associative Entity Types

Entity Relationship Diagram – Notes by Sir M Zeeshan Shafique - +923334706615


Relationship
Relationships are represented by diamond-shaped box. Name of
the relationship is written inside the diamond-box. All the entities
(rectangles) participating in a relationship, are connected to it by a
line.
Binary Relationship and Cardinality
A relationship where two entities are participating is called a
binary relationship. Cardinality is the number of instance of an
entity from a relation that can be associated with the relation.

Entity Relationship Diagram – Notes by Sir M Zeeshan Shafique - +923334706615


•One-to-one − When only one instance of an entity is
associated with the relationship, it is marked as '1:1'. The
following image reflects that only one instance of each entity
should be associated with the relationship. It depicts oneto-
one relationship.

• One-to-many − When more than one instance of an entity is


associated with a relationship, it is marked as '1:N'. The
following image reflects that only one instance of entity on
the left and more than one instance of an entity on the right
can be associated with the relationship. It depicts one-to-
many relationship.

• Many-to-one − When more than one instance of entity is


associated with the relationship, it is marked as 'N:1'. The
following image reflects that more than one instance of an
entity on the left and only one instance of an entity on the
right can be associated with the relationship. It depicts many-
to-one relationship.

Entity Relationship Diagram – Notes by Sir M Zeeshan Shafique - +923334706615


• Many-to-many − The following image reflects that more
than one instance of an entity on the left and more than one
instance of an entity on the right can be associated with the
relationship. It depicts many-to-many relationship.

Entity Relationship Diagram – Notes by Sir M Zeeshan Shafique - +923334706615

You might also like