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 > 3000000 或 population > 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. 多级nginx代理,获取客户端真实ip

    今天服务里的微信公众号支付业务突然不能用了,报错为网络环境未能通过安全验证,请稍后再试.检查后端日志,没有任何问题,看来是成功创建支付订单,但是调起支付时出现了问题.上网查了一下,这个报错的直接原因是 ...

  2. Django 自带认证功能auth模块和User对象的基本操作

    一.auth模块 from django.contrib import auth django.contrib.auth中提供了许多方法,这里主要介绍其中的三个: authenticate()    ...

  3. 2016-04-25-信息系统实践手记5-CACHE设计一例

    layout: post title: 2016-04-25-信息系统实践手记5-CACHE设计一例 key: 20160425 tags: 业务 场景 CACHE 系统分析 系统设计 缓存 modi ...

  4. 商家服务无法上架提示没有授权信息解决FAQ

    1.地址授权:https://openauth.alipay.com/oauth2/appToAppAuth.htm?app_id=2018032002416255&redirect_uri= ...

  5. SQL Server 锁实验(SELECT加锁探究)

    本例中使用begin tran和with (holdlock)提示来观察SQL Server在select语句中的锁. 开启事务是为了保证时间极短的查询也能观察到锁情况,holdlock相当于开启序列 ...

  6. Python-爬虫03:urllib.request模块的使用

    目录 1. urllib.request的基本使用 1.1 urlopen 1.2. 用urlopen来获取网络源代码 1.3. urllib.request.Request的使用 2. User-A ...

  7. ORM版学员管理系统2

    学生信息管理 展示学生信息 URL部分 url(r'^student_list/', app01_views.student_list, name="student_list"), ...

  8. node 打开浏览器

    npm install --save opn const opn = require('opn'); // 使用默认浏览器打开 // opn('http://sindresorhus.com'); / ...

  9. VMware中某个虚拟机卡死,单独关闭某个虚拟机的办法

    在虚拟机中部署ceph时,其中一个虚拟机突然意外卡死,网络搜索到解决的办法,特此整理如下: 一.找到卡死虚拟机的安装目录,在安装目录下找到VMware这个文本文档 二.打开该文本文档,在文档中查找pi ...

  10. vue methods 中方法的相互调用

    vue在同一个组件内:方法之间经常需要互相调用. methods中的一个方法如何调用methods中的另外一个方法呢? 可以在调用的时候使用  this.$options.methods.test2( ...