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 |
+--------------+-------------+--------------+

题目描述:利用 sql 语句查询我们需要的结果

题目分析:简单的 sql 语句,算是入门级的,相信稍微学过一点 mysql 查询的都知道怎么写。直接查询我们需要的参数 name, population, area,从 world 表单中,条件是area > 3000000population > 25000000

MySQL 语句如下:

# Write your MySQL query statement below
SELECT
name, population, area
FROM
world
WHERE
area > 3000000 OR population > 25000000
;

LeetCode 595. Big Countries的更多相关文章

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

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

  2. 595. Big Countries --- SQL related from leetcode

    595. Big Countries There is a table World +-----------------+------------+------------+------------- ...

  3. [LeetCode] 595. Big Countries_Easy tag: SQL

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

  4. 595. Big Countries

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

  5. All LeetCode Questions List 题目汇总

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

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

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

  7. [LeetCode] All questions numbers conclusion 所有题目题号

    Note: 后面数字n表明刷的第n + 1遍, 如果题目有**, 表明有待总结 Conclusion questions: [LeetCode] questions conclustion_BFS, ...

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

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

  9. 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 ...

随机推荐

  1. PHP的匿名函数和闭包

    匿名函数 // Example1 $func = function( $param ) { echo $param; }; $func( 'some string' );//输出:some strin ...

  2. BurpSuit2.0专业版破解

    简介 Burp Suite 是用于攻击web 应用程序的集成平台.它包含了许多Burp工具,这些不同的burp工具通过协同工作,有效的分享信息,支持以某种工具中的信息为基础供另一种工具使用的方式发起攻 ...

  3. mssql sqlserver 获取指定汉字的笔画数的方法分享

    转自:http://www.maomao365.com/?p=6421 摘要: 下文讲述计算汉字笔画数的sql函数分享,如下所示: 例:建立汉字笔画数sql函数 )) returns int as b ...

  4. mssql sql server上如何建一个只读视图–视图锁定的另类解决方案

    转自:http://www.maomao365.com/?p=4508 <span style="color:red;font-weight:bold;">我们熟知一个 ...

  5. 解决IE8不支持html5标签最好解决办法?

    完美解决IE(IE6/IE7/IE8)不兼容HTML5标签的方法:HTML5的语义化标签以及属性,可以让开发者非常方便地实现清晰的web页面布局,加上CSS3的效果渲染,快速建立丰富灵活的web页面显 ...

  6. 在 Linux 中自动配置 IPv6 地址

    在 Linux 中自动配置 IPv6 地址 在本文中,我们将学习如何为 ULA 自动配置 IP 地址. 何时使用唯一本地地址 唯一本地地址unique local addresses(ULA)使用 f ...

  7. PHP到底有多牛?你所知道的网站都在用它

    PHP到底有多牛?你所知道的网站都在用它 提起PHP,很多人的第一印象就是网站开发,确实,在网站开发方面,PHP难逢对手,当之无愧是“世界上最好的语言”. 有数据显示,目前全球5000万互联网网站中, ...

  8. python入门学习:2.列表简介

    python入门学习:2.列表简介 关键点:列表 2.1 列表是什么2.2 修改.添加和删除元素2.3 组织列表 2.1 列表是什么   列表,是由一系列按特定顺序排列的元素组成.你可以创建包含字母表 ...

  9. No.3

    1.查看httpd进程数(即prefork模式下Apache能够处理的并发请求数): ps -ef | grep httpd | wc -l 返回结果示例: 1388 表示Apache能够处理1388 ...

  10. 第2章 Java并发机制的底层实现原理

    2.2 synchronized的实现原理与应用 当一个线程A执行字节码时遇到monitorenter指令时,会首先检查该指令关联的Object的对象头中的Mark Word状态. 2.2.1 如果是 ...