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. Linux CentOS7下安装Python3及其setuptools、pip

    CentOS 7系统自带Python2.7,我们尽量别去卸载它!!否则会出问题,比如yum无法使用等问题. 假若,在安装Python3时没有自动安装setuptools和pip,那么,如何在CentO ...

  2. [20181007]12cR2 Using SQL Patch.txt

    [20181007]12cR2 Using SQL Patch.txt --//12cR2 已经把sql打补丁集成进入dbms_sqldiag,不是11g的 DBMS_SQLDIAG_INTERNAL ...

  3. iOS 让视图UIView 单独显示某一侧的边框线

    有时候需要让view显示某一侧的边框线,这时设置layer的border是达不到效果的.在网上查阅资料发现有一个投机取巧的办法,原理是给view的layer再添加一个layer,让这个layer充当边 ...

  4. 下载Eclipse、下载Java各个版本,来这里就对了

    Eclipse官网:http://www.eclipse.org/ 不信你去看看 Java官网:https://www.java.com/ 不信你去看看 可惜是,每次进入官网提示都是下面这样的:来,我 ...

  5. Python 入门:基本语法

    对于多数从其他编程语言转入Python的来说,或多或少会有些不习惯.如果沿用其他编程语言的语法来写Python代码,那么碰壁是不可避免的了. 本文是基于我看了两个小时的官方文档(Python 2.7 ...

  6. docker:版本变更

    在2017年之前的版本号: v1.4,  v1.5,  v1.6,  v1.7, v1.8, v1.9, v1.10, v1.11, v1.12, v1.13 从2017年开始版本后变更为:${yy} ...

  7. Java 过一下基础

    点我跳过黑哥的卑鄙广告行为,进入正文. Java多线程系列更新中~ 正式篇: Java多线程(一) 什么是线程 Java多线程(二)关于多线程的CPU密集型和IO密集型这件事 Java多线程(三)如何 ...

  8. Day 1 For Knowledge Management

    Hi, There: This is my first day to use CNblogs as my personal knowledge management on internet. I wa ...

  9. 05.Python网络爬虫之三种数据解析方式

    引入 回顾requests实现数据爬取的流程 指定url 基于requests模块发起请求 获取响应对象中的数据 进行持久化存储 其实,在上述流程中还需要较为重要的一步,就是在持久化存储之前需要进行指 ...

  10. 10.scrapy框架简介和基础应用

    今日概要 scrapy框架介绍 环境安装 基础使用 今日详情 一.什么是Scrapy? Scrapy是一个为了爬取网站数据,提取结构性数据而编写的应用框架,非常出名,非常强悍.所谓的框架就是一个已经被 ...