w3resource
SQL exercises

SQL exercises on movie Database: Find the names of all reviewers who rated the movie American Beauty

SQL movie Database: Subquery Exercise-12 with Solution

12. Write a query in SQL to find the names of all reviewers who rated the movie American Beauty.

Sample table: reviewer


Sample table: rating


Sample table: movie


Sample Solution:

SELECT DISTINCT reviewer.rev_name
FROM reviewer, rating, movie
WHERE reviewer.rev_id = rating.rev_id
AND movie.mov_id = rating.mov_id
AND movie.mov_title = 'American Beauty';

Sample Output:

            rev_name
--------------------------------
 Sasha Goldshtein
(1 row)

Practice Online


Movie database model

Query Visualization:

Duration:

Query visualization of Find the names of all reviewers who rated the movie American Beauty - Duration

Rows:

Query visualization of Find the names of all reviewers who rated the movie American Beauty - Rows

Cost:

Query visualization of Find the names of all reviewers who rated the movie American Beauty - Cost

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

Previous: Write a query in SQL to find the movie title, and the highest number of stars that movie received and arranged the result according to the group of a movie and the movie title appear alphabetically in ascending order.
Next: Write a query in SQL to find the titles of all movies which have been reviewed by anybody except by Paul Monks.

What is the difficulty level of this exercise?



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