1. Select the code which produces this table

SELECT name, population
  FROM world
 WHERE population BETWEEN 1000000 AND 1250000

2. Pick the result you would obtain from this code:

3. Select the code which shows the countries that end in A or L

SELECT name FROM world
 WHERE name LIKE '%a' OR name LIKE '%l'

4. Pick the result from the query

5. Here are the first few rows of the world table:

Pick the result you would obtain from this code:

6. Select the code that would show the countries with an area larger than 50000 and a population smaller than 10000000

SELECT name, area, population
  FROM world
 WHERE area > 50000 AND population < 10000000

7. Select the code that shows the population density(인구밀도) of China, Australia, Nigeria and France

SELECT name, population/area
  FROM world
 WHERE name IN ('China', 'Nigeria', 'France', 'Australia')

 

'SQL > Sqlzoo' 카테고리의 다른 글

[sqlzoo] SELECT from WORLD Tutorial 정답, 풀이  (0) 2022.07.21
[sqlzoo] SELECT basics 정답, 풀이  (0) 2022.07.21

+ Recent posts