Uploaded by CS of Pakistan

Assignment 4

advertisement
Introduction to Database
Section C and D
Assignment 4
Due Date: Wednesday 30/12/2020 before 11:50PM. Should be submitted on PORTAL
Problem # 1: Consider the following set of requirements for a UNIVERSITY database that is used to keep
track of students' transcripts.
a. The university keeps track of each student's name, student number, social security
number, current address and phone, permanent address and phone, birth date, sex, class
(freshman, sophomore, ..., graduate), major department, minor department (if any), and
degree program (B.A., B.S., ..., Ph.D.). Some user applications need to refer to the city,
state, and zip of the student's permanent address, and to the student's last name. Both
social security number and student number have unique values for each student.
b. Each department is described by a name, department code, office number, office phone,
and college. Both name and code have unique values for each department.
c. Each course has a course name, description, course number, number of semester hours,
level, and offering department. The value of course number is unique for each course.
d. Each section has an instructor, semester, year, course, and section number. The section
number distinguishes different sections of the same course that are taught during the
same semester/year; its values are 1, 2, 3, ..., up to the number of sections taught during
each semester.
e. A grade report has a student, section, letter grade, and numeric grade (0, 1, 2, 3, 4 for F,
D, C, B, A, respectively).
Design an ER schema for this application, and draw an ER diagram for that schema. Specify
key attributes of each entity type and structural constraints on each relationship type. Note
any unspecified requirements, and make appropriate assumptions to make the specification
complete.
Problem #2: Construct the E-R diagram for the Movie database. Document any assumptions
that you make, but do not change the given requirements. Make sure that your model properly
depicts entities, attributes and relationships and weak entities (if any).

Each movie is identified by title and year of release. Each movie has a length in minutes.
Each has a production company and each is classified under one or more genres (such as
horror, action, drama, and so forth). Each movie has one or more directors and one or



more actors appear in it. Each movie also has a plot outline. Finally, each movie has zero
or more quotable quotes, each of which is spoken by a particular actor appearing in the
movie.
Actors are identified by name and date of birth and appear in one or more movies, each
actor has a role in the movie.
Directors are also identified by name and date of birth and direct one or more movies. It
is possible for a director to act in a movie (including one that he or she may also direct).
Production companies are identified by name and each has an address. A production
company produces one or more movies.
Note: It is very important that you stay within the bounds of the problem as stated above. Take
the description above referring to actors as an example, it does not mention or imply anything
about if an actor is associated with any production company. Therefore, don’t even attempt to
create a model that connects them.
It is also very important that you do not add attributes if they are not necessary or required by
the problem. Take the description above referring to actors as an example, it does not mention
or imply anything about actor sex (i.e. female or male). Therefore, don’t even attempt to create
a model that includes sex as an attribute, it would be superfluous.
These are just examples of how you can find yourself out of bounds. Developing a general, all
inclusive model to solve the problem is as important as creating a well-bounded model to solve
the problem.
Problem # 3: Draw an ER diagram to model the application with the following assumptions.
Specify key attributes of each entity type and (min, max) constraints on each relationship type.






Each home uniquely defined by home identifier, street address, city, state, a number of
bedrooms and a number of bathrooms and an associated owner.
Each owner has a Social Security Number, first name, last name, phone, and profession.
An owner can have one or more homes.
Agents represent owners in the sale of a home. An agent can list many homes, but only
one agent can list a home.
An agent has a unique agent number, name, phone number and an associated office.
When an owner agrees to list a home with an agent, a commission and a selling price
are determined.
Problem # 4: Consider a mail order database in which employees take orders for parts from
customers. The data requirements are summarized as follows:
 The mail order company has employees identified by a unique employee number, their
first and last names, and a zip code where they are located.



The customers of the company are identified by a unique customer number, their first
and last names, and a zip code where they are located.
The parts being sold by the company are identified by a unique part number, a part
name, their price, and quantity in stock.
Orders placed by customers are taken by employees and are given a unique order number. Each
order may contain certain quantities of one or more parts. Each order has a received date as
well as an expected ship date. The actual ship date is also recorded.
Design an Entity-Relationship diagram for the mail order database.
Download