문제
입력 코드
1. MOD
SELECT *
FROM Cinema
WHERE (MOD(id, 2) = 1) AND (description != 'boring')
ORDER BY rating DESC;
2. %
SELECT *
FROM Cinema
WHERE (id % 2 = 1) AND (description != 'boring')
ORDER BY rating DESC;
코드 설명
#SELECT #MOD #ORDER BY #%
문제 출처
Not Boring Movies - LeetCode
Can you solve this real interview question? Not Boring Movies - Table: Cinema +----------------+----------+ | Column Name | Type | +----------------+----------+ | id | int | | movie | varchar | | description | varchar | | rating | float | +----------------
leetcode.com
'SQL' 카테고리의 다른 글
#91. [LeetCode / MySQL] 1075. Project Employees I (0) | 2023.09.17 |
---|---|
#90. [LeetCode / MySQL] 1251. Average Selling Price (0) | 2023.09.16 |
#88. [LeetCode / MySQL] 1934. Confirmation Rate (0) | 2023.09.14 |
#87. [LeetCode / MySQL] 570. Managers with at Least 5 Direct Reports (0) | 2023.09.13 |
#86. [LeetCode / MySQL] 1280. Students and Examinations (0) | 2023.09.12 |