ERD Lab Manual
ERD Lab Manual
ERD Lab Manual
(ER Diagram)
Laboratory Objectives:
After completing this lab exercises, the student will be able to:
Ø Draw an Entity Relationship (ER) diagram from a given specification (or problem
statement).
Ø Draw an ER diagram using draw.io Modeler.
Materials:
Ø PC
Ø Internet
Ø Draw.io or any modeling tool or apps
Laboratory Discussions:
An entity may be defined as a thing capable of an independent existence that can be uniquely
identified. An entity is an abstraction from the complexities of a domain. When we speak of an
entity, we normally speak of some aspect of the real world that can be distinguished from
other aspects of the real world.[4]
An entity is a thing that exists either physically or logically. An entity may be a physical object
such as a house or a car (they exist physically), an event such as a house sale or a car service, or
a concept such as a customer transaction or order (they exist logically—as a concept). Although
the term entity is the one most commonly used, following Chen we should really distinguish
between an entity and an entity-type. An entity-type is a category. An entity, strictly speaking,
is an instance of a given entity-type. There are usually many instances of an entity-type.
Because the term entity-type is somewhat cumbersome, most people tend to use the term
entity as a synonym for this term
A relationship captures how entities are related to one another. Relationships can be thought
of as verbs, linking two or more nouns. Examples: an owns relationship between a company
and a computer, a supervises relationship between an employee and a department, a performs
relationship between an artist and a song, a proves relationship between a mathematician and
a conjecture, etc.
Source: https://en.wikipedia.org/wiki/Entity%E2%80%93relationship_model
Example of ER Diagram:
Source of ER Diagram above: 2013 Pearson Education, Inc. Publishing as Prentice Hall
6. We have various kind of relationships, our relationship one- many as one building has
many rooms.
7. Click and drag on -many relationship in diagram, to give relationship name double click
on relationship
8. In order to save your work navigate to menu bar, File then Export as-- PDF then choose
export – Download.
Laboratory Exercise:
Task1. Transfer the following verbal description into an Entity-Relationship diagram:
• An airplane is assigned to several flights. A flight is assigned to only one airplane.
• A pilot can perform several flights. A flight is performed by several pilots.
Task2. Consider a mail order database in which employees take orders for parts from
customers. The data requirements are summarized as follows:
• The mail order company has employees identified by a unique employee number,
their first and last names, and a zip code where they are located.
• The customers of the company are identified by a unique customer number, their
first and last names, and a zip code where they are located.
• The parts being sold by the company are identified by a unique part number, a part
name, their price, and quantity in stock.
• Each Customer may place one or more orders, each order is placed by customer.
order is filled by employee and is given a unique order number, however employee
may fills one or more orders. Each order contains one or more parts and their
received date as well as a shipped date is recorded.
Task 3. Using the notation introduced in this chapter, draw a single diagram that
represents the following relationships in the hospital environment.
AHOSPITAL has on its staff one or more PHYSICIANs. PHYSICIAN is on the staff
of only one HOSPITAL.
A PHYSICIAN may admit one or more PATIENTs. A PATIENT is admitted by only
one PHYSICIAN.
AHOSPITAL has one or more WARDs. Each WARD is located in exactly one
HOSPITAL.
AWARD has any number of EMPLOYEEs. An EMPLOYEE may work in one or
more WARDs.