easySELECTWHERE
Big Countries
Find countries with a large area or population.
Start practicePrompt
Big Countries
Prompt
A country is big if its area is at least 3,000,000 km² OR its population is at least 25,000,000.
Given the world table below, write a query that returns the name, population, and area of every big country.
- Thresholds are inclusive:
area >= 3000000andpopulation >= 25000000. - The order of the result does not matter.
Example
| name | continent | area | population | gdp |
|---|---|---|---|---|
| China | Asia | 9600000 | 1440000000 | 14300000 |
| Monaco | Europe | 2 | 39000 | 7000 |
| Nauru | Oceania | 21 | 10800 | 1300 |
Expected result:
| name | population | area |
|---|---|---|
| China | 1440000000 | 9600000 |
Constraints
world.nameis the primary key.
Tips
- A simple
WHERE area >= 3000000 OR population >= 25000000is all it takes — noANDanywhere.
Expected concepts
- SELECT
- WHERE OR
- Column aliases
Schema
CREATE TABLE world (
name TEXT PRIMARY KEY,
continent TEXT NOT NULL,
area INTEGER NOT NULL,
population INTEGER NOT NULL,
gdp INTEGER NOT NULL
);
Sample data
INSERT INTO world (name, continent, area, population, gdp) VALUES
('China', 'Asia', 9600000, 1440000000, 14300000),
('India', 'Asia', 3287263, 1400000000, 3170000),
('USA', 'N. America', 9833520, 332000000, 21000000),
('Monaco', 'Europe', 2, 39000, 7000),
('Nauru', 'Oceania', 21, 10800, 1300),
('Brazil', 'S. America', 8515767, 214000000, 1400000);
Additional hidden fixtures are applied during validation to test edge cases.