SQL Quest › SQL Interview Questions › Querying Basics

Recent Hit Movies (2010s)

EasyFreeQuerying Basics

The streaming editor is building a 'Critically Acclaimed 2010s' collection. Find movies released between 2010 and 2019 with a rating of 8.0 or higher. Show title, year, genre, rating. Sort by rating descending, then year ascending (so older classics break ties first).

Solve it in the browser editor →

Runs on SQLite in your browser, graded against the expected result, no signup. A wrong answer gets a diagnosis, not just "incorrect". Free accounts get 10 free challenge solves, and this can be one of them.

Schema

movies

idtitleyeargenreratingvotesrevenue_millionsruntimedirector
1Guardians of the Galaxy2014Action8.1757074333.13121James Gunn
2Prometheus2012Adventure7485820126.46124Ridley Scott
3Split2016Horror7.3157606138.12117M. Night Shyamalan

Expected output: Rows from 2010-2019 with rating >= 8.0

Hint

BETWEEN 2010 AND 2019 is inclusive on both ends. Combine with AND rating >= 8.0. For the tie-breaker, use two keys in ORDER BY: rating DESC, year ASC.

Concepts

SELECT WHERE BETWEEN ORDER BY Filter & Sort

Practise the topic: SQL practice questions

Read the concept: Learn SQL for beginners

In these company practice sets

Netflix · Snowflake · Spotify

A SQL Quest challenge matched to patterns reported for these companies — not a question any of them has published.

Related questions

Sorting and LimitingEasy · FreeDISTINCT ValuesEasy · FreePattern Matching with LIKEEasy · FreeWorking-Age Passengers (BETWEEN)Easy · FreeNon-Sales Roster (NOT IN)Easy · FreeDepartment Leaderboard (Multi-Key Sort)Easy · Free

Where would this cost you points in an interview?

Ten questions, no signup: a Skillmap across nine SQL skills and the one to fix first.

Take the readiness test