[LeetCode] SQL 50 / MYSQL / 595.Big Countries

2023. 11. 12. 21:55Coding/LeetCode-SQL

문제링크

https://leetcode.com/problems/big-countries/description/

 

Big Countries - LeetCode

Can you solve this real interview question? Big Countries - Table: World +-------------+---------+ | Column Name | Type | +-------------+---------+ | name | varchar | | continent | varchar | | area | int | | population | int | | gdp | bigint | +-----------

leetcode.com

문제

소스코드

# Write your MySQL query statement below
SELECT name, population, area
FROM World
WHERE area >= 3000000 OR population >= 25000000;

문제에 머릿말 기호때문에 자칫 오해하게 써있어서 WHERE 절에 OR가 아니라 AND를 쓸 수도 있을 것 같다. 

둘 중 하나만 충족하면 되는데 첫번째 줄에 or조건을 잘 보면 수월하게 풀릴 수 있을 것 같다.