Day22 - ON m.movie_id = mg.movie_id WHERE release_year =...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
How many movies were released in 2003? (Return just one number) [8423] ----- SELECT COUNT(movie_id) FROM movies WHERE release_year= 2003 In what year did Jet Li first appear in a movie? When was his latest movie released? (Return just the years; not the titles) [1 row: 1982, 2007] ----- SELECT MIN(release_year), MAX(release_year) FROM movies INNER JOIN movie_actors ON movies.person_id = movie_actors.person_id INNER JOIN people ON people.person_id = movie_actors.person_id wHERE first_name ="Jet" AND last_name = "Li" How many movies were released in each release_year? [122-123; including 1902, 841] ----- SELECT COUNT(movie_id) AS movie_count, release_year FROM movies GROUP BY release_year How many movies of each genre_code were released in 2004? Sort the list so that the most common genre_code is first. [24; first row is SHO, 5609] ---- SELECT genre_code, COUNT(m.movie_id) FROM movies AS m INNER JOIN movie_genres AS mg
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ON m.movie_id = mg.movie_id WHERE release_year = 2004 GROUP BY genre_code ORDER BY COUNT(m.movie_id) DESC Find the earliest release_year when Jet Li starred in movies for each of the different languages (use language_codes) his movies have been in. Show language_code and release_year only for the languages in which he has made at least 3 movies. Sort the list chronologically (i.e., by date). [4; first row is MANDR, 1982]-----SELECT language_code, MIN(release_year) AS Earliest FROM movies AS m INNER JOIN movie_actors AS ma ON m.movie_id = ma.movie_id INNER JOIN people AS p ON p.person_id = ma.person_id INNER JOIN movie_languages AS ml ON m.movie_id = ml.movie_id WHERE first_name = "Jet" AND last_name = "Li" GROUP BY language_code HAVING COUNT(language_code) >2 ORDER BY MIN(release_year)...
View Full Document

This note was uploaded on 12/14/2011 for the course CSE 101 taught by Professor Allusethis during the Fall '08 term at Michigan State University.

Page1 / 2

Day22 - ON m.movie_id = mg.movie_id WHERE release_year =...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online