๐ป leetcode/database
[LeetCode] Database | 620. Not Boring Movies
๋ฐ์ฟ๋ฆฌ
2022. 1. 13. 14:41
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