Skip to main content
Back to problems
Leetcode
Easy
Arrays
Big Countries

Return the countries whose area is at least 3 million and whose population is at least 25 million.

Acceptance 100%
Problem Statement

Problem

You are given a table World that stores information about countries.

Write a query to find all countries that satisfy both of the following conditions:

  • area is at least 3000000
  • population is at least 25000000

Return the result with the country name, population, and area.

Notes

  • The order of rows does not matter unless specified otherwise.
  • This is a filtering query based on simple numeric conditions.

Input Format

The input is a database table World with columns:

  • name — country name
  • continent — continent name
  • area — country area
  • population — country population
  • gdp — gross domestic product

Output Format

Return a table with columns:

  • name
  • population
  • area

Constraints

  • Select rows where area >= 3000000
  • Select rows where population >= 25000000
Examples
Sample cases returned by the problem API.

Example 1

Input

World table:
name | continent | area | population | gdp
Afghanistan | Asia | 652230 | 25500100 | 20343000000
Algeria | Africa | 2381741 | 37100000 | 188681000000
Australia | Oceania | 7692024 | 23343200 | 1488000000000
Brazil | South America | 8515767 | 202000000 | 2254100000000
Canada | North America | 9984670 | 35650000 | 1790000000000
China | Asia | 9596961 | 1368000000 | 8350000000000

Output

name | population | area
Australia | 23343200 | 7692024
Brazil | 202000000 | 8515767
Canada | 35650000 | 9984670
China | 1368000000 | 9596961

Explanation

Keep countries with area at least 3,000,000 and population at least 25,000,000.

Premium problem context

Unlock deeper context for this problem

Premium adds guided hints, editorial links, similar variants, discussion resources, and concept maps so you can understand why a problem matters, not just solve it once.

Guided hints
Editorial and discussion links
Concept map and variants
Sign in to unlock
Track your progress
Sign in to bookmark this problem, save notes, and manage its revision plan.