Movie Database
This tutorial introduces the notion of a join. The database consists of three tables movie
, actor
and casting
.
movie | actor | casting |
---|---|---|
id | id | movieid |
title | name | actorid |
yr | ord | |
director | ||
budget | ||
gross | ||
1、
List the films where the
yr
is 1962 [Show
id
,
title
]
2、 Give year of 'Citizen Kane'.
3、 List all of the Star Trek movies, include the id , title and yr (all of these movies include the words Star Trek in the title). Order results by year.
4、 What are the titles of the films with id 11768, 11955, 21191
5、 What id number does the actress 'Glenn Close' have?
6、 What is the id of the film 'Casablanca'
7、
Obtain the cast list for 'Casablanca'.
what is a cast list?
The cast list is the names of the actors who were in the movie.
Use movieid=11768, this is the value that you obtained in the previous question.
8、 Obtain the cast list for the film 'Alien'
9、 List the films in which 'Harrison Ford' has appeared
10、 List the films where 'Harrison Ford' has appeared - but not in the starring role. [Note: the ord field of casting gives the position of the actor. If ord=1 then this actor is in the starring role]
11、 List the films together with the leading star for all 1962 films.
12、 Which were the busiest years for 'John Travolta', show the year and the number of movies he made each year for any year in which he made more than 2 movies.
13、 List the film title and the leading actor for all of the films 'Julie Andrews' played in.
14、 Obtain a list, in alphabetical order, of actors who've had at least 30 starring roles.
15、 List the films released in the year 1978 ordered by the number of actors in the cast.
16、 List all the people who have worked with 'Art Garfunkel'.
原文链接 http://blog.youkuaiyun.com/crazy__chen/article/details/50514100