第一题:Big Countries
Posted xlzfdddd
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了第一题:Big Countries相关的知识,希望对你有一定的参考价值。
https://leetcode.com/problems/big-countries/description/
要求:
+-----------------+------------+------------+--------------+---------------+
| name | continent | area | population | gdp |
+-----------------+------------+------------+--------------+---------------+
| Afghanistan | Asia | 652230 | 25500100 | 20343000 |
| Albania | Europe | 28748 | 2831741 | 12960000 |
| Algeria | Africa | 2381741 | 37100000 | 188681000 |
| Andorra | Europe | 468 | 78115 | 3712000 |
| Angola | Africa | 1246700 | 20609294 | 100990000 |
+-----------------+------------+------------+--------------+---------------+
查找面积超过 3,000,000 或者人口数超过 25,000,000 的国家。
+--------------+-------------+--------------+
| name | population | area |
+--------------+-------------+--------------+
| Afghanistan | 25500100 | 652230 |
| Algeria | 37100000 | 2381741 |
+--------------+-------------+--------------+
解题:
SELECT name, population, area FROM World WHERE area > 3000000 OR population > 25000000;
以上是关于第一题:Big Countries的主要内容,如果未能解决你的问题,请参考以下文章
LeetCode解题思路:595. Big Countries