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 |
+--------------+-------------+--------------+ Code
SELECT name, population, area FROM World WHERE area > 3000000 OR population > 25000000

[LeetCode] 595. Big Countries_Easy tag: SQL的更多相关文章

  1. [LeetCode] 182. Duplicate Emails_Easy tag: SQL

    Write a SQL query to find all duplicate emails in a table named Person. +----+---------+ | Id | Emai ...

  2. [LeetCode] 197. Rising Temperature_Easy tag: SQL

    Given a Weather table, write a SQL query to find all dates' Ids with higher temperature compared to ...

  3. [LeetCode] 610. Triangle Judgement_Easy tag: SQL

    A pupil Tim gets homework to identify whether three line segments could possibly form a triangle. Ho ...

  4. [LeetCode] 607. Sales Person_Easy tag: SQL

    Description Given three tables: salesperson, company, orders.Output all the names in the table sales ...

  5. [LeetCode] 577. Employee Bonus_Easy tag: SQL

    Select all employee's name and bonus whose bonus is < 1000. Table:Employee +-------+--------+---- ...

  6. [LeetCode] 627. Swap Salary_Easy tag: SQL

    Given a table salary, such as the one below, that has m=male and f=female values. Swap all f and m v ...

  7. [LeetCode] 130. Surrounded Regions_Medium tag: DFS/BFS

    Given a 2D board containing 'X' and 'O' (the letter O), capture all regions surrounded by 'X'. A reg ...

  8. [LeetCode] 415. Add Strings_Easy tag: String

    Given two non-negative integers num1 and num2 represented as string, return the sum of num1 and num2 ...

  9. [LeetCode] 619. Biggest Single Number_Easy tag: SQL

    Table number contains many numbers in column num including duplicated ones.Can you write a SQL query ...

随机推荐

  1. c++ vector详解

    容器有太多需要清楚细节的地方,同时也有太多值得学习的地方.下文作为学习.工作中用到vector的总结. 1. 赋值运算=的实现原理 在使用赋值操作时,如果不清楚内部是怎么实现,那么用起来会畏手畏脚. ...

  2. 【前端积累】Awesome初识

    前言 之所以要看这个,是因为在看到的一个网站里图表显示的全屏和缩小,anyway ,还是看一下咯~ 一.介绍 Font Awesome 字体为您提供可缩放矢量图标,它可以被定制大小.颜色.阴影以及任何 ...

  3. C#生成随机验证码例子

    C#生成随机验证码例子: 前端: <tr> <td width=" align="center" valign="top"> ...

  4. 黄金票据(Golden Ticket)的原理与实践

    0.黄金票据是什么? 在与认证过程中,经过client与AS的通信会得到TGT,带着TGT想TGS请求,得到票据ticket,用这个ticket可以来访问应用服务器.如果这段有什么疑问,欢迎参考Ker ...

  5. 【转】javascript和html中unicode编码和字符转义的详解

    不是十分理解unicode和html转义的情况下,可能会误用,所以下面会对它们再做比较容易理解的解释: 1.html中的转义:在html中如果遇到转义字符(如“ ”),不管你的页面字符编码是utf-8 ...

  6. Javascript-Object-Definition

    /* 定义对象的方法:构造函数,函数字面量法,工厂模式,构造函数模式 */ /**************************************/ /** **/ /** 1.原生构造函数法 ...

  7. 【转载】ARM与单片机的区别

    前几天在博客园的博问模块上面发布了一个博问,可能是我问题描述有些问题,被一个园友指出,ARM与单片机是不同的.所以我特地查了一下ARM与单片机的区别,之前一直以为ARM就是加强版的单片机,stm32无 ...

  8. background-size:100% 100% 时 background-position: % 失效

    背景知识: background-size background-position 难题: background-size 为 100% 100% 时,background-position 部分失效 ...

  9. .Net微服务架构之运行日志分析系统

    一.引言 .Net技术栈目前还没有像spring cloud相对完整一整微服务架构栈,随着业务发展系统架构演进,自行构建.Net技术体系的微服务架构,配套相关核心组件.因平台基于微服务架构方式研发,每 ...

  10. PyQT5初学(一)

    PyQt5 是Digia的一套Qt5与python绑定的应用框架,同时支持2.x和3.x.本教程使用的是3.x.Qt库由Riverbank Computing开发,是最强大的GUI库之一 ,官方网站: ...