본문 바로가기
SQL/LeetCode

[LeetCode][SQL50] #3. Big Countries

by 이뮴 2023. 11. 6.
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만일 때 '큰' 나라라고 부른다. 큰 나라에 속하는 나라명, 인구 수, 그리고 면적을 구하라.

Input과 Output 예시

 

💻 코드 및 풀이

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
반응형