Assignment 1 - ER Model
Assignment 1 - ER Model
Q.1 Computer Sciences Department frequent fliers have been complaining toDane
County Airport officials about the poor organization at the airport. As a result,the
officials decided that all information related to the airport should be
organizedusing a DBMS, and you have been hired to design the database. Your
first task isto organize the information about all the airplanes stationed and
maintained at theairport. The relevant information is as follows:
1. Every airplane has a registration number, and each airplane is of a specific
model.
2. The airport accommodates a number of airplane models, and each model is
identifiedby a model number (e.g., DC-10) and has a capacity and a weight.
3. A number of technicians work at the airport. You need to store the name,
AADHAR NO.,address, phone number, and salary of each technician.
4. Each technician is an expert on one or more plane model(s), and his or her
expertisemay overlap with that of other technicians. This information about
techniciansmust also be recorded.
5. Traffic controllers must have an annual medical examination. For each
trafficcontroller, you must store the date of the most recent exam.
6. All airport employees (including technicians) belong to a union. You must
storethe union membership number of each employee. You can assume that
eachemployee is uniquely identified by a social security number.
7. The airport has a number of tests that are used periodically to ensure that
airplanesare still airworthy. Each test has a Federal Aviation Administration
(FAA)test number, a name, and a maximum possible score.
8. The FAA requires the airport to keep track of each time a given airplane is
testedby a given technician using a given test. For each testing event, the
informationneeded is the date, the number of hours the technician spent
doing the test, andthe score the airplane received on the test.
Draw an ER diagram for the airport database. Be sure to indicate the various
attributes of each entity and relationship set; also specify the key and participation
constraints for each relationship set. Specify any necessary overlap and covering
constraints as well (in English).
Design and draw an ER diagram that captures the information about the university.
Use only the basic ER model here; that is, entities, relationships, and attributes.
Besure to indicate any key and participation constraints.
Q.6) The Prescriptions-R-X chain of pharmacies has offered to give you afree
lifetime supply of medicine if you design its database. Given the rising cost
ofhealth care, you agree. Here’s the information that you gather:
Patients are identified by an AADHAR NO., and their names, addresses, and
ages must berecorded.
Doctors are identified by an AADHAR NO. For each doctor, the name,
specialty, and yearsof experience must be recorded.
Each pharmaceutical company is identified by name and has a phone
number.
For each drug, the trade name and formula must be recorded. Each drug
issold by a given pharmaceutical company, and the trade name identifies a
druguniquely from among the products of that company. If a pharmaceutical
companyis deleted, you need not keep track of its products any longer.
Each pharmacy has a name, address, and phone number.
Every patient has a primary physician. Every doctor has at least one patient.
Each pharmacy sells several drugs and has a price for each. A drug could be
soldat several pharmacies, and the price could vary from one pharmacy to
another.
Doctors prescribe drugs for patients. A doctor could prescribe one or more
drugsfor several patients, and a patient could obtain prescriptions from
several doctors.Each prescription has a date and a quantity associated with it.
You can assumethat, if a doctor prescribes the same drug for the same
patient more than once,only the last such prescription needs to be stored.
Pharmaceutical companies have long-term contracts with pharmacies. A
pharmaceuticalcompany can contract with several pharmacies, and a
pharmacy cancontract with several pharmaceutical companies. For each
contract, you have tostore a start date, an end date, and the text of the
contract.Pharmacies appoint a supervisor for each contract. There must
always be a supervisorfor each contract, but the contract supervisor can
change over the lifetimeof the contract.
Draw an ER diagram that captures the preceding information. Identify any
constraintsnot captured by the ER diagram.
How would your design change if each drug must be sold at a fixed price by
allpharmacies?
Q.7) Although you always wanted to be an artist, you ended up being an expert on
databases because you love to cook. You set up a database company, ArtBase, that
builds a product for art galleries. The core of this product is a database with a
schema that captures all the information that galleries need to maintain. Galleries
keep information about artists, their names (which are unique), birthplaces, age,
and style of art. For each piece of artwork, the artist, the year it was made, its
unique title, its type of art (e.g., painting, lithograph, sculpture, photograph), and
its price must be stored. Pieces of artwork are also classified into groups of various
kinds, for example, portraits, still lifes, works by Picasso, or works of the 19th
century; a given piece may belong to more than one group. Each group is identified
by a name (like those just given) that describes the group. Finally, galleries keep
information about customers. For each customer, galleries keep that person’s
unique name, address, total amount spent in the gallery (very important!), and the
artists and groups of art that the customer tends to like.
Draw the ER diagram for the database.