KEMBAR78
Movie Database | PDF | Technology & Engineering
100% found this document useful (1 vote)
249 views1 page

Movie Database

This document provides 10 SQL queries to retrieve information from a movie database. The queries find movie names and years, identify a specific movie by title and year, return movies released before or after a certain year, combine lists of reviewers and movie titles, find reviewers with high rating counts, identify unrated movies, lookup movies by ID number, find movies containing text in the title, and retrieve an actor ID by first and last name.

Uploaded by

prasad ghate
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
249 views1 page

Movie Database

This document provides 10 SQL queries to retrieve information from a movie database. The queries find movie names and years, identify a specific movie by title and year, return movies released before or after a certain year, combine lists of reviewers and movie titles, find reviewers with high rating counts, identify unrated movies, lookup movies by ID number, find movies containing text in the title, and retrieve an actor ID by first and last name.

Uploaded by

prasad ghate
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

## Movie Database

BASIC queries on movie Database [10 Exercises]

1. Write a query in SQL to find the name and year of the movies

select mov_name,mov_year from movie;

2. Write a query in SQL to find the year when the movie American Beauty released

select mov_year from movie where mov_title = 'American beauty';

3.Write a query in SQL to find the movie which was released in the year 1999.

select * from movie where mov_year = '1999';

4.Write a query in SQL to find the movies which was released before 1998

select * from movie where mov_year < 1998;

5. Write a query in SQL to return the name of all reviewers and name of movies
together in a single list

select reviewer.rev_name from reviewer


UNION
select movie.mov_title from movie

6.Write a query in SQL to find the name of all reviewers who have rated 7 or more
stars to their rating

SELECT reviewer.rev_name
FROM reviewer, rating
WHERE rating.rev_id = reviewer.rev_id
AND rating.rev_stars>=7
AND reviewer.rev_name IS NOT NULL;

7. Write a query in SQL to find the titles of all movies that have no ratings.

select mov_title from movie where mov_id NOT IN (select mov_id from rating);

8. Write a query in SQL to find the titles of the movies with ID 905, 907, 917.

select mov_title from movie where mov_id in (905, 907, 917);

9. Write a query in SQL to find the list of all those movies with year which
include the words Boogie Nights

SELECT mov_id, mov_title, mov_year


FROM movie
WHERE mov_title LIKE '%Boogie%Nights%'
ORDER BY mov_year ASC;

10. Write a query in SQL to find the ID number for the actor whose first name is
'Woody' and the last name is 'Allen'

You might also like