Skip to content

Commit b7d55b7

Browse files
refactor 595
1 parent c7acf34 commit b7d55b7

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

database/_595.sql

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,26 @@
1+
--595. Big Countries
2+
--There is a table World
3+
--
4+
--+-----------------+------------+------------+--------------+---------------+
5+
--| name | continent | area | population | gdp |
6+
--+-----------------+------------+------------+--------------+---------------+
7+
--| Afghanistan | Asia | 652230 | 25500100 | 20343000 |
8+
--| Albania | Europe | 28748 | 2831741 | 12960000 |
9+
--| Algeria | Africa | 2381741 | 37100000 | 188681000 |
10+
--| Andorra | Europe | 468 | 78115 | 3712000 |
11+
--| Angola | Africa | 1246700 | 20609294 | 100990000 |
12+
--+-----------------+------------+------------+--------------+---------------+
13+
--A country is big if it has an area of bigger than 3 million square km or a population of more than 25 million.
14+
--
15+
--Write a SQL solution to output big countries' name, population and area.
16+
--
17+
--For example, according to the above table, we should output:
18+
--
19+
--+--------------+-------------+--------------+
20+
--| name | population | area |
21+
--+--------------+-------------+--------------+
22+
--| Afghanistan | 25500100 | 652230 |
23+
--| Algeria | 37100000 | 2381741 |
24+
--+--------------+-------------+--------------+
25+
126
select name, population, area from World where area > 3000000 or population > 25000000;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy