YOUR NAME:

CS 582 — Database Management System II — Spring 2007

Quiz 4

Let us consider the catalog of movies of a Netflix subsided store. It is a table with the following attributes:

 Movie(\underline{title, number}  , type, main charater, length, director, status, location)

where title is the title of the movie. As the shop might have several copies of the same movie, it assigned a number to each copy. For this reason, the primary key of the table consists of two attributes title and number. Furthermore, type can be action, romance, si-fi, etc.; main character is the name of the actor/actress plays the leading role in the movie; length tells how long the movie is; director names the director of the movie; status is either available or unavailable, indicating if the copy is available or not. location stores the location on the shelf of the movie.

(a) Identify an index that you would use in answering the following questions in the fastest possible way (explaining your answer with ONE SHORT sentence):

• Is there a movie from director named X?

Answer:

• Where can I get the movie XYZ (i.e., the movie with XYZ as its title)?

Answer:

• Can I get the list of movies which are shorter than 60 minutes and have ZX as the main character?

Answer:

(b) Is there one single index that you can use to answer all three questions without having to scan the whole table? Please give an one sentence explanation.