w3resource
SQL exercises

SQL exercises on movie Database: Find the name of all reviewers who have rated 7 or more stars to their rating

SQL movie Database: Basic Exercise-6 with Solution

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

Sample table: reviewer


Sample table: rating


Sample Solution:

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;

Sample Output:

            rev_name
--------------------------------
 Righty Sock
 Jack Malvern
 Flagrant Baronessa
 Victor Woeltjen
 Simon Wright
 Mike Salvati
 Sasha Goldshtein
 Righty Sock
 Krug Stillo
 Hannah Steele
 Vincent Cadena
 Brandt Sponseller
 Righty Sock
 Jack Malvern
 Flagrant Baronessa
 Victor Woeltjen
 Simon Wright
 Mike Salvati
 Sasha Goldshtein
 Righty Sock
 Krug Stillo
 Hannah Steele
 Vincent Cadena
 Brandt Sponseller
 Righty Sock
 Jack Malvern
 Flagrant Baronessa
 Victor Woeltjen
 Simon Wright
 Mike Salvati
 Sasha Goldshtein
 Righty Sock
 Krug Stillo
 Hannah Steele
 Vincent Cadena
 Brandt Sponseller
 Righty Sock
 Jack Malvern
 Flagrant Baronessa
 Victor Woeltjen
 Simon Wright
 Mike Salvati
 Sasha Goldshtein
 Righty Sock
 Krug Stillo
 Hannah Steele
 Vincent Cadena
 Brandt Sponseller
 Righty Sock
 Jack Malvern
 Flagrant Baronessa
 Victor Woeltjen
 Simon Wright
 Mike Salvati
 Sasha Goldshtein
 Righty Sock
 Krug Stillo
 Hannah Steele
 Vincent Cadena
 Brandt Sponseller
 Righty Sock
 Jack Malvern
 Flagrant Baronessa
 Victor Woeltjen
 Simon Wright
 Mike Salvati
 Sasha Goldshtein
 Righty Sock
 Krug Stillo
 Hannah Steele
 Vincent Cadena
 Brandt Sponseller
 Righty Sock
 Jack Malvern
 Flagrant Baronessa
 Victor Woeltjen
 Simon Wright
 Mike Salvati
 Sasha Goldshtein
 Righty Sock
 Krug Stillo
 Hannah Steele
 Vincent Cadena
 Brandt Sponseller
(84 rows)

Practice Online


Movie database model

Query Visualization:

Duration:

Query visualization of Find the name of all reviewers who have rated 7 or more stars to their rating - Duration

Rows:

Query visualization of Find the name of all reviewers who have rated 7 or more stars to their rating - Rows

Cost:

Query visualization of Find the name of all reviewers who have rated 7 or more stars to their rating - Cost

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

Previous: Write a query in SQL to return the name of all reviewers and name of movies together in a single list.
Next: Write a query in SQL to find the titles of all movies that have no ratings.

What is the difficulty level of this exercise?



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