SQL QuestSQL Interview Questions › Subqueries & CTEs

Genres Without Blockbusters

MediumFreeQuerying BasicsSubqueries & CTEs

Write a SQL query to find genres that have no movies with revenue over 500 million. Return the distinct genre names. Use NOT IN with a subquery. Order alphabetically by genre.

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".

Schema

movies

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

Expected output: Genres without any blockbuster (>500M) movies

Hint

First find genres WITH blockbusters using a subquery, then use NOT IN to exclude them

Concepts

SELECT Subquery NOT IN DISTINCT NOT IN / Subquery

Practise the topic: SQL practice questions · CTE practice

In these company practice sets

Amazon · Google · Netflix · Snowflake · Spotify

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

Related questions

Department Roster with GROUP_CONCATMedium · FreeConsistent Director AnalysisMedium · FreeBelow Department AverageMedium · FreeHighest Total Salary Budget DepartmentMedium · FreeFare Imputation AnalysisMedium · FreeUNION ALL Dedup: Cross-Dataset SearchMedium · 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