System Analysis & Design: Section 6 Eng. Faten Khalifa
System Analysis & Design: Section 6 Eng. Faten Khalifa
Section 6
Eng. Faten Khalifa
Process Modeling
SDLC
Interview Project
JAD Session Planning Plan
Questionnaire
Data Flow Diagram
Data Dictionary Analysis
Process Specification
Implementation
Data Modeling
Data Modeling
• A data model is a formal way of representing
the data that are used and created by a
business system; it illustrates people, places,
or things about which information is captured
and how they are related to each other.
• consists of 3 elements:
1. Entity
2. Attribute
3. Relationship
ERD example
*C_ID C_Name *S_ID S_Name
has
Course Student
Studies
Credits
S_Address *C_ID
Entities
• represent something for which there exist multiple instances,
or occurrences.
• E.g., Adel Mahmoud could be an instance of the customer entity.
Normal
Relationships
* are associations between entities
* should be labeled with verbs
* have (1) cardinality and (2) degree
Cardinality:
– determine the number of instances associated
from one entity to the other and vice versa
– Can be: (1) One-to-One, (2) One-to-Many, (3)
Many-to-Many
How to represent relationships?
Elements of an ERD: (3) Relationships
Relationships
Degree of relationships:
– is the number of entities that participate in the
relationship
– three most common relationships degrees are
1. Binary
2. Unary
3. Ternary
Elements of an ERD: (3) Relationships
Degree of relationships:-
– Binary
Elements of an ERD: (3) Relationships
Degree of relationships:-
– Unary
Elements of an ERD: (3) Relationships
Degree of relationships:-
– Ternary
Summary of ERD Elements
How to create the ERD?
• Drawing the ERD is an iterative process of trial
and revision
6-18
Step 1: Identify the Entities
• Guidelines:
6-19
Step 2: Add Attributes and Assign Identifiers
6-21
Example 1
1. A department employs many employees, but
each employee is employed by one
department. Some employees, known as
"rovers," are not assigned to any
department. One of the employees manages
each department.
employs
Department Employee
is employed by
Example 1 (cont.)
2. A division operates many departments, but
each department is operated by one division.
employs
Department Employee
is employed by
is operated by
operates
Division
Example 1 (cont.)
3. An employee may be assigned to many projects and
a project may have many employees assigned to it.
A project must have at least one employee assigned
to it.
employs
Department Employee
is employed by
is operated by
Is assigned to
operates
Error !!!!!!
Many to Many
Relationship
Division Project
Example 1 (cont.)
employs
Department Employee
is operated by is employed by
operates
EMP_PRO
Division
Project
ERD Example 2 (patient treatment)
Name
address Phone
Specialty
PName
experiences
Patient treatment
is given to
Paddress
Prescription
visitDate insures subscribes belongs includes -Name
to to
CName
Insurance Carrier Prescription Dosage
Caddress
CPlan Amount
Example 3
• Draw the ERD for the following situations.
Show the needed attributes.
– A college course may have one or more scheduled
sections, or may not have a scheduled section.
Attributes of COURSE include Course_ID, name,
and Credits. Attributes of SECTION include
Section_ID, and Semester_ID (A composite
attribute consisting of Semester and Year).
Solution of Example 3
has
Course Section
Credits Semester_ID
Semester Year
Example 4
• Draw ERD for the following company system:
– A company has a number of employees. The attributes of
EMPLOYEE are Employee_ID, Name and birthdate. The
company also has several projects. Attributes of PROJECT
are Project_ID, Project_name, and Start_Date. Each
employee may be assigned to one or more projects, or
may not be assigned to a project. A project must have at
least one employee assigned to it, and may have many
employees assigned to it. An employee’s billing rate may
vary by project, and the company wishes to record the
applicable billing rate (Billing_Rate) for each employee
when assigned to a particular project.
Solution of Example 4
assigned to
Employee Project
Ingredient Vendor
Task 1
• Draw ERD for the following system:-
– A group of taxi owners decided to set up a database system to
help their business. Several control centers are to be spread
around the city to receive calls made by customers requesting
the services of a taxi. Each control center is formed by a number
of taxi owners, while each owner may have one or more taxi.
Taxi drivers are hired by individual control centers. After a driver
has been hired, the driver will be assigned to drive a particular
taxi. There are two working shifts for taxi drivers. A taxi driver
works only either in the morning shift or the evening shift
normally. When a driver is unable to attend work, another taxi
driver who usually works in the other shift will replace him. The
replacement driver is pre-determined by the control center.
Task 1 (Cont)
– Each control center will have several control desks to
receive calls from customers. Every call is bound to the
control desk that responded to it. One does not associate
any call with more customers than the one who made it.
Once the control desk finds a suitable driver to serve to
the call, it sends that driver and that one only. Further,
customers information are kept in the database once they
are being attended to. That is to say, after a taxi is sent to
the location of the call, the record of the call and of the
customer who made it are logged. To simplify accounting
purposes, taxi drivers will only report to and receive
commands from one control desk.
Solution of Task 1
Task 2
• Please draw ERD about book and reader, if necessary, add
associative entity to represent the relationship between
book and reader.
– A library has many books and many readers. one reader can
borrow many books, one book can be borrowed by many
readers at different times. If a book is lent to a reader, the
lending date and return date must be recorded. Attributes about
book and reader are given below:
– Book: book number, book name, author, price, publishing date,
status.
– Reader: card number, reader name, gender, address, phone
number.
Task 3
• Draw the following binary relationships and indicate
min and max cardinalities, degree of each
relationship.
1. A hospital consists of different departments, each
department provides services to only one hospital.
2. Each team member can work on several IT projects
simultaneously; each IT projects involves different team
members.
3. Each invoice corresponds to a particular order, the
invoice is created only if order is accepted and finalized.
Task 4
• Based on the following description, draw an ER diagram of a
walk-in clinic information system than will keep track of patients,
doctors, appointments and medications.
– A patient comes to doctor by appointment. Each patient has a unique
number, name, address, date of birth, date and time of appointments
with doctors. A patient may receive medications, which are assigned by
a doctor. Each medication is described by a unique number, name,
manufacturer name. Each doctor is characterized by employee id
number, name, phone and specialization.
1. Indicate min and max cardinalities and degree of each
relationship.
2. Show the attributes of each data entity.
3. If required, present a solution to avoid many-to-many
relationships.
Task 5
• Given the following data attributes and
entities, indicate which attributes could be
identifiers for each of the entities. You may
have to combine attributes or even add some
attributes that are not listed. Map all of the
attributes to their appropriate entity.
Remember, each attribute should describe
one and only one entity. Draw a rough draft
entity relationship diagram.
Task 5 (cont)
• Entities:
Seller House Closing
Buyer OfferShowing
Listing Property Room
• Attributes:
Seller name Square foot size Seller address
House style Closing location Listing price
Number of bathrooms Garage size Showing date
Garage location Buyer name Basement size
House heating method Offer amount Listing date
Property descriptionOffer dateRoom type
Property size Showing time Room size
Elementary school zone Buyer phone number Closing date
Sales terms
Required
• Complete your project:
1. Draw the ERD of your project