Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

ERD Lab Manual

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

Entity-Relationship Model

(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.

Course Learning Outcome:

CLO2. Model database systems using ER diagrams

Materials:
Ø PC
Ø Internet
Ø Draw.io or any modeling tool or apps

Laboratory Discussions:

An entity–relationship model (or ER model) describes interrelated things of interest in a specific


domain of knowledge. A basic ER model is composed of entity types (which classify the things
of interest) and specifies relationships that can exist between entities (instances of those entity
types).

In software engineering, an ER model is commonly formed to represent things a business needs


to remember in order to perform business processes. Consequently, the ER model becomes an
abstract data model, that defines a data or information structure which can be implemented in
a database, typically a relational database.

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

Entities can be thought of as nouns. Examples: a computer, an employee, a song, a


mathematical theorem, etc.

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

How to create the ER diagram?

1. Navigating to browser www.draw.io


2. Start picking create New diagram

3. Navigate to Entity Relation Tool and choose Entity


4. Rename the Entity name for example Building- with the following attributes, building
number, name and Location.
5. Add another Entity Room with attributes RoomID , Description, Capacity ,Width,
High and Equipment as following figure

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.

You might also like