w3resource
SQL exercises

SQL exercises on movie Database: Find the titles of all movies which have been reviewed by anybody except by Paul Monks

SQL movie Database: Subquery Exercise-13 with Solution

13. Write a query in SQL to find the titles of all movies which have been reviewed by anybody except by Paul Monks.

Sample table: reviewer


Sample table: rating


Sample table: movie


Sample Solution:

SELECT movie.mov_title
FROM movie 
WHERE movie.mov_id IN(
SELECT mov_id 
FROM rating 
WHERE rev_id NOT IN (
SELECT rev_id 
FROM reviewer 
WHERE rev_name='Paul Monks'));

Sample Output:

                     mov_title
----------------------------------------------------
 Avatar
 Lawrence of Arabia
 Donnie Darko
 Aliens
 Vertigo
 The Innocents
 Slumdog Millionaire
 Annie Hall
 Good Will Hunting
 American Beauty
 Titanic
 Beyond the Sea
 Trainspotting
 Princess Mononoke
 The Usual Suspects
 Blade Runner
 Braveheart
 Chinatown
(18 rows)

Practice Online


Movie database model

Query Visualization:

Duration:

Query visualization of Find the titles of all movies which have been reviewed by anybody except by Paul Monks - Duration

Rows:

Query visualization of Find the titles of all movies which have been reviewed by anybody except by Paul Monks - Rows

Cost:

Query visualization of Find the titles of all movies which have been reviewed by anybody except by Paul Monks - Cost

Have another way to solve this solution? Contribute your code (and comments) through Disqus.

Previous: Write a query in SQL to find the names of all reviewers who rated the movie American Beauty.
Next: Write a query in SQL to return the reviewer name, movie title, and number of stars for those movies which rating is the lowest one.

What is the difficulty level of this exercise?



New Content: Composer: Dependency manager for PHP, R Programming