A. Continent_summary_view: Create a view to display each continent name, the num
ID: 3721114 • Letter: A
Question
A. Continent_summary_view: Create a view to display each continent name, the number of countries in the continent, the total surface areas, and the total populations.
B. Population_view: Create a view to display each country name, country populations, the largest city populations of the country. Only North and South America countries are listed
TABLE City (ID, Name, CountryCode, District, Population, PRIMARY KEY (ID)) TABLE Country (Code, Name, Continent, Region, SurfaceArea, IndepYear small, Population, Life Expectancy, GNP, GNPOld, LocalName, GovernmentForm, HeadOfState, Capital, Code2, PRIMARY KEY (Code)) TABLE Country Language (CountryCode, Language, IsOfficial, Percentage, PRIMARY KEY (CountryCode, Language))Explanation / Answer
If you have any doubts, please give me comment...
CREATE VIEW Continet_summary_view AS
SELECT Continent, COUNT(*) AS NUMBER_OF_COUNTRIES, SUM(SurfaceArea) AS TOTAL_SURFACE, SUM(Population) AS TOTAL_POPULATION
FROM Country
GROUP BY Continet;
CREATE VIEW Population_view AS
SELECT Country, Population
FROM Country
WHERE Code IN(
SELECT Code
FROM Country
WHERE Name='North America' AND Code IN(
SELECT Code
FROM Country
WHERE Name='South America'
)
);
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.