File tree Expand file tree Collapse file tree 2 files changed +44
-0
lines changed
Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ Have a good contributing!
4545 - [ 596. Classes With at Least 5 Students] ( ./leetcode/easy/596.%20Classes%20With%20at%20Least%205%20Students.sql )
4646 - [ 610. Triangle Judgement] ( ./leetcode/easy/610.%20Triangle%20Judgement.sql )
4747 - [ 619. Biggest Single Number] ( ./leetcode/easy/619.%20Biggest%20Single%20Number.sql )
48+ - [ 620. Not Boring Movies] ( ./leetcode/easy/620.%20Not%20Boring%20Movies.sql )
48492 . [ Medium] ( ./leetcode/medium/ )
4950 - [ 176. Second Highest Salary] ( ./leetcode/medium/176.%20Second%20Highest%20Salary.sql )
5051 - [ 184. Department Highest Salary] ( ./leetcode/medium/184.%20Department%20Highest%20Salary.sql )
Original file line number Diff line number Diff line change 1+ /*
2+ Question 620. Not Boring Movies
3+ Link: https://leetcode.com/problems/not-boring-movies/description/
4+
5+ Table: Cinema
6+
7+ +----------------+----------+
8+ | Column Name | Type |
9+ +----------------+----------+
10+ | id | int |
11+ | movie | varchar |
12+ | description | varchar |
13+ | rating | float |
14+ +----------------+----------+
15+ id is the primary key (column with unique values) for this table.
16+ Each row contains information about the name of a movie, its genre, and its rating.
17+ rating is a 2 decimal places float in the range [0, 10]
18+
19+
20+ Write a solution to report the movies with an odd-numbered ID and a description that is not "boring".
21+
22+ Return the result table ordered by rating in descending order.
23+ */
24+
25+ SELECT
26+ id,
27+ movie,
28+ description,
29+ rating
30+ FROM Cinema
31+ WHERE id % 2 = 1 AND description != ' boring'
32+ ORDER BY rating DESC ;
33+
34+ -- OR with ANSI SQL standard
35+
36+ SELECT
37+ id,
38+ movie,
39+ description,
40+ rating
41+ FROM Cinema
42+ WHERE id % 2 = 1 AND description <> ' boring' -- noqa: CV01
43+ ORDER BY rating DESC
You can’t perform that action at this time.
0 commit comments