0% found this document useful (0 votes)
15 views18 pages

Lecture 6 - Entity Relationship Modeling

a

Uploaded by

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

Lecture 6 - Entity Relationship Modeling

a

Uploaded by

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

Entity Relationship Diagram

(ERD)

FACULTY OF CS & IT
UNIVERSITY OF GUJRAT
Data Modeling
A detailed model that captures overall
structure of organizational data while
being independent of any
implementation considerations
Typically data modelling is carried out
parallel with other requirements
analysis and structuring steps during
the systems analysis phase.
Following this, the data model
supporting the scope and requirements
of the proposed system is developed.
2
Entity Relationship Diagram
Model: A Data Modeling
Approach.
 Proposed by Peter Chen in 1976
 Entity Relationship Diagram is a form of data
modelling
 A logical representation of the data of an
organization or business area in graphical
form
 Data modelling involves examining the data
objects in a system and identifying the
relationship between these objects
 Top-down approach to database design
 The primary purpose of an ERD is to
document the logical structure of a database
3
Why ERD ?
Conceptual design: (ER Model is
used at this stage.)
◦ What are the entities and relationships
in the enterprise?
◦ What information about these entities and
relationships should we store in the
database?
◦ What are the integrity constraints or
business rules that hold?
◦ A database `schema’ in the ER Model can
be represented pictorially (ER diagrams).
◦ An ER diagram can be mapped into a
relational schema.
4
Basic Symbols
Components Symbol
Name
Entity
Department

Attribute
Staff No.

Relationship
employs

5
An Entity
An entity is a thing of interest to a
system about which information is kept

For example in a Hospital


Administration System, some likely
entities would include: Patient, Doctor,
Operation, Ward

Each of these things are of interest to


the system and would have data
stored about them

6
Choosing Entities
Example
◦ A sale always starts with a customer
receiving an estimate. The estimate
then becomes an order. An order can
be for one or more stock items. Each
stock item belongs to a certain stock
category (e.g. taps, sinks, cupboards
etc.)

7
An Attribute
An attribute is an item of data
held about an entity
In computer systems an attribute
is a field of information
Example : Sales System
◦ Entity : Customer
◦ Attributes : Customer Name,
Customer Address, Customer Phone
Number

8
For Example
Ina Sales System, customer
name and address are
attributes of the entity
customer.

The primary key is likely to be


Customer Code or Customer ID as
the unique identifier for each
customer in the system.
9
Scenario Example of ERD
An Organization wants to run a
home appliances service center.
Customers call to request a
technician and the center
Coordinator assigns an employee
to suit for the customer from a
list of employees available for the
particular day requested.

10
Service Center System
Data is used to:
◦ Assign employee to job
◦ Determine availability
Data to be captured in database:
◦ Employee data
◦ Job data
◦ Customer data

11
ERD - Service Center System

Employee Customer

assigned to Related to
Job
Service Center System
◦ Employee
 Attributes: EmpID, Name, Address,
Phone Number, Available Hours,
JobNo
◦ Job
 Attributes: JobNo, JobDate, JobTime,
EmpID
◦ Customer
 Attributes: CusNo, Name, Address,
Phone Number, JobNo
13
Entity Instance
An entity instance is a single
occurrence of an entity type.
An entity type is described just once
in a data model while many instances
of that data type may be represented
by data stored in the system.
◦ There is one EMPLOYEE entity type in
most organisations but there may be
hundred or thousands of instances of this
entity type in the company.
Example
◦ A sale always starts with a customer
receiving an estimate.The estimate
then becomes an order. An order can
be for one or more stock items. Each
stock item belongs to a certain stock
category (e.g. taps, sinks, cupboards
etc.)
From the narrative we can
deduce
◦ An Estimate becomes an Order
◦ An Estimate is issued to a particular
Customer
◦ An Estimate refers to a Stock Item(s)
◦ An Order is placed by the Customer
◦ An Order refers to a Stock Item(s)
◦ A Stock Item refers to a particular
Stock Category
Order System

Order Refers to

Places

Becomes
Stock Item

Issued to Refers to

Customer Estimate
Refers to

Stock
Category
Entity Primary Key Other Attributes

Estimate Estimate Number Date


Customer Number
Stock Item Code

Order Order Number Same as Estimate

Customer Customer Number Customer Name


Customer Address
Credit Limit

Stock Item Stock Item Code Description


Number in Stock
Supplier Code
Stock Category Category Code Category Description

18

You might also like