[LeetCode] 595. Big Countries_Easy tag: SQL
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的更多相关文章
- [LeetCode] 182. Duplicate Emails_Easy tag: SQL
Write a SQL query to find all duplicate emails in a table named Person. +----+---------+ | Id | Emai ...
- [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 ...
- [LeetCode] 610. Triangle Judgement_Easy tag: SQL
A pupil Tim gets homework to identify whether three line segments could possibly form a triangle. Ho ...
- [LeetCode] 607. Sales Person_Easy tag: SQL
Description Given three tables: salesperson, company, orders.Output all the names in the table sales ...
- [LeetCode] 577. Employee Bonus_Easy tag: SQL
Select all employee's name and bonus whose bonus is < 1000. Table:Employee +-------+--------+---- ...
- [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 ...
- [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 ...
- [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 ...
- [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 ...
随机推荐
- 国内首款 FPGA 云服务器,性能是通用 CPU 服务器 30 倍以上
版权声明:本文由薛梁原创文章,转载请注明出处: 文章原文链接:https://www.qcloud.com/community/article/628340001485134638 来源:腾云阁 ht ...
- DataTable进行排序Asc升序,Desc降序
DataTable dt = new DataTable(); DataView dv = dt.DefaultView; dv.Sort = "XXX Asc"; dt=dv.T ...
- laravel blade模板里调用路由方法重定向
@if (Session::get('user') == NULL) {!!Redirect::to('login')!!} @endif or @if (Session::get('user') = ...
- window下node更新
打开cmd查看你之前node版本安装的路径,where node: 直接去官网下载与你电脑系统(32位还是64位)对应的最新的mis版本,安装在上述路径中覆盖即可. 注意:windows上并不支持n模 ...
- sencha touch 在线实战培训 第一期 第七节
2014.1.13晚上8点过一点开的课 本期培训一共八节,前三堂免费,后面的课程需要付费才可以观看. 本节内容: 非结构化数据传输 通过js调取phonegap实现图片采集.上 ...
- Linux上VNC 启动和关闭常见问题
0, 重设密码 [root@yqrh5u2 ~]# vncpasswd Password: Verify: [root@yqrh5u2 ~]# 1, ...
- 【CF757G】Can Bash Save the Day? 可持久化点分树
[CF757G]Can Bash Save the Day? 题意:给你一棵n个点的树和一个排列${p_i}$,边有边权.有q个操作: 1 l r x:询问$\sum\limits_{i=l}^r d ...
- mysql概要(十四)(一)索引
1.索引是对数据库数据建立目录加快了查询速度.索引分为哈希索引和二叉树索引 (大数据量转移,如果表中带有大量字段索引,进行数据导入时,建议先去掉索引导入数据再统一加入索引,减少索引计算量) 2.索引原 ...
- node path的一些理解笔录
例子假如我们有这样的文件结构: app/ -lib/ -common.js -model -task.js -test.js 执行代码: var path = require("path&q ...
- Css控制网页变灰
兼容IE chrome Firefox..... html{ filter:grayscale(%); -moz-filter:grayscale(%); -o-filter:grayscale(%) ...