Sie sind auf Seite 1von 12

LAB 3 & 4: DATA MODELING WITH ENTITY RELATIONSHIP DIAGRAM (ERD)

Entity Relationship Diagram (ERD) Lab Activities

Exercise 1
Given below is an incomplete Entity-Relationship diagram and the business rules to describe
relationships between Team, Player and Coach. Team is related to Player and Team is related to
Coach. The business rules are:

 A Team may or may not have a Player


 A Player must have a team
 A Team may have many Players (a maximum of 12 players)
 A Player has only one Team
 A Team may or may not have a Coach
 A Coach must have a Team
 A Team may have up to three Coaches
 A Coach has only one Team.

Complete the diagram and include the following components:

a) Cardinality
b) Relationship with the relationship name
c) Connectivities
d) Foreign Key

TEAM PLAYER

PK Team_ID PK Player_ID

Team_Name Player_Name

Team_Color Player_DateOfBirth

COACH

PK Coach_ID

Coach_Name

Coach_Phone_Number

1
Exercise 2
• A book is identified by its ISBN number, and it has a title, a price, and a date of
publication. It is published by a publisher, which has its own ID number and a name.
Each book has exactly one publisher, but one publisher typically publishes multiple
books over time.

• A book is written by one or multiple authors. Each author is identified by an author


number and has a name and date of birth. Each author has either one or multiple
books; in addition, occasionally data are needed regarding prospective authors who
have not yet published any books

Draw the Crow’s Foot ERDs to represent the Book Publication Database.

Exercise 3

The Artist database conforms to the following conditions:

A painter might paint many paintings. To be considered a painter in the Artist database,
the painter must have painted at least one painting. Each painting is painted by one (and
only one) painter. A painting might (or might not) be exhibited in a gallery.

Exercise 4
A software contract and consultancy firm maintains details of all the various projects in
which its employees are currently involved. These details comprise:

 Employee Number
 Employee Name
 Date of Birth
 Department Code
 Department Name
 Project Code
 Project Description
 Project Supervisor

2
Assume the following:

 Each employee number is unique.


 Each department has a single department code.
 Each project has a single code and supervisor.
 Each employee may work on one or more projects.
 Employee names need not necessarily be unique.

Exercise 5
A college maintains details of its lecturers' subject area skills. These details comprise:
 Lecturer Number
 Lecturer Name
 Lecturer Grade
 Department Code
 Department Name
 Subject Code
 Subject Name
 Subject Category

Assume that each lecturer may teach many subjects but may not belong to more than
one department.
Draw an ER diagram to capture the requirements as stated above.

Exercise 6
Draw an ER diagram to capture the requirements as stated below:
• Each company branch operates maximum four departments, and each department
belongs to one company branch.
• Each department has one or more employees, and each employee works for one
department.
• Each of the employees may or may not have one or more dependents, and each
dependent belongs to one employee.
• Each employee may or may not have an employment history.

Provide any assumptions necessary to support your model.

3
Exercise 7

Given the following brief summary of business rules for the ROBCOR catering service,
and using the Crow’s Foot E-R methodology, draw the fully-labeled ERD. Make sure to
include all appropriate entities, relationships, connectivities, and cardinalities.

Each dinner is based on a single entree, but each entree can be served at many dinners.
A guest can attend many dinners, and each dinner can be attended by many guests.
Each dinner invitation can be mailed to many guests, and each guest can receive many
invitations.

Exercise 8
Automata, Inc. produces specialty vehicles by contract. The company operates several
departments, each of which builds a particular vehicle such as limousine, a truck, a van
or an RV.

 Before a new vehicle is built, the department places an order with the purchasing
department to request specific components. Automata’s purchasing department is
interested in creating a database to keep track of orders and to accelerate the process
of delivering materials.

 The order received by the purchasing department may contain several different items.
An inventory is maintained so the most frequently requested items are delivered
almost immediately. When an order comes in, it is checked to determine whether the
requested item is in inventory. If an item is not in inventory, it must be ordered from a
supplier. Each item may have several suppliers.

Given this functional description of the processes encountered at Automata's Purchasing


Department, draw the Crow’s Foot ERDs to represent the Automata's Purchasing
Department Database.

4
Exercise 9
An art museum owns a large volume of works of art. Each work of art is described by an

item code (identifier), title, type and size; size is further composed of height, width and

weight. A work of art is developed by an artist, but the artist for some works is unknown.

An artist is described by an artist ID (identifier), name, date of birth and date of death

(which is null for still living artists). Only data about artists for works currently owned by

the museum are kept in the database. At any point in time, a work of art is either on

display at the museum, held in storage, away from the museum as part of a traveling

show, or on loan to another gallery. If on display at the museum, a work of art is also

described by its location within the museum. A traveling show is described by a show ID

(identifier), the city in which the show is currently appearing and the start and end dates

of the show. Many of the museum works may be part of a given show and only active

shows with at least one museum work of art need be represented in the database. Finally,

another gallery is described by a gallery ID (identifier), name and city. The museum wants

to retain a complete history of loaning a work of art to other galleries and each time a

work is loaned, the museum wants to know the date the work of art was loaned and the

date it was returned. As you develop the Entity Relationship Diagram (ERD) for this

problem, follow good data naming guidelines.

NOTE: You do NOT have to build the database. No data is required. You need to provide

an ERD and data dictionary that define the database.

5
Exercise 10

Room Usage Report (Year 2015)

Room Type of Room Customer Customer Usage Dates


Number Name Identification
Start Date End Date
Number

R01 Meeting Room 1 Yahaya 881213-01-4878 15-Jan-2015 15-Jan-2015

R01 Meeting Room 1 Amir 800917-04-9872 30-May-2015 31-May-2015

R02 Meeting Room 2 Syahida 900619-03-1234 15-Jan-2015 15-Jan-2015

R03 Seminar Hall Mohd Fadzil 781231-05-4774 01-Jan-2015 04-Jan-2015

R04 Conference Hall Syahida 900619-03-1234 01-Jan-2015 04-Jan-2015

R04 Conference Hall Safiza 850202-04-3256 26-Feb-2015 26-Feb-2015

R05 Discussion Room 1 Razak 910808-07-6336 30-May-2015 31-May-2015

R06 Discussion Room 2

R07 Discussion Room 3 Nor Mas Aina 920909-05-2562 30-May-2015 31-May-2015

Question 1: Illustrate the entities and their relationship in an Entity Relationship Diagram (ERD).
Question 2: Draw a complete data dictionary.

6
Exercise 11

After completing a course in database management, you have been hired as an intern by
Mountain View Community Hospital. Your first assignment is to develop a complete E-R
diagram (ERD) and other related documents for the hospital. You conduct interviews with
a number of hospital administrators and staff to identify the key entities for the hospital.
After a short time, your team has identified the following entities:

 Care Center – a treatment center within the hospital. Examples of care centers are
maternity, emergency care or multiple sclerosis center. Each care center has a care
center ID (identifier) and a care center name.
 Patient – a person who is either admitted to the hospital or is registered as an
outpatient. Each patient has an identifier, the Medical Record Number (MRN) and a
name.
 Bed – a hospital bed that may be assigned to a patient who is admitted to the hospital.
Each bed has a bed number (identifier), a room number and a care center ID.
 Employee – any person employed as part of the hospital staff. Each employee has an
employee number (identifier), name and position.
 Diagnosis – a patient’s medical condition diagnosed by a physician. Each diagnosis
has a diagnosis ID/Code and diagnosis name. Mountain View Community Hospital is
using the standard diagnosis ID/codes for patient conditions (e.g. 50 STPH FOOD
POISONING, 173 BASAL CELL CARCINOMA, 200 MALIGNANT MELANOMA or 776
CONGENITAL ANEMIA).

The team next recorded the following information concerning relationships:

 Each hospital employee is assigned to work in one or more care centers. Each care
center has at least one employee and may have any number of employees. The
hospital records the number of hours per week that a given employee works in a
particular care center.
 Each care center has exactly one employee who is designated nurse-in-charge for that
care center.
 A given patient may or may not be assigned to a bed (since some patients are
outpatients). A bed may or may not be assigned to a patient.

7
 A patient may be diagnosed by one or more physicians. A physician may diagnose any
number of patients or may not diagnose any patients.
 Prior to a patient being seen by a physician, a nurse typically obtains and records
relevant data about the patient. This includes the patient’s weight, blood pressure,
pulse and temperature. The nurse who assesses the vital signs also records the date
and time. Finally the reasons for the visit and any symptoms the patient describes are
recorded.
 Physicians diagnose any number of conditions affecting a patient and a diagnosis may
apply to many patients. The hospital records the following data: time of diagnosis,
diagnosis code and diagnosis description/status.

NOTE: You do NOT have to build the database. No data is required. You need to
provide an ERD and data dictionary that define the database.

Exercise 12

Temporary Employment Corporation (TEC) places temporary workers in companies


during peak periods. TEC’s manager gives you the following description of the business:

 TEC has a file of candidates who are willing to work. The file contains candidate id,
full name, address, email (if any) and telephone number.
 Each candidate has earned several qualifications. Each qualification may be earned
by more than one candidate. For example, it is possible for more than one candidate
to have earned a BBA degree or an Oracle Database Certification. And clearly, a
candidate may have earned both a BBA and an Oracle Database Certification. Each
qualification has a qualification code and name using special codes (eg: BBA: BBA
degree, DBA-ORA: Oracle Database Certification).
 TEC has a list of companies that request temporaries. The attributes are company id,
name, address, email address and telephone number.
 Each time a company requests a temporary employee, TEC makes an entry into the
job openings folder. This folder contains a job opening number, company id,
qualification code, starting date, anticipated ending date, hourly pay and number of
candidate needed.
 Each job opening requires only one specific or main qualification.

8
 When a candidate matches the qualification, (s)he is given the job and an entry is
made in the job placement record folder. The folder contains an opening number,
candidate id, total hours worked, and so on.
 A job opening can be filled by many candidates and a candidate can fill many job
openings.

NOTE: You do NOT have to build the database. No data is required. You need to
provide an ERD and data dictionary that define the database.

Exercise 13

The video cd rental company has several branches throughout the country. The data held
on each branch is the branch address made up of street, city, state, and zip code, and
the telephone number. Each branch is given a branch number, which is unique throughout
the company. Each branch is allocated staff. The data held on a member of staff is his or
her name, position, and salary. Each member of staff is given a staff number, which is
unique throughout the company. Each branch has at least one stock of videos. The data
held on a video is the video number, title, category, daily rental, cost, status, and the
names of the main actors, and the director. The video number uniquely identifies each
video. However, in most cases, there are several copies of each video at a branch, and
the individual copies are identified using the copy number. A video is given a category
such as Action, Adult, Children, Drama, Horror, or Sci-Fi. The status indicates whether a
specific copy of a video is available for rent. Before hiring a video from the company, a
customer must first register as a member of a local branch. The data held on a member
is the first and last name, address, and the date that the member registered at a branch.
Each member is given a member number, which is unique throughout all branches of the
company. Once registered, a member is free to rent videos, up to maximum of ten at any
one time. The data held on each video rented is the rental number, the full name and
number of the member, the video number, title, and daily rental, and the dates the video
is rented out and date returned. Each rental agreement is managed by one and only one
staff. A staff may manage one, zero or many rental agreements. The rental number is
unique throughout the company.

NOTE: You do NOT have to build the database. No data is required. You need to
provide an ERD and data dictionary that define the database.

9
Exercise 14

AVANTIVE Corporation is a company specializing in the commercialization of automotive


parts. AVANTIVE has many customers. All customers have a customer ID, a name, an
address, an e-mail address and a phone number. Customers also have the credit card
type, credit card number and expiration date.

AVANTIVE Corporation has five departments: administration, marketing, sales, shipping


and purchasing. Each department employs one or many employees. Each employee has
an ID, a name, a home address, a home phone number, a salary and tax ID (Social
Security number). Some employees are classified as sales representatives, some as
technical support and some as administrators.

AVANTIVE keeps a list of cars models with information about the manufacturer, model
and year. AVANTIVE keeps several parts in stock. A part will have a part ID, description,
unit price and quantity on hand. A part can be used for many car models and a car model
has many parts.

A customer can place many orders. Each order will have an order number, a date, a
shipping address, a billing address and a list of part codes, quantities and prices. Each
order also has an employee ID to identify the person who made the sale, a shipping cost,
a shipping date, an order tax total, an order total cost, an order total paid and an order
status (open, closed or cancel).

10
Exercise 15

The Journal of E-commerce Research Knowledge is a prestigious information systems


research journal. It uses a peer-review process to select manuscripts for publication. Only
about 10 percent of the manuscripts submitted to the journal are accepted for publication.
A new issue of the journal is published each quarter. Create a complete ERD to support
the business needs described below:

 Unsolicited manuscripts are submitted by authors. When a manuscript is received,


the editor assigns it a number and records some basic information about it in the
system, including the title of the manuscript, the date it was received, and a
manuscript status of "received." Information about the author(s) is also recorded,
including each author's name, mailing address, e-mail address, and affiliation (the
author's school or company). Every manuscript must have an author. Only authors
who have submitted manuscripts are kept in the system. It is typical for a manuscript
to have several authors. A single author may have submitted many different
manuscripts to the journal. Additionally, when a manuscript has multiple authors, it is
important to record the order in which the authors are listed in the manuscript credits.
 At her earliest convenience, the editor will briefly review the topic of the manuscript
to ensure that its contents fall within the scope of the journal. The details about editor
are editor no and name. If the content is not appropriate for the journal, the
manuscript's status is changed to "rejected" and the author is notified via e-mail. If
the content is within the scope of the journal, then the editor selects three or more
reviewers to review the manuscript. Reviewers work for other companies or
universities and read manuscripts to ensure their scientific validity. For each reviewer,
the system records a reviewer number, name, e-mail address, affiliation, and areas
of interest. Areas of interest are predefined areas of expertise that the reviewer has
specified. An area of interest is identified by an IS code and includes a description
(for example, IS2003 is the code for "data base modeling"). A reviewer can have
many areas of interest, and an area of interest can be associated with many
reviewers. All reviewers must specify at least one area of interest. It is unusual, but
possible, to have an area of interest for which the journal has no reviewers. The editor
will change the status of the manuscript to "under review" and record which reviewers
received the manuscript and the date it was sent to each reviewer. A reviewer will

11
typically receive several manuscripts to review each year, although new reviewers
may not have received any manuscripts yet.
 The reviewers will read the manuscript at their earliest convenience and provide
feedback to the editor. The feedback from each reviewer includes rating the
manuscript on a 10-point scale for appropriateness, clarity, methodology, and
contribution to the field, as well as a recommendation for publication (accept or
reject). The editor will record all of this information in the system for each review
received, along with the date the feedback was received. Once all of the reviewers
have provided their evaluations, the editor will decide whether to publish the
manuscript and change its status to "accepted" or "rejected.'' If the manuscript will be
published, the date of acceptance is recorded.
 Once a manuscript has been accepted for publication, it must be scheduled. For each
issue of the journal, the publication period (fall, winter, spring, or summer), publication
year and number are recorded. An issue will contain many manuscripts, although the
issue may be created in the system before it is known which manuscripts will be
published in that issue. An accepted manuscript appears in only one issue of the
journal. Once the manuscript has been scheduled for an issue, the status of the
manuscript is changed to "scheduled." Once an issue is published, the print date for
the issue is recorded, and the status of each manuscript in that issue is changed to
"published."

NOTE: You do NOT have to build the database. No data is required. You need to
provide an ERD and data dictionary that define the database.

12

Das könnte Ihnen auch gefallen