Big Countries
Problem
World(name, continent, area, population, gdp). Return name, population, area for 'big' countries (area >= 3M km² OR population >= 25M).
w=[('Afghanistan','Asia',652230,25500100,20343000),('Albania','Europe',28748,2831741,12960000)][('Afghanistan',25500100,652230)]SELECT name, population, area
FROM World
WHERE area >= 3000000 OR population >= 25000000;
Explanation
This is one of the most direct SQL patterns there is: filter rows, then pick columns. A country counts as "big" if it satisfies either of two size tests, and we just spell that out in a WHERE clause.
The WHERE area >= 3000000 OR population >= 25000000 keeps a row when at least one condition is true. The OR is important — a country qualifies on a huge area even if its population is small, and vice versa.
The SELECT name, population, area then chooses which columns to return for the rows that survived the filter. No grouping, sorting, or joining is needed here.
Example: Afghanistan has area 652230 (below 3M) but population 25500100 (above 25M), so the OR lets it through. Albania fails both tests, so it is dropped. The result is just Afghanistan's name, population, and area.