1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-11 02:58:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/大的国家 [big-countries].html
2022-03-29 12:43:11 +08:00

62 lines
1.9 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<p><code>World</code> 表:</p>
<div class="top-view__1vxA">
<div class="original__bRMd">
<div>
<pre>
+-------------+---------+
| Column Name | Type |
+-------------+---------+
| name | varchar |
| continent | varchar |
| area | int |
| population | int |
| gdp | int |
+-------------+---------+
name 是这张表的主键。
这张表的每一行提供:国家名称、所属大陆、面积、人口和 GDP 值。
</pre>
<p>&nbsp;</p>
<p>如果一个国家满足下述两个条件之一,则认为该国是 <strong>大国</strong> </p>
<ul>
<li>面积至少为 300 平方公里(即,<code>3000000 km<sup>2</sup></code>),或者</li>
<li>人口至少为 2500 万(即 <code>25000000</code></li>
</ul>
<p>编写一个 SQL 查询以报告 <strong>大国</strong> 的国家名称、人口和面积。</p>
<p><strong>任意顺序</strong> 返回结果表。</p>
<p>查询结果格式如下例所示。</p>
<p>&nbsp;</p>
<p><strong>示例:</strong></p>
<pre>
<strong>输入:</strong>
World 表:
+-------------+-----------+---------+------------+--------------+
| name | continent | area | population | gdp |
+-------------+-----------+---------+------------+--------------+
| Afghanistan | Asia | 652230 | 25500100 | 20343000000 |
| Albania | Europe | 28748 | 2831741 | 12960000000 |
| Algeria | Africa | 2381741 | 37100000 | 188681000000 |
| Andorra | Europe | 468 | 78115 | 3712000000 |
| Angola | Africa | 1246700 | 20609294 | 100990000000 |
+-------------+-----------+---------+------------+--------------+
<strong>输出:</strong>
+-------------+------------+---------+
| name | population | area |
+-------------+------------+---------+
| Afghanistan | 25500100 | 652230 |
| Algeria | 37100000 | 2381741 |
+-------------+------------+---------+
</pre>
</div>
</div>
</div>