https://sqlzoo.net/wiki/SELECT_basics
1.Introducing the world table of countries
SELECT population
FROM world
WHERE name = 'Germany'
2.Scandinavia
SELECT name, population
FROM world
WHERE name IN ('Denmark', 'Norway', 'Sweden');
3.Just the right size
SELECT name, area
FROM world
WHERE area BETWEEN 200000 AND 250000;
SELECT Quiz
1.
SELECT name, population
FROM world
WHERE population BETWEEN 1000000 AND 1250000
2.
Table-E
Albania | 3200000 |
Algeria | 32900000 |
3.
SELECT name FROM world
WHERE name LIKE '%a' OR name LIKE '%l'
4.
name | length(name) |
Italy | 5 |
Malta | 5 |
Spain | 5 |
5.
Andorra | 936 |
6.
SELECT name, area, population
FROM world
WHERE area > 50000 AND population < 10000000
7.
SELECT name, population/area
FROM world
WHERE name IN ('China', 'Nigeria', 'France', 'Australia')
'Algorithm > SQL' 카테고리의 다른 글
[SQL][sqlzoo] SELECT from Nobel (0) | 2020.07.02 |
---|---|
[SQL][sqlzoo] SELECT from world (0) | 2020.07.02 |
[SQL][Leetcode] 184. Department Highest Salary (0) | 2020.06.21 |
[SQL][Leetcode] 183. Customers Who Never Order (0) | 2020.06.21 |
[SQL][Leetcode] 182. Duplicate Emails (0) | 2020.06.21 |