Closed AnderGI closed 3 months ago
In 4.sql, write a SQL query to determine the number of movies with an IMDb rating of 10.0.
SELECT COUNT(id) FROM movies WHERE id = ( SELECT movie_id FROM ratings WHERE rating = 10.0 );
Executing 4.sql results in a table with 1 column and 1 row.
Isn't there an inconsistency issue in that test case?
SELECT COUNT(id) FROM movies WHERE id IN ( SELECT DISTINCT movie_id FROM ratings WHERE rating = 10.0 ); IN for multiple rows DISTINCT for avoiding duplicates
Exercise description:
Query
SELECT COUNT(id) FROM movies WHERE id = ( SELECT movie_id FROM ratings WHERE rating = 10.0 );
Output in the check50
SELECT COUNT(id) FROM movies WHERE id = ( SELECT movie_id FROM ratings WHERE rating = 10.0 );
Result
Isn't there an inconsistency issue in that test case?