Movies with Lowest Ratings
Write a query to determine the lowest rating a user gave to a movie and return the user name, rating, and movie title for that low rating.
How many rows are returned?
Once you executed, enter the value below and click Check Answer.
-
✓ 1101
Hint
First, use min()
to determine what the lowest rating a user rated a movie.
Then do a MATCH
to find all movies with this lowest rating.
Return the user name, the rating, and the movie title.
How many rows are returned?
Once you have entered the answer, click the Try Again button below to continue.
Solution
You can run the following query to find the answer:
MATCH ()-[r:RATED]-(m:Movie)
WITH min(r.rating) as LowestRating
MATCH (u:User)-[r:RATED]-(m:Movie)
WHERE r.rating = LowestRating
RETURN u.name, r.rating, m.title
How many rows are returned?
Once you have entered the answer, click the Try Again button below to continue.
Summary
In this challenge, you wrote a query that used min()
to determine the lowest rating a movie was given.
In the next lesson, you will learn about percentiles and percentages.