Пробовал сделать такой запрос с join'ами:
SELECT a.Continent, a.Region, COUNT(a.Name) as Countries,
ROUND(AVG(a.LifeExpectancy), 2) as LifeDuration, SUM(a.Population) as Population,
COUNT(b.name) as cities, COUNT(c.Language) as Languages
FROM `country` as a
LEFT JOIN city as b
ON a.Code = b.CountryCode
LEFT JOIN countrylanguage as c
ON a.Code = c.CountryCode
GROUP BY a.Region
ORDER BY a.Continent, a.Region
Но выводится такая ерунда:
По сути я знаю как по отдельности в 3 запроса вывести все столбцы:
Continent, Region, Countries, LifeDuration, Population:
SELECT Continent, Region, COUNT(Name) as Countries, ROUND(AVG(LifeExpectancy), 2) as LifeDuration, SUM(Population) as Population
FROM `country`
GROUP BY Region
ORDER BY Continent, Region
Cities:
SELECT COUNT(b.name) as cities
FROM `country` as a
LEFT JOIN city as b
ON a.Code = b.CountryCode
GROUP BY a.Region
ORDER BY a.Continent, a.Region
Languages:
SELECT COUNT(c.Language) as Languages
FROM `country` as a
LEFT JOIN countrylanguage as c
ON a.Code = c.CountryCode
GROUP BY a.Region
ORDER BY a.Continent, a.Region
Как объединить эти три запроса в один, чтоб вывелась результирующая таблица?