As the table name hadn't provided lets assume that it's 'table' name. As there some missed values in example table then we assume that it's null values possible in provided data
Answers:
# a)
SELECT t1.name, t1.region, t1.population
FROM table t1
INNER JOIN
(SELECT region, min(area) FROM table WHERE area is not null GROUP BY region) t2 ON t1.region = t2.region and t1.area = t2.area
#b)
SELECT name FROM table
WHERE population < (SELECT population FROM table WHERE name = 'Russia') AND population > (SELECT population FROM table WHERE name = 'Denmark') AND population is not null
Comments
Leave a comment