AIncorrect Answer

The database is really a many-to-many relation between MOVIE and ACTOR. CASTING is an intermediate entity type which is present only to allow the many-to-many relationship to be implemented.

The SELECT is good, and the query uses all three tables. However, there is only one JOIN (there should be two), and no search for the data 1959.

close

BIncorrect Answer

The database is really a many-to-many relation between MOVIE and ACTOR. CASTING is an intermediate entity type which is present only to allow the many-to-many relationship to be implemented.

The SELECT is good, but the query uses only two tables (not three), missing out the intermediate entity type which supports the many-to-many relationship. In addition, there are no JOINs (there should be two).

close

CCorrect Answer

The database is really a many-to-many relation between MOVIE and ACTOR. CASTING is an intermediate entity type which is present only to allow the many-to-many relationship to be implemented.

The SELECT is good, and the query uses all three tables. There are two JOINs, and all the search criteria are present.

close

DIncorrect Answer

The database is really a many-to-many relation between MOVIE and ACTOR. CASTING is an intermediate entity type which is present only to allow the many-to-many relationship to be implemented.

The SELECT is good, and the query uses all three tables. However, there is a JOIN involving movie.yr == casting.yr, yet there is you yr in CASTING. The searches look right though.

close

EIncorrect Answer

The database is really a many-to-many relation between MOVIE and ACTOR. CASTING is an intermediate entity type which is present only to allow the many-to-many relationship to be implemented.

We are looking for a SELECT which uses all three tables, as we need MOVIE for the title and year, ACTOR for Marilyn Monroe, and CASTING to support the relationship between them. We need two joins; ACTOR-CASTING and CASTING-MOVIE. We also need two search conditions; one for Marilyn Monroe, and the other for the year. Look again at the other options...

close

A B C D E TELL ME NEXT INDEX
 
 

Films Database

Consider the following database:
MOVIE(id,title,yr)
ACTOR(id,name)
CASTING(movieid,actorid)

Identify the SQL command which will return the titles of all 1959 Marilyn Monroe films.
  1. The following SQL...
           SELECT title FROM movie,casting,actor
             WHERE    movieid = movie.id
             AND      name    = 'Marilyn Monroe'
           ;
         
  2. The following SQL...
           SELECT title FROM movie,actor
             WHERE    name    = 'Marilyn Monroe'
             AND      yr = 1959
           ;
         
  3. The following SQL...
           SELECT title FROM movie,casting,actor
             WHERE    movieid  = movie.id
             AND      actor.id = actorid
             AND      name     = 'Marilyn Monroe'
             AND      yr = 1959
           ;
         
  4. The following SQL...
           SELECT title FROM movie,casting,actor
             WHERE    movieid  = movie.id
             AND      actor.id = actorid
             AND      movie.yr = casting.yr
             AND      name     = 'Marilyn Monroe'
             AND      yr = 1959
           ;
         
  5. None of the above