ERD Assignment

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 7

WOLLEGA UNIVERSITY

INSTITUTE OF TECHNOLOGY
DEPARTMENT OF ELECTRICAL AND COMPUTER
ENGINEERING
(4rd YEAR – Computer Stream)
COURSE: Database Management Systems (ECEg4172)

 Question 1:
Alice has a large DVD movie collection. Her friends like to borrow her
DVD's, and she needs a way to keep track of who has what. She maintains
a list of friends, identified by unique FID's (friend identifiers) and a list of
DVD's, identified by DVDID's (DVD identifiers). With each friend is the
name and the all-important telephone numbers which she can call to get
the DVD back. With each DVD is the star actor name and title. Whenever
a friend borrows a DVD, Alice will enter that fact into her database along
with the date borrowed. Whenever the DVD gets returned, that fact, too,
gets noted along with the date returned. Alice wants to keep a complete
history of her friends' borrowing habits so that she can ask favors of the
heavy borrowers (or perhaps refuse to make further loans to those who
habitually don't return them quickly).

Question 2:
Assume we have the following application that models soccer teams, the
games they play, and the players in each team. In the design, we want to
capture the following:
• We have a set of teams, each team has an ID (unique identifier), name,
main stadium, and to which city this team belongs.
• Each team has many players, and each player belongs to one team. Each
player has a number (unique identifier), name, DoB, start year, and shirt
number that he uses.
• Teams play matches, in each match there is a host team and a guest team.
The match takes place in the stadium of the host team.
• For each match we need to keep track of the following:
o The date on which the game is played
o The final result of the match
o The players participated in the match. For each player, how many
goals he scored, whether or not he took yellow card, and whether or not
he took red card.
o During the match, one player may substitute another player. We want
to capture this substitution and the time at which it took place.
• Each match has exactly three referees. For each referee we have an ID
(unique identifier), name, DoB, years of experience. One referee is the
main referee and the other two are assistant referee.
Design an ER diagram to capture the above requirements. State any
assumptions you have that affects your design (use the back of the page if
needed). Make sure cardinalities and primary keys are clear.

Question 3:
Consider the following requirements for a university library database:
The database will support the services that the university library provides
to its customers. These can only be students and members of the university
staff. Each library customer is identified by university card. The items
available from the library include books, conference proceedings and
scientific magazines. Books and conference proceedings have one or more
authors, a title, and a unique ISBN number. Note that there might be more
than one copy of the same book or conference proceedings in the library.
Scientific magazines have a title and a unique ISSN number. Copies of
books and conference proceedings may be checked out but not scientific
magazines. These have to be used in the library. All items, which may be
checked out, are identified by unique library codes assigned to them after
their purchase. The maximum borrowing period allowed for each of them
is different. Library users may borrow more than one item at the same
time. The starting and the due date of each loan must be recorded.
Design an ER-diagram for this database. Specify keys, mapping
cardinalities, participation constraints and existential dependencies in your
diagram. If it is necessary, due to incompleteness in the previous
specification, state clearly the assumptions justifying your modeling
choices.

Question 4:
Consider the following requirements for a database that is to be developed
for a retailer:
Information is to be kept about customers, products and orders. Each
customer has a unique customer number, one or more addresses, and an
account. This account is used to provide credit facilities to the customer.
Each account has a credit limit and a balance indicating the amount of
money that the customer currently owes to the company. Customers may
qualify for discount rates subject to the total value of the products they
have purchased so far. Therefore, the company needs to keep a record of
the value of the products a customer has purchased from it. Customers
place orders. An order may include one or more products. For each of
these products the order indicates the quantity of the product ordered.
Also, each order has a unique number and two dates. One of these dates
indicates when the order was made and the other indicates when the goods
need to be delivered. Products have unique numbers and a short
description. For each of them the company maintains an indicator of the
quantity currently in stock.
Design an ER-diagram for this database. Specify keys, mapping
cardinalities, participation constraints and existential dependencies (if
necessary) in your diagram. In cases where the above requirement
specification is ambiguous, state clearly the assumptions which you made
and which justify your modeling choices.

 Question 5:
A database is to be designed for a Car Rental Co. (CRC). The information
required includes a description of cars, subcontractors (i.e. garages),
company expenditures, company revenues and customers. Cars are to be
described by such data as: make, model, year of production, engine size,
fuel type, number of passengers, registration number, purchase price,
purchase date, rent price and insurance details. It is the company policy
not to keep any car for a period exceeding one year. All major repairs and
maintenance are done by subcontractors (i.e. franchised garages), with
whom CRC has long-term agreements. Therefore the data about garages to
be kept in the database includes garage names, addressees, range of
services and the like. Some garages require payments immediately after a
repair has been made; with others CRC has made arrangements for credit
facilities. Company expenditures are to be registered for all outgoings
connected with purchases, repairs, maintenance, insurance etc. Similarly
the cash inflow coming from all sources - car hire, car sales, insurance
claims - must be kept of file.CRC maintains a reasonably stable client
base. For this privileged category of customers special credit card facilities
are provided. These customers may also book in advance a particular car.
These reservations can be made for any period of time up to one month.
Casual customers must pay a deposit for an estimated time of rental,
unless they wish to pay by credit card. All major credit cards care
accepted. Personal details (such as name, address, telephone number,
driving licence, number) about each customer are kept in the database.

 Question 6:
A publishing company produces scientific books on various subjects. The
books are written by authors who specialize in one particular subject. The
company employs editors who, not necessarily being specialists in a
particular area, each take sole responsibility for editing one or more
publications. A publication covers essentially one of the specialist subjects
and is normally written by a single author. When writing a particular book,
each author works with on editor, but may submit another work for
publication to be supervised by other editors. To improve their
competitiveness, the company tries to employ a variety of authors, more
than one author being a specialist in a particular subject.

 Question 7:

Consider the ER diagram shown above for part of a BANK database. Each
bank can have multiple branches, and each branch can have multiple
accounts and loans.
a) List the (nonweak) entity types in the ER diagram.
b) Is there a weak entity type? If so, give its name, partial key, and
identifying relationship.
c) What constraints do the partial key and the identifying relationship of
the weak entity type specify in this diagram?
d) List the names of all relationship types, and specify the (min, max)
constraint on each participation of an entity type in a relationship
type. Justify your choices.
e) List concisely the user requirements that led to this ER schema
design.
f) Suppose that every customer must have at least one account but is
restricted to at most two loans at a time, and that a bank branch
cannot have more than 1000 loans. How does this show up on the
(min, max) constraints?

Answer the Following questions.

1. Define the following terms: entity, attribute, attribute value, relationship

instance, composite attribute, multivalued attribute, derived attribute,

complex attribute, key attribute, value set (domain).

2. What is an entity type? What is an entity set? Explain the differences

among an entity, an entity type, and an entity set.

3. What is a relationship type? Explain the differences among a

relationship instance, a relationship type, and a relationship set.


4. What is a participation role? When is it necessary to use role names in

the description of relationship types?

5. When is the concept of a weak entity used in data modeling? Define the

terms owner entity type, weak entity type, identifying relationship type,

and partial key.

You might also like