w3resource
SQL exercises

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

SQL movie Database: Subquery 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 DISTINCT mov_title 
FROM movie 
WHERE mov_id IN (
SELECT mov_id 
FROM movie 
WHERE mov_id NOT IN (
SELECT mov_id FROM Rating));

Sample Output:

                     mov_title
----------------------------------------------------
 Deliverance
 Amadeus
 Spirited Away
 The Prestige
 The Deer Hunter
 Eyes Wide Shut
 Back to the Future
 The Shawshank Redemption
 Seven Samurai
(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 titles of all movies directed by the director whose first and last name are Woddy Allen.
Next: Write a query in SQL to find the names of all reviewers who have ratings with a NULL value.

What is the difficulty level of this exercise?



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