595. Big Countries --- SQL related from leetcode
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 |
+--------------+-------------+--------------+
Solution:
# Write your MySQL query statement below
select name,area,population from World where area >= 3000000 or population >= 25000000;
595. Big Countries --- SQL related from leetcode的更多相关文章
- LeetCode 595. Big Countries
There is a table World +-----------------+------------+------------+--------------+---------------+ ...
- LeetCode 595. Big Countries (大的国家)
题目标签: 题目给了我们一个 world table,让我们找出 面积大于3 million square km 或者 人口大于 25 million. 直接用两个条件搜索. Java Solutio ...
- 595. Big Countries
There is a table World +-----------------+------------+------------+--------------+---------------+ ...
- SQL Server实现 LeetCode 178 分数排名
178. 分数排名 SQL架构 编写一个 SQL 查询来实现分数排名.如果两个分数相同,则两个分数排名(Rank)相同.请注意,平分后的下一个名次应该是下一个连续的整数值.换句话说,名次之间不应该有& ...
- SQL Server实现 LeetCode 177 第N高的薪水
177. 第N高的薪水 编写一个 SQL 查询,获取 Employee 表中第 n 高的薪水(Salary). +----+--------+ | Id | Salary | +----+------ ...
- SQL Server实现 LeetCode 176 第二高的薪水
176. 第二高的薪水 SQL架构 编写一个 SQL 查询,获取 Employee 表中第二高的薪水(Salary) . +----+--------+ | Id | Salary | +----+- ...
- Leetcode中的SQL题目练习(一)
595. Big Countries https://leetcode.com/problems/big-countries/description/ Description name contine ...
- SQL练习——LeetCode解题和总结(1)
只用于个人的学习和总结. 178. Rank Scores 一.表信息 二.题目信息 对上表中的成绩由高到低排序,并列出排名.当两个人获得相同分数时,取并列名次,且名词中无断档. Write a SQ ...
- All LeetCode Questions List 题目汇总
All LeetCode Questions List(Part of Answers, still updating) 题目汇总及部分答案(持续更新中) Leetcode problems clas ...
随机推荐
- 《算法导论》——计数排序Counting Sort
今天贴出的算法是计数排序Counting Sort.在经过一番挣扎之前,我很纠结,今天这个算法在一些scenarios,并不是最优的算法.最坏情况和最好情况下,时间复杂度差距很大. 代码Countin ...
- Dubbo注册Zookepper服务的虚拟IP
使用dubbo在zookepper上注册服务,使用dubbo的服务器IP为192.168.70.105 而在zookepper上显示服务提供者为 dubbo://202.102.110.203:808 ...
- git从远程分支clone项目到本地,切换分支命令,其他常用命令
1.在git命令窗口输入git clone git@139.129.217.217:sg/sgsq_cms.git 回车,即可克隆远程项目到本地.红色字体为远程分支的SSHkey,可以登录到gitli ...
- SQLyog简介及其功能(附百度云盘下载地址)
一.软件简介 SQLyog 是一个快速而简洁的图形化管理MYSQL数据库的工具,它能够在任何地点有效地管理你的数据库.SQLyog是业界著名的Webyog公司出品的一款简洁高效.功能强大的图形化MyS ...
- Pandas重塑和轴向旋转
重塑和轴向旋转 Se import pandas as pd import numpy as np from pandas import Series data=pd.DataFrame(np.ara ...
- 如何强制停止http请求
http请求很多时候会受到网络阻塞.重连等原因导致响应很慢,如果此时做了一些操作,但过几秒后又响应了之前的请求,就会造成很多问题,此时我们可以使用abort()方法强制停止http请求: let aj ...
- Oracle导出csv时数字不变成科学计数法
导出成CSV后,用excel打开,点击excel的[数据]→[自文本],选择导出的csv文件,下一步,分隔符选择[逗号],下一步,选择所有列“按住shift+鼠标左键选取”后,列数据格式选文本,[完成 ...
- python--linux上如何执行shell命令
1.os.system(command) 参考链接:https://www.jb51.net/article/141877.htm
- node.js中process进程的概念和child_process子进程模块的使用
进程,你可以把它理解成一个正在运行的程序.node.js中每个应用程序都是进程类的实例对象. node.js中有一个 process 全局对象,通过它我们可以获取,运行该程序的用户,环境变量等信息. ...
- stark组件开发之排序
class StartHandler(object): .......... ordered_list = [] # 排序规则由 用户指定. def get_ordered_list(self): r ...