[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 ...
随机推荐
- gradle-4.1-all.zip
1. https://services.gradle.org/distributions/ https://services.gradle.org/distributions/gradle-4.1-a ...
- laravel blade模板里调用路由方法重定向
@if (Session::get('user') == NULL) {!!Redirect::to('login')!!} @endif or @if (Session::get('user') = ...
- Windows应急响应操作手册
查看表征异常 系统卡慢.宕机.CPU和内存占用高.网络拥塞或断网.磁盘空余空间无理由大幅度缩小等,根据以上表征,可以初步猜测系统面临的问题. windows 下查看系统基本信息 PS C:\Users ...
- 教你如何将word中的表格完美粘贴到ppt中
经常操作办公软件的人一定有一个困惑,ppt本身表格编辑能力似乎很弱,如果从word里直接将一个编辑好的表格复制粘贴到ppt中,整个表格一定会发生让你没有预料的变化,还得重新花老大的劲去重新编辑,有人屛 ...
- 解决使用Foxmail客户端软件不能收取腾讯企业邮箱的全部邮件
一般说来,使用Foxmail客户端软件收取邮箱时,需要作如下几步: 1.进入邮箱web界面授权开启POP3/SMTP服务.IMAP/SMTP等服务 2.在邮箱web界面配置收取选项,可选择收取全部邮件 ...
- SOA架构商城二 框架搭建
1.创建父工程 创建Maven工程pingyougou-parent,选择packaging类型为pom ,在pom.xml文件中添加锁定版本信息dependencyManagement与plugin ...
- 【转】常用html转义符,JavaScript转义符
HTML字符实体(Character Entities),转义字符串(Escape Sequence) 为什么要用转义字符串? HTML中<,>,&等有特殊含义(<,> ...
- K-means中的K值选择
关于如何选择Kmeans等聚类算法中的聚类中心个数,主要有以下方法(译自维基): 1. 最简单的方法:K≍sqrt(N/2) 2. 拐点法:把聚类结果的F-test值(类间Variance和全局Var ...
- HBase一次客户端读写异常解读分析与优化全过程(干货)
大数据时代,HBase作为一款扩展性极佳的分布式存储系统,越来越多地受到各种业务的青睐,以求在大数据存储的前提下实现高效的随机读写操作.对于业务方来讲,一方面关注HBase本身服务的读写性能,另一方面 ...
- EDA优势
1.提供明确的表述性业务概念 在某些场景下,一个业务概念会被多个流程更改,如果此属性逻辑发生变化,其他关联的流程将无法知晓,导致bug产生 如:出于性能或其他因素考虑下,为A表增加一个冗余字段,操作A ...