[LeetCode] 595. Big Countries_Easy tag: SQL
There is a table World
+-----------------+------------+------------+--------------+---------------+
| 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 |
+-----------------+------------+------------+--------------+---------------+
A country is big if it has an area of bigger than 3 million square km or a population of more than 25 million.
Write a SQL solution to output big countries' name, population and area.
For example, according to the above table, we should output:
+--------------+-------------+--------------+
| name | population | area |
+--------------+-------------+--------------+
| Afghanistan | 25500100 | 652230 |
| Algeria | 37100000 | 2381741 |
+--------------+-------------+--------------+ Code
SELECT name, population, area FROM World WHERE area > 3000000 OR population > 25000000
[LeetCode] 595. Big Countries_Easy tag: SQL的更多相关文章
- [LeetCode] 182. Duplicate Emails_Easy tag: SQL
Write a SQL query to find all duplicate emails in a table named Person. +----+---------+ | Id | Emai ...
- [LeetCode] 197. Rising Temperature_Easy tag: SQL
Given a Weather table, write a SQL query to find all dates' Ids with higher temperature compared to ...
- [LeetCode] 610. Triangle Judgement_Easy tag: SQL
A pupil Tim gets homework to identify whether three line segments could possibly form a triangle. Ho ...
- [LeetCode] 607. Sales Person_Easy tag: SQL
Description Given three tables: salesperson, company, orders.Output all the names in the table sales ...
- [LeetCode] 577. Employee Bonus_Easy tag: SQL
Select all employee's name and bonus whose bonus is < 1000. Table:Employee +-------+--------+---- ...
- [LeetCode] 627. Swap Salary_Easy tag: SQL
Given a table salary, such as the one below, that has m=male and f=female values. Swap all f and m v ...
- [LeetCode] 130. Surrounded Regions_Medium tag: DFS/BFS
Given a 2D board containing 'X' and 'O' (the letter O), capture all regions surrounded by 'X'. A reg ...
- [LeetCode] 415. Add Strings_Easy tag: String
Given two non-negative integers num1 and num2 represented as string, return the sum of num1 and num2 ...
- [LeetCode] 619. Biggest Single Number_Easy tag: SQL
Table number contains many numbers in column num including duplicated ones.Can you write a SQL query ...
随机推荐
- Nginx反向代理腾讯云COS的一个坑
版权声明:本文由黄希彤 原创文章,转载请注明出处: 文章原文链接:https://www.qcloud.com/community/article/668639001484812620 来源:腾云 ...
- [PHP] Compile an extension on Windows
https://wiki.php.net/internals/windows/stepbystepbuildhttp://blog.benoitblanchon.fr/build-php-extens ...
- SharePoint 2013部署自定义HttpModule访问SPContext.Current的一个问题
如果文档库post提交文档时,自定义HttpModule正好有代码访问SPContext.Current属性则会导致上传文档失败.
- 移除DuiLib项目Linker中的riched20.lib
如果已安装Windows SDK.Windows Mobile SDK且默认包含这些目录编译源代码没有问题.由于一些改动需要版本管理发现Build Agent运行失败,考虑到迁移各方面原因还是决定修改 ...
- 简单ORM工具的设计和编写,自己项目中曾经用过的
http://www.cnblogs.com/szp1118/archive/2011/03/30/ORM.html 在之前的一个项目中自己编写了一个简单的ORM小工具,这次重新整理和重构了一下代码, ...
- 安装pod
1.ruby升级最新 sudo gem update -n /usr/local/bin --system 2. $ gem sources *** CURRENT SOURCES *** https ...
- python WEB UI自动化在日期框中动态输入当前日期
要在日期框中输入当前日期,如下图 代码为 本想用最简单的方法,直接用sendkeys发送当前日期,如下: current_time=time.strftime('%Y-%m-%d',time.loca ...
- jfinal如何查看post还是get请求?
jfinal如何查看post还是get请求? controller里面getRequest().getMethod()就行了. 值为 'GET' 或者 'POST'
- 关于python的【if __name__ == "__main__":】
学习东西真的需要自己动手,然后遇到问题,自己学着去解决.当然如果能得到高人指点,那真是走了八辈子运了.可以节省很多时间.但是大多数情况下,不能总是有高人来指点我们.这时就需要靠我们自己了. 在学习py ...
- 【转载】纵观RTX51
对于使用RTX51的具体好处可以在实践中去体会,就象会用了C51,就不想再用汇编了.用了RTX51,说不定就感到再也离不开它了. 1.RTX51是实时多任务操作系统RTX51是一种实时操作系统既目前在 ...