Not Boring Movies LeetCode Solution

Last updated on March 10th, 2025 at 11:03 pm

Here, we see the Not Boring Movies LeetCode Solution. This Leetcode problem is solved using MySQL and Pandas.

List of all LeetCode Solution

Level of Question

Easy

Not Boring Movies LeetCode Solution

Not Boring Movies LeetCode Solution

1. Problem Statement

Column NameType
idint
movievarchar
descriptionvarchar
ratingfloat
Table: Cinema

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.

The result format is in the following example.

Example 1:
Input:

id moviedescription rating
1Wargreat 3D8.9
2Sciencefiction8.5
3irishboring6.2
4Ice songFantacy8.6
5House cardInteresting9.1
Cinema table:

Output:

idmovie description rating
5House cardInteresting9.1
1Wargreat 3D8.9

Explanation: We have three movies with odd-numbered IDs: 1, 3, and 5. The movie with ID = 3 is boring so we do not include it in the answer.

2. Code Implementation in Different Languages

2.1 Not Boring Movies MySQL

select 
  id, 
  movie, 
  description, 
  rating 
from 
  cinema 
where 
  id % 2 = 1 
  and description <> 'boring' 
order by 
  rating desc;
Scroll to Top