Sunteți pe pagina 1din 4

CSE3003 DBMS Weekly Assignment #2

B. Tech. (Computer Science & Engineering)

ASSIGNMENT #2
Q1. Consider the following information about a university database:
 Professors have an SSN, a name, an age, a rank, and a research specialty.
 Projects have a project number, a sponsor name (e.g., NSF), a starting date, an
ending date, and a budget.
 Graduate students have an SSN, a name, an age, and a degree program (e.g.,
M.S. or Ph.D.).
 Each project is managed by one professor (known as the project’s principal
investigator).
 Each project is worked on by one or more professors (known as the project’s
co-investigators).
 Professors can manage and/or work on multiple projects.
 Each project is worked on by one or more graduate students (known as the
project’s research assistants).
 When graduate students work on a project, a professor must supervise their
work on the project. Graduate students can work on multiple projects, in which
case they will have a (potentially different) supervisor for each one.
 Departments have a department number, a department name, and a main office.
 Departments have a professor (known as the chairman) who runs the
department.
 Professors work in one or more departments, and for each department that they
work in, a time percentage is associated with their job.
 Graduate students have one major department in which they are working on
their degree.
 Each graduate student has another, more senior graduate student (known as a
student advisor) who advises him or her on what courses to take.

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. Be sure to indicate any key and participation constraints.

Q2. You need to implement a database system application for a movie ratings-cum-
social-network system VTFlix (like Flixster.com) where users can explore
information about movies, rate movies, and see ratings of their friends.
You will work with video information, user information, ratings of videos, and users’
social network.
 Each video has an id, title, release date, producer, color (e.g., black-n-white, or
Eastman color), and which country it comes from.
 There are 3 categories of videos: movies, TV episodes and collections.
 Different TV episodes are different videos. A TV episode belongs to a
collection and has an episode number.
 Each collection can contain one or more seasons. For each collection, we want
to additionally record these season numbers. E.g. we want to model that a collection
titled ‘Seinfeld: The Early Episodes’ contains seasons ‘1’ and ‘2’.
DEPARTMENT OF COMPUTER ENGINEERING & APPLICATIONS, Institute of Engineering & Technology
1
CSE3003 DBMS Weekly Assignment #2
B. Tech. (Computer Science & Engineering)

 Movies don’t have different parts e.g. ‘Harry Potter I’ and ‘Harry Potter II’ are
different movies.
 One or more directors direct each movie or a TV episode. And each director is
identified by an id and has name and age.
 Each video could belong to one or more genre (e.g., action, comedy, romantic,
horror, thriller, and historical).
 VTFlix needs to keep the track of user ratings for each video (e.g., 1-5 and 1
for ‘I hate it!’, to 5, for ‘I love it!’). A particular user rates a particular video at a
particular time. One user can rate the same video multiple times.
 You also need to record the information of performers in the videos. They are
identified by id, name, age, and whether they are actors or actresses.
 Each video gets a MPAA certification [Motion Picture Association of
America]. Each certification has a unique name and content rating. E.g. “PG-13”
rating means that some content may be inappropriate for children under the age of 13.
Here the name of the certification would be ‘PG-13’ and content rating would be
‘Inappropriate for children under the age of 13’.
 Each user is identified by id and has name, gender, age, and location.
 There is also the social network between users. Users can send ‘friend-
requests’ to other users. Such requests can be accepted or ignored. Once accepted, the
two users are considered ‘friends’. If ignore, the user can send the request again. We
want to additionally store when the requests were sent (timestamp), the result of the
requests and when the request was answered (timestamp).

Draw an ER diagram for this database. Make sure to indicate primary keys,
cardinality constraints, weak entities (if any), and participation constraints.
There might be extra constraints which cannot be captured by the E/R diagram,
make sure you mention them below the diagram. List any assumptions you
make in the process. Hint: The E/R diagram should contain at least ~6 (may be
more) entities.

DEPARTMENT OF COMPUTER ENGINEERING & APPLICATIONS, Institute of Engineering & Technology


2
CSE3003 DBMS Weekly Assignment #2
B. Tech. (Computer Science & Engineering)

UPS prides itself on having up-to-date information on the processing and current
location of each shipped item. To do this, UPS relies on a company-wide information
system. Shipped items are the heart of the UPS product tracking information system.
Shipped items can be characterized by item number (unique), weight, dimensions,
insurance amount, destination, and final delivery date. Shipped items are received into
the UPS system at a single retail center. Retail centers are characterized by their type,
uniqueID, and address. Shipped items make their way to their destination via one or
more standard UPS transportation events (i.e., flights, truck deliveries). These
transportation events are characterized by a unique scheduleNumber, a type (e.g,
flight, truck), and a deliveryRoute.

Q3. Please create an Entity Relationship diagram that captures this information about the
UPS system. Be certain to indicate identifiers and cardinality constraints.

Q4. Convert the following ER Diagram to Relational Model


(Hint: First solve for entities, then weak entities and lastly of relationships)

Q5. Notown Records has decided to store information about musicians who perform
on its albums (as well as other company data) in a database. The company has wisely
chosen to hire you as a database designer (at your usual consulting fee of $2500/day).

DEPARTMENT OF COMPUTER ENGINEERING & APPLICATIONS, Institute of Engineering & Technology


3
CSE3003 DBMS Weekly Assignment #2
B. Tech. (Computer Science & Engineering)

 Each musician that records at Notown has an SSN, a name, an address, and a
phone number. Poorly paid musicians often share the same address, and no
address has more than one phone.
 Each instrument used in songs recorded at Notown has a unique identification
number, a name (e.g., guitar, synthesizer, flute) and a musical key (e.g., C, B-
flat, E-flat).
 Each album recorded on the Notown label has a unique identification number,
a title, a copyright date, a format (e.g., CD or MC), and an album identifier.
 Each song recorded at Notown has a title and an author.
 Each musician may play several instruments, and a given instrument may be
played by several musicians.
 Each album has a number of songs on it, but no song may appear on more than
one album.
 Each song is performed by one or more musicians, and a musician may
perform a number of songs.
 Each album has exactly one musician who acts as its producer. A musician
may produce several albums, of course.
Design a conceptual schema for Notown and draw an ER diagram for your schema. The preceding
information describes the situation that the Notown database must model. Be sure to indicate all
key and cardinality constraints and any assumptions you make. Identify any constraints you are
unable to capture in the ER diagram and briefly explain why you could not express them.

Q6. Design an EER for RECIPE this entity can have recipes of different cuisines
such as CHINESE, ITALIAN, SOUTH INDIAN, CONTINENTAL, THAI,
MUGLAI, FAST FOOD. If any recipe not fall in any of above category then
include it in CONTINENTAL but no recipe can fall in more than one category.

Q7. Consider two tables: Album and Song, that are related by a “1-to-Many” relationship.
Given this type of relationship, in which table should the corresponding foreign key
be placed?
Q8. Which type of entity cannot exist in the database unless another type of entity also
exists in the database, but does not require that the identifier of that other entity be
included as part of its own identifier?
Q9. Consider Relation Cars( LicensePlate#, SeaterSize, EngineChase# , Category,
Company)
Enlist the Candidate Keys in above relation: (take suitable assumptions)
Q10. Explain the following terms briefly: attribute, domain, entity, relationship, entity set,
relationship set, one-to-many relationship, many-to-many relationship, participation
constraint, overlap constraint, covering constraint, weak entity set, aggregation, and
role indicator.

DEPARTMENT OF COMPUTER ENGINEERING & APPLICATIONS, Institute of Engineering & Technology


4

S-ar putea să vă placă și