Categories:

Tags:



Problem

Table: Cinema

+----------------+----------+
| Column Name    | Type     |
+----------------+----------+
| id             | int      |
| movie          | varchar  |
| description    | varchar  |
| rating         | float    |
+----------------+----------+
id is the primary key (column with unique values) for this table.
Each row contains information about the name of a movie, its genre, and its rating.
rating is a 2 decimal places float in the range [0, 10]

Write a solution to report the movies with an odd-numbered ID and a description that is not "boring".

Return the result table ordered by rating in descending order.

Solution

The problem Not Boring Movies can be solved using a simple query checking for the conditions from problem description.

Implementation

# Write your MySQL query statement below

SELECT *
FROM cinema
WHERE id & 1 = 1 AND description != 'boring'
ORDER BY rating DESC;