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. c/c++ 二叉排序树

    c/c++ 二叉排序树 概念: 左树的所有节点的值(包括子节点)必须小于中心节点,右树所有节点的值(包括子节点)必须大于中心节点. 不允许有值相同的节点. 二叉排序树的特点: 中序遍历后,就是从小到大 ...

  2. [HBase_3] HBase 命令

    0. 说明 1. HBase 命令 1.1 HBase 与 SQL 的区别 1.2 合并 HBase 中的小文件 major_compact 'test:t1' 1.3 删除数据的区别 HBase 在 ...

  3. php中jpgraph库的使用

    用Jpgraph,只要了解它的一些内置函数,可以轻松得画出折线图.柱形图.饼状图等图表. 首先要保证PHP打开了Gd2的扩展: 打开PHP.ini,定位到extension=php_gd2.dll,把 ...

  4. vCenter server 的部署和实施

    上一次我们讲解了vclient 5.5 的安装以及连接ESXI5.5,但vclient只能管理一台ESXI,管理多台还需要切换登陆,非常麻烦.所以这次我们就来讲解一下vcenter server的相关 ...

  5. java实现支付宝支付及退款(二)

    紧跟上篇博客,本篇将书写具体的代码实现 开发环境:SSM.maven.JDK8.0 1.Maven坐标 <!--阿里支付--> <dependency> <groupId ...

  6. Nunit单元测试入门学习随笔(一)

    Nunit单元测试 一.插件安装与项目关联 选择工具~扩展和更新 点击联机~搜索Nunit安装图内三个插件 新建单元测试项目 勾选项目引用 二.Nunit学习 1.了解单元测试 单元测试在我的理解是测 ...

  7. Git无法提交,报错

    Failed at the ant-design-pro@2.2.1 lint-staged script. npm ERR! This is probably not a problem with ...

  8. WPFのDecorator 、Adorner和AdornerDecorator

    Decorator 和 Adorner 它们都有“装饰品”的意思. Decorator类负责包装某个UI元素,以提供额外的行为.它有一个类型为UIElement的Child属性,其中含有待包装的内容. ...

  9. Java 8 新特性:5-Supplier、IntSupplier、BinaryOperator接口

    (原) 这个接口很简单,里面只有一个抽象方法,没有default和静态方法. /* * Copyright (c) 2012, 2013, Oracle and/or its affiliates. ...

  10. 5.06-re

    import re # 贪婪模式 从开头匹配到结尾 默认 # 非贪婪 one = 'mdfsdsfffdsn12345656n' two = "a\d" pattern = re. ...