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的更多相关文章

  1. LeetCode 595. Big Countries

    There is a table World +-----------------+------------+------------+--------------+---------------+ ...

  2. LeetCode 595. Big Countries (大的国家)

    题目标签: 题目给了我们一个 world table,让我们找出 面积大于3 million square km 或者 人口大于 25 million. 直接用两个条件搜索. Java Solutio ...

  3. 595. Big Countries

    There is a table World +-----------------+------------+------------+--------------+---------------+ ...

  4. SQL Server实现 LeetCode 178 分数排名

    178. 分数排名 SQL架构 编写一个 SQL 查询来实现分数排名.如果两个分数相同,则两个分数排名(Rank)相同.请注意,平分后的下一个名次应该是下一个连续的整数值.换句话说,名次之间不应该有& ...

  5. SQL Server实现 LeetCode 177 第N高的薪水

    177. 第N高的薪水 编写一个 SQL 查询,获取 Employee 表中第 n 高的薪水(Salary). +----+--------+ | Id | Salary | +----+------ ...

  6. SQL Server实现 LeetCode 176 第二高的薪水

    176. 第二高的薪水 SQL架构 编写一个 SQL 查询,获取 Employee 表中第二高的薪水(Salary) . +----+--------+ | Id | Salary | +----+- ...

  7. Leetcode中的SQL题目练习(一)

    595. Big Countries https://leetcode.com/problems/big-countries/description/ Description name contine ...

  8. SQL练习——LeetCode解题和总结(1)

    只用于个人的学习和总结. 178. Rank Scores 一.表信息 二.题目信息 对上表中的成绩由高到低排序,并列出排名.当两个人获得相同分数时,取并列名次,且名词中无断档. Write a SQ ...

  9. All LeetCode Questions List 题目汇总

    All LeetCode Questions List(Part of Answers, still updating) 题目汇总及部分答案(持续更新中) Leetcode problems clas ...

随机推荐

  1. Django多个中间件的执行顺序

    Django中的中间件是一个轻量级.底层的插件系统,可以介入Django的请求和响应处理过程,修改Django的输入或输出.中间件的设计为开发者提供了一种无侵入式的开发方式,增强了Django框架的健 ...

  2. ARCore中根据屏幕坐标计算射线的算法

    ARCore中提供了根据屏幕坐标.视口大小及view. project矩阵计算从屏幕坐标发射一条射线的方法,此方法用于3D拾取. class Ray { public final Vector3f o ...

  3. zookeeper 集群部署

    参考: https://www.cnblogs.com/linuxprobe/p/5851699.html

  4. Delphi中Chrome Chromium、Cef3学习笔记(三)

    原文   http://blog.csdn.net/xtfnpgy/article/details/46635871   Delphi与JS的交互问题: 一.执行简单的JS 上一篇已经讲过: chrm ...

  5. SQL 中的语法顺序与执行顺序

    FROM : HOME SQL 是一种声明式语言 SQL 语言是为计算机声明了一个你想从原始数据中获得什么样的结果的一个范例,而不是告诉计算机如何能够得到结果. SQL 语言声明的是结果集的属性,计算 ...

  6. c#随机生成英文名

    private static string GenerateSurname() {     string name = string.Empty;     string[] currentConson ...

  7. Ubuntu输入命令无效的问题

    https://blog.csdn.net/u014797226/article/details/80800550?utm_source=blogxgwz2 Ubuntu启动时输入密码后,一直停留在登 ...

  8. java项目打成war包

    1.修改pom.xml下的打包方式 <groupId>com.test</groupId> <artifactId>springboot</artifactI ...

  9. redis 动态修改配置与备份文件目录

    redis-cli -c -h 10.1.1.1 -p 7000 获取所有可以配置的KEY config get * 设置KEY config set * 配置重新写入配置文件 CONFIG REWR ...

  10. 491. Increasing Subsequences增长型序列

    [抄题]: Given an integer array, your task is to find all the different possible increasing subsequence ...