MoL Chapter 2

From SQLZOO
Jump to: navigation, search

schema:manning;

From chapter 2

Show all the data in the table world
SELECT * FROM world
Show the continent and name
SELECT continent, name FROM world
Show the details of France
SELECT name, population, capital, continent
  FROM world
 WHERE name='France'
Show the Countries of North America
SELECT name, continent
  FROM world
 WHERE continent='North America'
Which country has an area of 103000?
SELECT name, continent
  FROM world
 WHERE area=103000

Try It Now

What country has Beijing as the capital?
SELECT name
  FROM world
 WHERE capital='Beijing'
What is the capital of United Kingdom
SELECT capital
  FROM world
 WHERE name='United Kingdom'
What countries take the name of their capital city?
SELECT name, capital
  FROM world
 WHERE name=capital
Show the countries with more than 200 million
SELECT name, population
  FROM world
 WHERE population>200000000
Show the countries after Y in the alphabet
SELECT name, continent
  FROM world
 WHERE name>'Y'