Notable National Parks
Problem
A national parks registry stores one row per park.
```
NationalPark
+----------------+---------+
| Column | Type |
+----------------+---------+
| park_name | varchar |
| region | varchar |
| area_sq_km | int |
| annual_visitors| int |
+----------------+---------+
park_name is the primary key.
```
A park counts as **notable** if EITHER of these holds:
- its `area_sq_km` is at least 4000, OR
- its `annual_visitors` is at least 1000000.
Return the `park_name`, `annual_visitors`, and `area_sq_km` of every notable park, in any order.
Tables
Example rows — the live problem includes the full dataset.
| park_name | region | area_sq_km | annual_visitors |
|---|---|---|---|
| Cedar Ridge | North | 5200 | 320000 |
| Maple Hollow | East | 760 | 95000 |
| Granite Falls | West | 1100 | 1450000 |
Expected output
Your answer should return 3 rows with the columns park_name, annual_visitors, area_sq_km.
Starter code (SQL)
SELECT *
FROM NationalPark;Solve this SQL question free
Write SQL and run it instantly in your browser — even on your phone. No signup needed to try.
Solution & explanation
Create a free account to unlock the optimal solution, a step-by-step explanation, and the hidden test cases that grade your answer.
Sign up free to unlock