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. Git多人协作常用命令

    Git多人协作工作模式: 首先,可以试图用git push origin branch-name推送自己的修改. 如果推送失败,则因为远程分支比你的本地更新早,需要先用git pull试图合并. 如果 ...

  2. (一)Maven简介

    Maven这个词可以翻译为“知识的积累”,也可以翻译为“专家”或“内行”,是一个跨平台的项目管理工具.Maven主要服务于基于Java平台的项目构建.依赖管理和项目信息管理. 构建(build)是每一 ...

  3. gif软件(ShareX)

    介绍 官网:https://getsharex.com/ 开源,免费的一款软件,录制GIF功能简单,按下快捷键,选取指定的区域即可进行录制,录制完成后的文件默认存放在个人文件夹,整个过程几乎几打断你的 ...

  4. 【Git学习二】深入了解git checkout命令

    检出命令(git checkout)是Git最常用的命令之一,同时也是一个很危险的命令,因为这条命令会重写工作区.检出命令的用法如下: 用法一:git checkout[-q][<commit& ...

  5. sqli-labs安装

      平台:Win7 SP1     需要准备的东西:   1. Sqli-labs ,下载地址: https://github.com/Audi-1/sqli-labs   2.phpstudy   ...

  6. ubuntu 打开eclipse出现A Java Runtime Environment (JRE) or Java Development Kit (JDK) must be ... 解决方法(转载)

    原创作者:http://www.cnblogs.com/jerome-rong/archive/2013/02/19/2916608.html Java RunTime Environment (JR ...

  7. webpack常见的配置项

    使用vue init webpack test(项目文件夹名)命令初始化一个vue项目,cd test,然后安装依赖npm install之后会生成一些默认的文件夹和文件,这些文件和文件夹中有些和配置 ...

  8. 记录参加QCon2017北京站的心得

    如有侵权,请告知作者删除.scottzg@126.com 很荣幸参加QCon全球软件开发大会,这里特别感谢我们部门的总经理,也是<互联网广告算法和系统实践>此书的作者王勇睿.因为他我才有这 ...

  9. Win10 开始运行不保存历史记录原因和解决方法

    Win10 开始运行命令以后,再次打开就没有任何历史记录了,常规方法是桌面-右键-个性化-开始-显示最常用的应用..可是打开是灰色的不可选. 每次打开开始都没有以前的记录..比如需要打开下regedi ...

  10. 【Window Power Shell】介绍与使用

    Windows PowerShell 是专为系统管理员设计的新 Windows 命令行脚本环境,主要实现系统和应用程序管理自动化. 1.发展历史 在2002年,微软开始研究一个新的产品叫做”Monad ...