Question
Table: city column name data type size notes about the data ID Number 11 City Id Code (primary key) name Text 35 Name of City
Table: city
column name data type size notes about the data
ID Number 11 City Id Code (primary key)
name Text 35 Name of City
country Code Text 3 Country Code foreign Key to Country(Code)
District Text 20
Population Number 11
Table: country
column name data type size notes about the data
Code Text 3 Country Code (primary key)
Name Text 52 street address
Continent Text 13 Asia, Europe, North America, Africa, Oceania, Antarctica, South America
Region Text 26
SurfaceArea number (10,2)
IndepYear Number 6 Year of independence
Population Number 11
LifeExpectancy Number (3,1)
GNP Number (10,2)
GNPOld Number (10,2)
LocalName Text 45
GovermentForm Text 45
HeadOfState Text 60
Capital Number 11 foreign Key to City (ID)
Code2 Text 2
Table: countrylanguage
column name data type size notes about the data
CountryCode Text 3 Country Code (primary key) foreign Key to Country(Code)
Language Text 30 Language (primary key)
IsOfficial Text 1 Official Language (T or F)
Percentage Number (4,1)
Write the join queries for the SQL database described above:
Please use descriptive column names were needed.
1. The Continent, Country Name, District, City Name and City Population of for all cities with a population of over 3 million people. Sort the results by Continent, Country Name, District and City Name.
2. The Country Name, Language percentage, and population for all countries where English is the official language. Sort the results by descending percentage, ascending Country Name.
3. The Life Expectancy, Country Population, Country Name, Head of State and Official Language of countries with more than 100 million people. Sort the results by Life Expectancy, Population.
4. The Country Name and Capital City of countries with surface area greater than 2 million.
5. The Country Name, Independence Year, Capital City Name, Language, Language Percentage, with Independence Year > 1991. Sort the results by country name ascending and language percentage Descending
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started