[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 ...
随机推荐
- 【Spring系列】Spring IoC
前言 IoC其实有两种方式,一种是DI,而另一种是DL,即Dependency Lookup(依赖查找),前者是当前软件实体被动接受其依赖的其他组件被IOc容器注入,而后者是当前软件实体主动去某个服务 ...
- 告知你不为人知的UDP-连接性和负载均衡
版权声明:本文由黄日成原创文章,转载请注明出处: 文章原文链接:https://www.qcloud.com/community/article/812444001486438028 来源:腾云阁 h ...
- package.json字段全解(转)
Name 必须字段. 小提示: 不要在name中包含js, node字样: 这个名字最终会是URL的一部分,命令行的参数,目录名,所以不能以点号或下划线开头: 这个名字可能在require()方法中被 ...
- Nokia 920全部CODE
code码都是7位,我是从别的地方copy过来的,code码后面带了些乱码懒得删了,自己数7位code就是了. RM-820 NDT AMERICA ATT White 059N5T3R ...
- Linux应急处理操作手册
基础准备--命令防篡改与命令记录 很多黑客入侵到操作系统后,会做两个常见的操作unset history和替换命令文件(或者对应的链接库文件),针对这两点要做好记录shelllog并且检查链接库类文件 ...
- html5media 视频
官网: https://html5media.info/ 二.引入script <script src="//api.html5media.info/1.1.8/html5media. ...
- 5-5 ES6的模块化的基本规则或特点
一.AMD, CMD, CommonJs和ES6对比 1.AMD ==> 是RequireJS在推广过程中对模块定义的规范化产出 // RequireJS定义标准, 导步加载依赖, 依赖前置 d ...
- Windows Phone Bing lock screen doesn't change解决方法
之前一直用的Lumia 925,Bing lock screen每天都会更换.这几天换了Lumia 930,同步了账号相关的设置,发现Bing lock screen不再每天更换.尝试重启.使用cel ...
- H3C系列之三层交换机dhcp功能的开启
环境介绍>>>>>>>>>>>>>>>>>>>>交换机名牌:H3C交换机类型:三 ...
- Unity3D 面试三 ABCDE
说说AB两次面试: “金三银四” 三月份末又面试过两家:共和新路2989弄1号1001这家找了我半天,哇好漂亮的办公大楼!问了保安才知道,这个地址是小区地址.另一家也是创业公司面试我的自称是在腾讯做过 ...