Problem
Example
Thinking
id๊ฐ ํ์์ธ ์์ด๋ค๋ง ๊ฐ์ง๊ณ ์์ผ ํ๋ค. 2๋ก ๋๋ ์ฃผ์์ ๋ ๋๋จธ์ง๊ฐ 1์ธ ์ ๋ค๋ง ๊ฐ์ง๊ณ ์ค๋ ค๋ฉด
MOD(id, 2) = 1
๊ทธ๋ฆฌ๊ณ description์ boring์ด ๋ค์ด๊ฐ์์ผ๋ฉด ์๋๊ธฐ์
description != 'boring'
ํ์ ์ด ๋์ ์์๋๋ก ๋์ด๋์ด์ผ ํ๊ธฐ์
ORDER BY rating DESC
Solve
์ ์ถ ๋ต์
SELECT * FROM Cinema
WHERE MOD(id, 2) = 1 and description != 'boring'
ORDER BY rating DESC;
https://leetcode.com/problems/not-boring-movies/
Not Boring Movies - LeetCode
Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.
leetcode.com
'๐ป leetcode > database' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[LeetCode] Database | 176. Second Highest Salary (0) | 2022.01.18 |
---|---|
[LeetCode] Database | 1179. Reformat Department Table (1) | 2022.01.13 |
[LeetCode] Database | 596. Classes More Than 5 Students (0) | 2022.01.12 |
[LeetCode] Database | 197. Rising Temperature (0) | 2022.01.12 |
[LeetCode] Database | 627. Swap Salary (0) | 2022.01.05 |