0% found this document useful (0 votes)
16 views6 pages

01 - Entity Relationship Diagram

The document provides an overview of Entity Relationship Diagrams (ERD), detailing the concepts of entities, attributes, and relationships within a database context. It categorizes entities into strong, weak, and associative types, and attributes into various forms such as simple, composite, and derived. Additionally, it explains relationship types, cardinality constraints, and business rules governing entity interactions.

Uploaded by

cawote1850
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views6 pages

01 - Entity Relationship Diagram

The document provides an overview of Entity Relationship Diagrams (ERD), detailing the concepts of entities, attributes, and relationships within a database context. It categorizes entities into strong, weak, and associative types, and attributes into various forms such as simple, composite, and derived. Additionally, it explains relationship types, cardinality constraints, and business rules governing entity interactions.

Uploaded by

cawote1850
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Ms.

Mary William

Entity relationship Diagram

(ERD)

Entity Relationship Diagram (ERD): is a detailed logical representation of the data


for an organization or for a business area.

Entity: It's a person, place, object, event or concept about which the organization
wishes to maintain data.

Always singular and noun Student

Types of entity:

An entity that exists independently of


Strong entity other entity types.

An entity type whose existence


Weak entity depends on some other entity type.

An entity type that associates the


instances of one or more entity types
Associative entity
and contains attributes that are
peculiar to the relationship between
those entity instances.

Employee Family

1
Ms. Mary William

Attribute: It is the characteristics of an entity or the details you want to collect


about a specific entity.

Always singular and noun


Name

Types of attribute:

Type Description Example


1- Simple Attribute an attribute that can't
be broken down into
weight
smaller components.
2- Composite an attribute that can be
Attribute broken down into
smaller components.

3- Multivalued an attribute that may


Attribute take on more than one
value for a given entity
instance.
4- Composite an attribute that may
Multivalued take on more than one
Attribute value and can be
broken down into
smaller components.

5- Derived an attribute whose


Attribute value can be calculated
from related attribute Age
values.

2
Ms. Mary William

6- Primary key / an attribute that


Key attribute uniquely identifies Student ID
(Identifier) individual instance of an
entity.
7- Composite key a key attribute that
attribute consists of a composite
attribute.

8- Forgein key An attribute in an entity


of a database that
serves as the primary Student ID
key of another entity in
the same database.

Relationship: A meaningful association between entity types.

Should contain a verb

The main 4 components of creating a relationship are:

1- Degree of a relationship: The number of entity types that participates in a


relationship.

A- Unary relationship: it is the relationship that contains one entity only.

Employee Course

manages
Has
prerequis
ite

3
Ms. Mary William

B- Binary relationship: it is the relationship between the instances of two


entities.

Customer Submits Order

C- Ternary relationship: is a simultaneous relationship among the


instances of three entities.

Doctor treats Patient

Prescription

Vendor Supplies Part

Warehouse

2- Cardinality constraints of a relationship: Specifies the number of instances


of one entity that can (or must) be associated with each instance of another
entity.

a- one to one relationship:

Employee manages Department

Order has Invoice

4
Ms. Mary William

b- one to many relationship:

Company employs Employee

In case of one to many: Add primary key field of one entity type
(Company) as a foreign key in the table that represents the many entity
type (Employee).

In case of one to one: Add primary key field of the mandatory entity
type as a foreign key in the table that represents the optional entity
type.

Comp.ID Emp.ID Comp.ID

Company employs Employee

c- many to many relationship:

Doctor teaches Course

Database relational model doesn’t offer direct support to many to many


relationships. So, we have to create two binary one to many
relationships.

Doctor Schedule Course

Cou.code
Doc.ID
Doc.ID Cou.code

5
Ms. Mary William

3- Entity participation of a relationship:


Maybe optional or mandatory for the entity involved:
If the minimum cardinality is zero --- participation is optional.
If the minimum cardinality is 1 --- participation is mandatory.

Customer Submits Order

4- Business rule:
- Each customer may submit many orders.
- Each order must be submitted by one customer.

One mandatory

One optional

Many mandatory

Many optional

You might also like