w3resource
SQL exercises

SQL exercises on movie Database: Find the titles of all movies that have no ratings

SQL movie Database: Basic Exercise-7 with Solution

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

Sample table: movie


Sample table: rating


Sample Solution:

SELECT mov_title
FROM movie
WHERE mov_id NOT IN (
SELECT mov_id 
FROM rating
);

Sample Output:

                     mov_title
----------------------------------------------------
 The Deer Hunter
 Amadeus
 Eyes Wide Shut
 The Shawshank Redemption
 Deliverance
 The Prestige
 Seven Samurai
 Spirited Away
 Back to the Future
(9 rows)

Practice Online


Movie database model

Query Visualization:

Duration:

Query visualization of Find the titles of all movies that have no ratings - Duration

Rows:

Query visualization of Find the titles of all movies that have no ratings - Rows

Cost:

Query visualization of Find the titles of all movies that have no ratings - Cost

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

Previous: Write a query in SQL to find the name of all reviewers who have rated 7 or more stars to their rating.
Next: Write a query in SQL to find the titles of the movies with ID 905, 907, 917.

What is the difficulty level of this exercise?



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