SELECT
country.NAME AS 'country_name',
city.NAME AS 'city_name',
city.district,
city.population AS 'population',
CASE
WHEN city.id = country.capital THEN
city.NAME ELSE ''
END AS 'capital_name'
FROM
city
INNER JOIN country ON city.CountryCode = country.
CODE INNER JOIN countrylanguage ON country.CODE = countrylanguage.CountryCode
GROUP BY
city.NAME,
city.district,
country.NAME;
ORDER BY
country.NAME ASC;
country.NAME AS 'country_name',
city.NAME AS 'city_name',
city.district,
city.population AS 'population',
CASE
WHEN city.id = country.capital THEN
city.NAME ELSE ''
END AS 'capital_name'
FROM
city
INNER JOIN country ON city.CountryCode = country.
CODE INNER JOIN countrylanguage ON country.CODE = countrylanguage.CountryCode
GROUP BY
city.NAME,
city.district,
country.NAME;
ORDER BY
country.NAME ASC;
OUTPUT:
0 comments:
Post a Comment