We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 2
CS43002: Database Management Systems
Mid-semester Examination, Spring 2017
= 2 hrs.Total Marks: 100. Answer all questions.
Please answer all parts of a question together.
1,Use an Entity-Relationship Diagram to depict the following. State any additional assumptions you make.
A recording studio needs help designing its database of musicians, albums, and any other entities that are
relevant to its operation. Each musician who records ai the studio has an identification number and a name,
and no two musicians have the same identification number. Musicians form bands. A band is described by a
unique name and has at least two musicians as members. Bands record albums, which have a title, a genre,
and a year of production. Each album is recorded by at least one band, and no two albums have the same
combination of title and production year. Some musicians produce albums. Each album-is produced by at
least one musician. (Don't worry about whether that mesician is a member of the recording band.) Albums are
made up of songs. Each song is assigned a title and a sequence number. Each song belongs to exactly one
album, and all songs on the same album have different sequence numbers. [10]
2.Given the following relations from a literary database.
Authors(author id, first_name, last_name, country, birth year)
Books (title, author _id, publication_year)
Nobel Winners (author _id, award_year)
(a) Write relational algebra expressions that computes the following queries. [2#3+3+4 =12]
(i) List titles of books by authors from Argentina or Peru.
(ii) List titles of books by Nobel Prize winners that were published after 1940.
(ii) List last names and birth years of authors who published books between 1901 and 1950, but not in the
period 1951 or thereafter.
(iv) List last names of pairs of authors from the same country, such that one of them won the Nobel Prize and
the other did not.
(b) Write SQL queries to compute the following expression. [2+3+3+4=12 ]
(i) List last names of Nobel Prize winners from Japan.
(ii) List pairs of author_id from the same country such that one of them received the Nobel Prize and the other
did not.
(iil) List pairs of authors_id both of whom were born after 1920. Only list each pair once.
(iv) List author_id of pairs of Nobel Prize winners such that one of the authors is both younger than the other,
and received the Nobel Prize in an earlier year.
3.(a). Express the relational algebra queries in questions2.a.(i-iv)as statements in Tuple Relational Calculus.
3.(b). Express the relational algebra queries in questions 2.a.(-iv)as Datalog statements. [4x3 + 4x3 = 12]Consider a relation with the schema R(A, B, C, D) and functional dependencies (FD's) AB -» C, C > D,
and D —» A. What are all non-trivial dependencies that follow from the given FD's? Restrict yourself to FD's
with only single attributes on the right i:and side, What are all the candidate keys of R? [8+4= 12]
4,(b)... Consider the relation schema R/A, 8, C, D, E) with set of FD's: AB C, DEC, BD.
() Indicate all BCNF violations of R. D.- not forget to censider FD's that are not in the given set but follow from
them. However, it is not necessary to ¢ve violations that have more than one attribute on the right side.
(ii) Decompose the relation into collect:an of relations that are in BNF.
(ii) Indicate all 3N= violations.
(iv) Decompose ths relation into colleccions of relations that are in 3NF. [6+6+6+6 = 12]
4.(c). Assume the ,ollowing relation R(.4,8,C,D) is giver. and the following multivalued dependencies hold:
A» B and A -»C.f ssume that the relation R contain the following two tuples:
R(A BCD): i
(ta a)
(1.5 6 7)}
What other tuples R must contain so that the above tw multivalued dependencies hold for R? [6]