Magicsheet logo

Not Boring Movies

Easy
12.5%
Updated 8/1/2025

Not Boring Movies

What is this problem about?

The Not Boring Movies SQL problem asks you to select movies from a Cinema table that have an odd ID and a description that is not "boring." Sort results by rating in descending order. This is a foundational SQL filtering and sorting problem.

Why is this asked in interviews?

Microsoft, Meta, Amazon, Google, and Bloomberg ask this as a quick SQL screening question. It tests basic WHERE clause conditions (odd ID using modulo, string inequality), and ORDER BY with direction. The database interview pattern is directly applied in its most fundamental form.

Algorithmic pattern used

SQL WHERE + ORDER BY. SELECT * FROM Cinema WHERE id % 2 = 1 AND description != 'boring' ORDER BY rating DESC. The odd ID check uses modulo: id % 2 = 1 (or id & 1 = 1 for bitwise). The description filter uses != 'boring' or <> 'boring'.

Example explanation

Cinema table:

idmoviedescriptionrating
1WarGreat Action8.9
2ScienceFictional8.5
3irishA Masterpiece7.2
4Ice songBoring7.0

Result: id=1 (odd, not boring, rating=8.9), id=3 (odd, not boring, rating=7.2). Order by rating DESC: rows 1, 3.

Common mistakes candidates make

  • Using id % 2 != 0 (correct alternative) but writing id % 2 = 0 by mistake (even, wrong).
  • Using description NOT LIKE 'boring' — this works only if exact; safer to use != 'boring'.
  • Wrong ORDER BY direction (ASC instead of DESC).
  • Forgetting the case sensitivity of string comparison (database-dependent).

Interview preparation tip

Not Boring Movies is a SQL fundamentals warm-up. Nail the odd/even check (id % 2 = 1), string inequality (!= 'boring'), and ORDER BY direction — these three basic clauses appear in dozens of SQL interview problems. Practice writing clean WHERE clauses with multiple conditions using AND, and always verify ORDER BY direction requirements. Being fast and accurate on easy SQL shows you're ready for the harder multi-table join questions.

Similar Questions