728x90
💻 문제 주소 : Big Countries - LeetCode
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
💻 문제
A country is big if:
- it has an area of at least three million (i.e., 3000000km²), or
- it has a population of at least twenty-five million (i.e., 25000000)
Write a solution to find the name, population, and area of the big countries.
Return the result table in any order.
- 면적이 최소 300만km²거나 인구가 2500만일 때 '큰' 나라라고 부른다. 큰 나라에 속하는 나라명, 인구 수, 그리고 면적을 구하라.
💻 코드 및 풀이
select name, population, area
from World
where area >= 3000000 or population >= 25000000
-- (1) it has an area of at least three million
-- (2) it has a population of at least twenty-five million
728x90
반응형
'SQL > LeetCode' 카테고리의 다른 글
[LeetCode][SQL50] #6. Replace Employee ID With The Unique Identifier (0) | 2023.11.07 |
---|---|
[LeetCode][SQL50] #5. Invalid Tweets (0) | 2023.11.06 |
[LeetCode][SQL50] #4. Article Views I (0) | 2023.11.06 |
[LeetCode][SQL50] #2. Find Customer Referee (0) | 2023.11.03 |
[LeetCode][SQL50] #1. Recyclable and Low Fat Products (0) | 2023.11.03 |