DDSA Solutions

620. Not Boring Movies

Advertisement

Intuition

SQL: filter id%2=1 (odd id) and description not "boring", order by rating descending.

Algorithm

  1. 1SELECT * FROM cinema WHERE id % 2 = 1 AND description != "boring" ORDER BY rating DESC.

Common Pitfalls

  • Use != or <> for "not boring". ORDER BY rating DESC for descending.
620.sql
MySQL
/* Write your T-SQL query statement below */
select * from Cinema 
where id % 2 = 1
and description != 'boring'
order by rating desc
Advertisement
Was this solution helpful?