You are on page 1of 5

ERD Exercises

1. Company Employees
A company has a number of employees, identified by Employee Numbers. The company wants
to keep track of the employees names, addresses and ages. The company also has several
projects. rojects are assigned a uni!ue project identifier, and also have the attributes project
name and start date. Each employee may be assigned to one or more projects, or may not be
assigned to any projects. A project must have at least one employee assigned to it, and may have
any number of employees assigned. An employees billing rate depends on the project he or she
is assigned to. The company wishes to keep track of the employees billing rates on every
project, and when the employees started to work on their projects.
2. Courses
A university has a large number of courses in its catalog. Attributes of "ourse include
"ourse#Number $identifier%, "ourse#Name, and "redits. Each course may have one or more
different courses as prere!uisites, or may have no prere!uisites. &imilarly, a particular course
maybe a prere!uisite for any number of courses.
3. Laboratory
A laboratory has several chemists who work on one or more projects. "hemists also may use
certain types of e!uipment on each project. Attributes of chemists include employee ids, names
and phone numbers. The lab also wants to keep track of project ids and start dates, and
e!uipment serial numbers and costs. The organi'ation wishes to keep track of the date a specific
piece of e!uipment was assigned to a specific chemist to work on a specific project.
4. Hospital
A hospital has a large number of registered physicians, each with a uni!ue physician number.
hysicians all have at least one specialty. atients are admitted to the hospital by physicians.
The hospital keeps track of the patients names and addresses, and assigns each patient a uni!ue
patient identifier. Any patient who is admitted must have one and only one admitting physician.
(nce admitted, a patient must be treated by at least one physician. A particular physician may
treat any number of patients, or may not treat any patients. )henever a patient is treated by a
physician, the hospital wishes to record the date and time of the treatment.
5. Attic Antiques
Attic Anti!ues buys and sells one*of*a*kind anti!ues of all kinds $e.g. furniture, china, clothing,
etc.%. Each item is uni!uely identified by a serial number, and is also characteri'ed by asking
price and condition. Attic works with several individuals who sell and buy items from the store.
&ome clients only sell items to Attic, others only buy items, and some both buy and sell. Attic
keeps track of its clients through the assigning of client numbers. They also keep track of
clients names and addresses. )hen Attic sells an item to a client, they need to keep track of the
actual selling price, the date of the sale, and the sales ta+. )hen Attic buys an item, they wish to
track the purchase cost, condition at the time of purchase, and the date.
. Robot Realty
,obot ,ealty is a real estate firm that lists property for sale. The firm has a number of sales
offices in several states. They assign each sales office an office number. Each sales office is
assigned one or more employees. An employee can only be assigned to one sales office. -or
each sales office, there is always one employee assigned to manage that office. The employee
can only manage the office to which he or she is assigned. The firm lists property for sale. They
need to track the property address, and which sales office the property is listed with $it may only
be listed with one sales office%. A sales office may have any number of properties listed. Each
unit of property has one or more owners. ,obot needs to track the percent of the property owned
by each owner.
!. "an# Accounts
). /ank has three different types of bank accounts available for their customers. Each
customer may have any number of bank accounts, and all accounts have a uni!ue account
number. -or &avings Accounts, ). /ank must keep track of the accounts balance, interest rate,
and the date the account was opened. "hecking Accounts pay no interest, so the bank keeps
track of just the balance and date opened. The third type of account, 0oans, re!uires tracking the
date the loan was taken, the balance due, and the interest rate of the loan. 0oan Accounts are
also assigned to a 0oan (fficer, who keeps track of the account and ensures that the client is
making their payments on*time.
$. Rental Car
A rental car agency classifies the vehicles it rents into four categories1 compact, mid*si'e, full*
si'e and sport utility. The agency wants to record the following data for all vehicles1 .ehicle#23,
4ake, 4odel, 5ear and "olour. There are no uni!ue attributes for any of the four categories of
vehicle. .ehicle has a relationship with a "ustomer entity type. None of the four classes of
.ehicle has a uni!ue relationship with an entity type.
%. &on'(ro)it
A non*profit organi'ation depends on a number of different types of persons for its successful
operation. The organi'ation is interested in the following attributes for all of these persons1
&ocial &ecurity Number, Name, Address, "ity, &tate and Telephone. Three types of persons are
of interest1 employees, volunteers and donors. Employees have only a 3ate#6ired attribute, and
volunteers have only a &kill attribute. 3onors have a relationship $named 3onates% with an 2tem.
A donor must have donated one or more 2tems, and an 2tem can only be donated by one donor.
There are persons other than employees, volunteers and donors who are of interest to the
organi'ation, so a person does not have to belong to one of these groups. A person may also
belong to one or more of these groups, at any one time.
1*. +ail ,r-er Company
A mail order company takes orders from "ustomers. )hen a "ustomer calls in, they gather
information regarding the "ustomer7s name, address, and credit card number. "ustomers can be
of two types 8 individuals and corporate. "orporate customers have a ta+ id number that has to
be stored by the mail order company. The "lerk taking the order writes out a roduct (rder
-orm, on which they write out the "ustomer7s credit card number $a customer can have more
than one% and list the products that the "ustomer wants to order. A copy of a sample form can be
found below1
(,3E, -(,4 N94/E,1 :;<< "9&T(4E, ",E32T "A,31 :;<*=>::*=>?@*A:;<
,(39"T ,(39"T N94/E, "(&T
&hovel ;=<;== B<C.CC
,ake ;=A=; B:=.DD
The products are kept in a back room in order by roduct Number $each individual product has a
product number 8 i.e. the product number does not refer to a class of products%. They are
eventually mailed to the "ustomer.
Desert .oo- +ail ,r-er
3esert Eoods 4ail (rder is a company that sells e+clusive desert*related memorabilia over the
2nternet. "ustomers go to 3esert Eoods7 web site and select items from an online catalogue
$much like Ama'on.com%. (nce they have selected the items that they wish to purchase, they
enter in their "ustomer information $if they are a returning customer, they can just enter in their
"ustomer Number%. The program generates an invoice that looks like that shown below. This
invoice is mailed with the products to the "ustomer, who is then e+pected to mail back a check
for the correct amount. 3esert Eoods needs to track whether or not the "ustomer has paid the bill
and the number of the check used for payment. At the end of each month, 3esert Eoods7
management generates a report showing total sales for the month $broken down by roduct%. At
the end of each year, the management needs a printout of each "ustomer7s purchases for the year.
)hen a sale is made, 3esert Eoods7 employees take the items out of inventory and send them to
the customer with the invoice $as stated above%. Each product has a bar code that is read into the
system. The program automatically updates the inventory numbers when a product is sold. )hen
a product reaches an inventory level less than five items in stock, the program automatically
contacts the supplier of that product via E32. (nly one supplier provides each product. 3esert
Eoods keeps track of each supplier7s name, address and phone number. The system stores when
$date and time% an order is placed to a supplier and what products were ordered. )hen the
products arrive at 3esert Eoods, the bar codes are scanned in and the program updates the
inventory levels.
/n0oice
/n0oice &umber1 =;>:;
Due Date1 &eptember ::, :DD<
Customer &ame1 ,ico -ata
Customer &umber1 @<:>
(ro-uct &umber (ro-uct Desc. (rice 2uantity 3otal Cost
A3AA 3esert &and /ag BAD.DD : B:D.DD
/";; 3esert "actus BA=.DD ; B<=.DD
3otal Due1 B>=.DD
Please send a check for payment!
(eace +anu)acturin4
eace 4anufacturing needs an automated database management system to organi'e their
information. "urrently, all information is kept on paper and in filing cabinets. They have hired
you to create the database. 6ere are the details1
eace 4anufacturing $4% makes computers. Each computer is made of a base pc
configuration, combined with various parts, including "9s, cases and power supplies. Each
part has a art Number $e.g. all power supplies are art Number ;<%. "omputers can be either
laptops or desktops. All computers are custom made, based on the order. An order looks like the
following1
(,3E, N94/E,1 :A
3ATE (,3E,E31 Fanuary ;, :DD<
"9&T(4E, N94/E,1 CC
"9&T(4E, 2N-(1
0eslie &mith
:D; &mith ,oad
4organtown, ). :>@D@
"(49TE, T5E1 0aptop
"(N-2E9,AT2(N1
(art &umber (art &ame Cost
;< ower &upply B==.:C
:; "9 BACD.DD
A: "ase BA:.=D
?> 4otherboard BA?@.@@
CC /ase " B<CC.DD
T(TA0 "(&T1 BC;=.>?
&A0E& ,E,E&ENTAT2.E1 &ally Fones $G ADD:%
4 wants to keep track of their customers and e+actly what they have ordered, including which
sales representative made the sale. &ales reps can be one of two types 8 Associates or -ull. -ull
&ales ,epresentatives are paid a salary, which needs to be stored in the database. Associate &ales
,eps are paid on a commission basis only. 4 needs to track the commission percentage for
each Associate &ales ,ep $it can be different for each%. Each &ales ,ep has multiple phone
numbers.
They also want to keep track of their inventory of parts, including how many of each are in the
inventory.

You might also like