Entity Relationship Diagram (Erd)

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 12

ENTITY

RELATIONSHIP
DIAGRAM(ERD)
…………………………………………………………………………..
WHAT IS AN ENTITY and ENTITY
RELATIONSHIP DIAGRAM?
 In database administration, an entity could be a single thing, a place or an object.
 ERD is a design tool that allows database administrators to view the relationship
between two or several entities.
ATTRIBUTES
Entities are represented by the means of their properties called
attributes.

RELATIONSHIP
The association among the entities is known as relationship

CARDINALITY
Cardinality defines the number of entities in one entity set, which can
be associated with the number of entity in other set.
TYPES OF CARDINALITY
One to one

A one-to-one relationship is
a link between the
information in two tables,
where each record in each
table only appears once.
One to many

A one-to-many relationship exists in a relational


database when one row in table A is linked to
many rows in table B, but only one row in table
B is linked to one row in table A.
Many to one

In a database management system, a


Many-to-One relationship is defined
as a relationship between several
instances of one entity and one
instance of another entity.
Many to many
In a database management
system, a Many-to-Many
relationship is a relationship
between several instances
of one entity and multiple
instances of another entity,
i.e. both entities can have
multiple relationships with
each other
INTREGRITY
DATA INTEGRITY IS THE OVERALL ACCURACY, COMPLETENESS, AND
CONSISTENCY OF DATA. DATA INTEGRITY ALSO REFERS TO THE SAFETY OF DATA
IN REGARD TO REGULATORY COMPLIANCE

Types of integrity
Entity integrity
Entity Integrity constraint uniquely identifies each row in table. Primary key
assures the entity integrity constraint is applied to a table.
It also states that value in primary key fields cannot be null.
Referential integrity
Referential integrity constraint refers to relationship between the tables. The relationship between
tables is established by using foreign keys. This constraint states that a foreign key must have a
matching primary key in another table or must be null.

Domain integrity
A domain defines the possible values of an attribute
Book Entity: It has author, book_ID,
title, price, and availability.
Publisher Entity: It has publisher_ID,
publisher_address, and
publisher_name.
Member Entity: It has member_ID,
member_date, member_type,
member_address, member_name, and
expiry_date.
In this example, we can see one-to-one
and one-to-many relationships. A
member can borrow many books, but
only one reader can borrow one book.
So, the relationship is 1: Many.
THANK YOU!

You might also like