Using Views

CREATE VIEW bigCities AS
SELECT
  country.Name,
  city.Name AS cityName,
  city.Population
FROM country
INNER JOIN city ON
  country.Code = city.CountryCode AND
  city.Population > 5000000;

SELECT * FROM bigCities


Name cityName Population
Brazil São Paulo 9,968,485
Brazil Rio de Janeiro 5,598,953
China Shanghai 9,696,300
China Peking 7,472,000
China Chongqing 6,351,600
China Tianjin 5,286,800
Congo, The Democratic Republic of the Kinshasa 5,064,000
Colombia Santafé de Bogotá 6,260,862
Egypt Cairo 6,789,479
...

This example creates a bigCities view based on a query that selects data from two tables: country and city. After that, the view can be used as a table.