The Sci-Fi Shelf
The StreamVerse homepage is getting a new sci-fi rail, and editorial wants the newest thing on the shelf to sit leftmost so the rail looks alive. They need the titles and the years, nothing else beside them.
shows — one row per title in the catalogue. genre is a single label such as sci-fi or drama; release_year is the year the title came out.
| id | title | genre | release_year |
|---|---|---|---|
| 1 | Nebula Drift | sci-fi | 2021 |
| 2 | The Long Kitchen | drama | 2019 |
| 3 | Byte Size | comedy | 2022 |
| 4 | Deep Trench | documentary | 2020 |
| 5 | Neon Alley | sci-fi | 2023 |
The table already exists in the database — there is nothing to create or load.
Task: Write a query that returns title and release_year for the shows filed under the sci-fi genre, most recent release first. Two titles released in the same year come back in alphabetical order of title.
Example output
Shape only — these titles and years are invented:
| title | release_year |
|---|---|
| Glass Canyon | 2024 |
| Slow Orbit | 2018 |
Sign in to solve this problem
Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.
Sign in