File tree 2 files changed +59
-1
lines changed
2 files changed +59
-1
lines changed Original file line number Diff line number Diff line change
1
+ ## 每日一题 - Big Countries
2
+
3
+ ### 信息卡片
4
+
5
+ - 时间:2019-06-19
6
+ - 题目链接:https://leetcode.com/problems/big-countries/
7
+ - tag:` sql `
8
+
9
+ ### 题目描述
10
+
11
+ ```
12
+ There is a table World
13
+
14
+ +-----------------+------------+------------+--------------+---------------+
15
+ | name | continent | area | population | gdp |
16
+ +-----------------+------------+------------+--------------+---------------+
17
+ | Afghanistan | Asia | 652230 | 25500100 | 20343000 |
18
+ | Albania | Europe | 28748 | 2831741 | 12960000 |
19
+ | Algeria | Africa | 2381741 | 37100000 | 188681000 |
20
+ | Andorra | Europe | 468 | 78115 | 3712000 |
21
+ | Angola | Africa | 1246700 | 20609294 | 100990000 |
22
+ +-----------------+------------+------------+--------------+---------------+
23
+ A country is big if it has an area of bigger than 3 million square km or a population of more than 25 million.
24
+
25
+ Write a SQL solution to output big countries' name, population and area.
26
+
27
+ For example, according to the above table, we should output:
28
+
29
+ +--------------+-------------+--------------+
30
+ | name | population | area |
31
+ +--------------+-------------+--------------+
32
+ | Afghanistan | 25500100 | 652230 |
33
+ | Algeria | 37100000 | 2381741 |
34
+ +--------------+-------------+--------------+
35
+ ```
36
+
37
+ ### 参考答案
38
+
39
+ 最基本的sql语句,没什么好讲的。 如果不会的话,说明对基础语法不熟。
40
+
41
+ 参考代码:
42
+
43
+ ``` sql
44
+ select name, population, area from World where area > 3000000 or population > 25000000
45
+
46
+ ```
47
+
48
+ ### 其他优秀解答
49
+ ```
50
+ 暂无
51
+ ```
Original file line number Diff line number Diff line change @@ -59,8 +59,15 @@ tag: `tree`
59
59
60
60
时间: 2019-06-14
61
61
62
- ### [ 114.flatten-binary-tree-to-linked-list] ( ./2019-06-21.md )
62
+ ### [ big-countries] ( ./2019-06-19.md )
63
+
64
+ tag: ` sql `
65
+
66
+ 时间: 2019-06-19
67
+
68
+ ### [ nth-highest-salary] ( ./2019-06-21.md )
63
69
64
70
tag: ` sql `
65
71
66
72
时间: 2019-06-21
73
+
You can’t perform that action at this time.
0 commit comments