Documente Academic
Documente Profesional
Documente Cultură
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) 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.
Draw the Crow’s Foot ERDs to represent the Book Publication Database.
Exercise 3
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:
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.
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.
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
NOTE: You do NOT have to build the database. No data is required. You need to provide
5
Exercise 10
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).
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
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 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
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