595. Big Countries
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 |
+--------------+-------------+--------------+ 如果一个国家面积超过300万平方公里,或者人口超过2500万,就是大国。编写一个SQL解决方案,以输出大国的名称、人口和地区 MySQL(2781ms):
# Write your MySQL query statement below
SELECT name , population , area
FROM World
WHERE population > 25000000 OR area > 3000000 ;
595. Big Countries的更多相关文章
- 595. Big Countries --- SQL related from leetcode
595. Big Countries There is a table World +-----------------+------------+------------+------------- ...
- LeetCode 595. Big Countries
There is a table World +-----------------+------------+------------+--------------+---------------+ ...
- LeetCode 595. Big Countries (大的国家)
题目标签: 题目给了我们一个 world table,让我们找出 面积大于3 million square km 或者 人口大于 25 million. 直接用两个条件搜索. Java Solutio ...
- All LeetCode Questions List 题目汇总
All LeetCode Questions List(Part of Answers, still updating) 题目汇总及部分答案(持续更新中) Leetcode problems clas ...
- Union比or快 Using UNION is faster when it comes to cases like scan two different column。
problem: 595. Big Countries A country is big if it has an area of bigger than 3 million square km or ...
- SQL练习——LeetCode解题和总结(1)
只用于个人的学习和总结. 178. Rank Scores 一.表信息 二.题目信息 对上表中的成绩由高到低排序,并列出排名.当两个人获得相同分数时,取并列名次,且名词中无断档. Write a SQ ...
- Leetcode中的SQL题目练习(一)
595. Big Countries https://leetcode.com/problems/big-countries/description/ Description name contine ...
- 基于小脚丫的ADC081S101 电压采集595数码管显示
RTL结构图 采集模块运用SPI 通讯 MISO方式收集数据 module ad_collect(input sddata,input rst_n,output reg cs,output reg s ...
- Countries in War -POJ3114Tarjan缩点+SPFA
Countries in War Time Limit: 1000MS Memory Limit: 65536K Description In the year 2050, after differe ...
随机推荐
- ioctl函数用法小记
By francis_hao Aug 27,2017 UNPV1对ioctl有算是比较详细的介绍,但是,这些request和后面的数据类型是从哪里来的,以及参数具体该如何使用呢?本文尝试在不 ...
- 学习opencv-------函数使用二(图像变换)
#include"cv.h" #include"highgui.h" using namespace cv; void CVFILTER2D(IplImage ...
- 02.树的序列化与反序列化(C++)
1.二叉树的序列化 输入的一棵树: //二叉树的先序遍历-序列化 #include <iostream> #include <string> #include <sstr ...
- sql service (case when then else end ..... group by)
1. 原表: courseid coursename score ------------------------------------- 1 java 70 2 oracle 90 3 xml 4 ...
- uva 12325 Zombie's Treasure Chest
https://vjudge.net/problem/UVA-12325 题意: 一个箱子,体积为N 两种宝物,体积为S1.S2,价值为V1.V2,数量无限 最多装多少价值的宝物 数据范围:2^32 ...
- UVALive-3263 That Nice Euler Circuit (几何欧拉定理)
https://vjudge.net/problem/UVALive-3263 平面上有一个n个端点的一笔画,第n个端点总是和第一个端点重合,因此图示一条闭合曲线. 组成一笔画的线段可以相交,但不会部 ...
- javascript拖拽原理与简单实现方法[demo]
美国人有一句常用的俗语—“Re-inventing the Wheel”,从字面上来解释就是“重新发明轮子”.可是轮子早已问世,再要去发明岂非劳而无功? 产品经理发下需求,实施者再到网上搜索代码,也许 ...
- 【hdu3033】分组背包(每组最少选一个)
[题意] 有S款运动鞋,一个n件,总钱数为m,求不超过总钱数且每款鞋子至少买一双的情况下,使价值最大.如果有一款买不到,就输出“Impossible". 1<=N<=100 1 ...
- 20151024_004_C#基础知识(C#中的访问修饰符,继承,new关键字,里氏转换,is 和 as,多态,序列化与反序列化)
1:C#中的访问修饰符 public: 公共成员,完全公开,没有访问限制. private: 私有的,只能在当前类的内部访问. protected: 受保护的,只能在当前类的内部以及该类的子类中访问. ...
- eclipse执行maven install命令时跳过test
在pom.xml里面配置一下代码,将跳过test. <plugins> <plugin> <groupId>org.apache.maven.plugins< ...