Download as pdf or txt
Download as pdf or txt
You are on page 1of 23

FACULTY OF INFORMATION TECHNOLOGY

SCHOOL YEAR: 2020– 2021


SEMESTER II
DATABASE SYSTEMS

LAB 7 – ERD

A. Tutorial.
- Create ERD model for conceptual design
A conceptual data model (CDM) helps you analyze the conceptual structure of an
information system, to identify the principal entities to be represented, their attributes,
and the relationships between them. A CDM is more abstract than a logical (LDM) or
physical (PDM) data model.
A CDM allows you to:
- Represent the organization of data in a graphic format to create Entity Relationship
Diagrams (ERD).
- Verify the validity of data design.
- Generate a Logical Data Model (LDM), a Physical Data Model (PDM) or an Object-
Oriented Model (OOM), which specifies an object representation of the CDM using
the UML standard.

I. Design conceptual model


1. Open Power Design program
Select File àNew à choose conceptual design model.
Model name: choose the name for your model.
FACULTY OF INFORMATION TECHNOLOGY
SCHOOL YEAR: 2020– 2021
SEMESTER II
DATABASE SYSTEMS

2. After that, follow these steps below to create entities:


FACULTY OF INFORMATION TECHNOLOGY
SCHOOL YEAR: 2020– 2021
SEMESTER II
DATABASE SYSTEMS

3. To rename and add more attribute to an entity, we make a double-click on that entity or
right-click and choose Properties.
FACULTY OF INFORMATION TECHNOLOGY
SCHOOL YEAR: 2020– 2021
SEMESTER II
DATABASE SYSTEMS
FACULTY OF INFORMATION TECHNOLOGY
SCHOOL YEAR: 2020– 2021
SEMESTER II
DATABASE SYSTEMS
FACULTY OF INFORMATION TECHNOLOGY
SCHOOL YEAR: 2020– 2021
SEMESTER II
DATABASE SYSTEMS
FACULTY OF INFORMATION TECHNOLOGY
SCHOOL YEAR: 2020– 2021
SEMESTER II
DATABASE SYSTEMS

After creating, we will have an entity as below.


FACULTY OF INFORMATION TECHNOLOGY
SCHOOL YEAR: 2020– 2021
SEMESTER II
DATABASE SYSTEMS

4. After creating entities, we start to set keys for each entity.


FACULTY OF INFORMATION TECHNOLOGY
SCHOOL YEAR: 2020– 2021
SEMESTER II
DATABASE SYSTEMS
FACULTY OF INFORMATION TECHNOLOGY
SCHOOL YEAR: 2020– 2021
SEMESTER II
DATABASE SYSTEMS
FACULTY OF INFORMATION TECHNOLOGY
SCHOOL YEAR: 2020– 2021
SEMESTER II
DATABASE SYSTEMS

In PowerDesigner, primary key is symbolled by ‘pi’ and foreign key is symbolled by ‘ai’.

5. Set relationship between entities.


FACULTY OF INFORMATION TECHNOLOGY
SCHOOL YEAR: 2020– 2021
SEMESTER II
DATABASE SYSTEMS

To modify the relationship we right-click on the relation.


FACULTY OF INFORMATION TECHNOLOGY
SCHOOL YEAR: 2020– 2021
SEMESTER II
DATABASE SYSTEMS
FACULTY OF INFORMATION TECHNOLOGY
SCHOOL YEAR: 2020– 2021
SEMESTER II
DATABASE SYSTEMS
FACULTY OF INFORMATION TECHNOLOGY
SCHOOL YEAR: 2020– 2021
SEMESTER II
DATABASE SYSTEMS

II. Convert conceptual modoel ERD to physical model.


After creating ERD we choose Tool -> Genarate physical data model.
FACULTY OF INFORMATION TECHNOLOGY
SCHOOL YEAR: 2020– 2021
SEMESTER II
DATABASE SYSTEMS
FACULTY OF INFORMATION TECHNOLOGY
SCHOOL YEAR: 2020– 2021
SEMESTER II
DATABASE SYSTEMS
FACULTY OF INFORMATION TECHNOLOGY
SCHOOL YEAR: 2020– 2021
SEMESTER II
DATABASE SYSTEMS

III. Create database from physical model.


Choose menu database -> generate database:
FACULTY OF INFORMATION TECHNOLOGY
SCHOOL YEAR: 2020– 2021
SEMESTER II
DATABASE SYSTEMS
FACULTY OF INFORMATION TECHNOLOGY
SCHOOL YEAR: 2020– 2021
SEMESTER II
DATABASE SYSTEMS

The RESULT LIST shows errors if they occur and GENERATED FILES lets we know where
the SQL file is stored. We can choose edit to see SQL code.
FACULTY OF INFORMATION TECHNOLOGY
SCHOOL YEAR: 2020– 2021
SEMESTER II
DATABASE SYSTEMS
FACULTY OF INFORMATION TECHNOLOGY
SCHOOL YEAR: 2020– 2021
SEMESTER II
DATABASE SYSTEMS
FACULTY OF INFORMATION TECHNOLOGY
SCHOOL YEAR: 2020– 2021
SEMESTER II
DATABASE SYSTEMS

B. Exercise
Draw an ERD for the following situation.
1. A hospital has a large number of registered physicians. Attributes of PHYSICIAN
include Physician_ID (the identifier) and Specialty.
- Patients are admitted to the hospital by physicians. Attributes of PATIENT include
Patient_ID (the identifier) and Patient_Name. Any patient who is admitted must have
exactly one admitting physician.
- A physician may optionally admit any number of patients. Once admitted, a given
patient must be treated by at least one physician. A particular physician may treat any
number of patients, or may not treat any patients. Whenever a patient is treated by a
physician, the hospital wishes to record the details of Treatment_Detail include Date,
Time, and Results.

2. A nonprofit organization depends on a number of different types of persons for its


successful operation. The organization is interested in the following attributes for all of
these persons: SSN, Name, Address, City/State/Zip, and Telephone. Three types of
persons are of greatest interest: employees, volunteers, and donors.
- Employees only have a Date_Hired attribute
- Volunteers only have a Skill attribute.
- Donors only have relationship (named Donates) with an Item entity type. A donor must
have donated one or more items, and an item may have no donors, or one or more
donors.
- There are persons other than employees, volunteers, and donors who are of interest of
the organization, so that a person need not belong to any of these three groups. On the
other hand, at a given time a person may belong to tow or more of these groups (e.g.,
employee and donor).

You might also like