Homework 2: ER Design

advertisement
Yezreel Valley College
Computer Science and Information Systems Department
CSIS 63802: Database System Design Concepts
Spring 2005 Semester
Homework No. 2: ER Design
Problem 1:
You are required to design a database system for a car insurance company. The company tracks customers
who drive their cars and from time to time are involved in accidents. Customers have name, date of birth,
address, driver’s license number and type, etc. Cars have license plate number, manufacturer name, model,
year, current market value, etc. The insurance company employees are allowed to insure their cars through
the company they work for. Car insurance policies have expiration dates, are either comprehensive of 3 rd
party, and they cover the car, not the driver. (Drivers are covered through a mandatory insurance policy
which is payable only if there is bodily harm.)
When a car and a driver are involved in an accident, a report is generated which records the accident date
and location, information on the drivers and the vehicles involved, evidence of bodily damage if any to
drivers and monetary damage amount (repair estimate) for each car. If the repair estimate is higher than the
current market value of the vehicle, it is declared “total loss.”
Make reasonable assumptions regarding the business practices of the above insurance company, and then
construct and draw an ER diagram for its future database. Fully document your assumptions and explain
how they affect your proposed design. For each entity, discuss why you chose it and what is its type
(strong, weak, ISA), as well as provide a list of attributes with data types, determine candidate keys and
recommend a primary key. For each relationship, discuss its cardinality (1 to 1, 1 to many, etc.), degree
(binary, n-ary), existence of attributes, etc. Finally, propose a mapping into relations (tables) and justify
your choices.
Problem 2:
Assume the ER schema of the banking enterprise we had discussed in class (please see below). Consider
the possibility that two different banks, which have exactly the same ER schema, but operate in different
but possibly overlapping parts of the country, obviously have different names, etc. – decide to merge. If the
merged bank is to have a single database, there are several problems to consider:
(a) some of the branches may have identical names;
(b) some customers may have had accounts in both original banks; and
(c) account- and loan-numbering systems may have used the same numbers for different loans and
different accounts.
A. Assuming that both banks operate in the same country and in the same currency, discuss why the above
cases are problematic and for each case propose a solution that will be easy and inexpensive to implement.
Be specific and thorough: look carefully at each entity and relationship together with their attributes, and
consider everything that may go wrong.
B. Does the merged bank require a new or a modified ER schema? Explain.
(contd.)
1
Yezreel Valley College
Computer Science and Information Systems Department
C. Now, assume that the two merging banks are located in two different countries: one in the U.S. and the
other – in Canada, i.e. the merged bank is a multinational entity, which allows its customers to have
accounts in both US and Canadian dollars. Reconsider your answers to A. and B. Are they affected by the
new conditions, and if so, how? Again, discuss the problems and for each case propose a solution that will
be easy and inexpensive to implement. (Assume that the U.S. residents don’t have national ID’s whereas
the Canadians do.)
2
Download