Skip to content

Commit 8928c98

Browse files
author
luzhipeng
committedJun 25, 2019
feat: 每日一题 2019-06-19
1 parent 8766a9a commit 8928c98

File tree

2 files changed

+59
-1
lines changed

2 files changed

+59
-1
lines changed
 

‎daily/2019-06-19.md

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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+
```

‎daily/README.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,15 @@ tag: `tree`
5959

6060
时间: 2019-06-14
6161

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)
6369

6470
tag: `sql`
6571

6672
时间: 2019-06-21
73+

0 commit comments

Comments
 (0)
Please sign in to comment.