Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Strategic Database Technology Management For The Year 2000

Authors: Alan Simon

1st Edition

155860264X, 978-1558602649

More Books

Students also viewed these Databases questions

Question

Describe the factors that lead to productive conflict

Answered: 1 week ago

Question

1. Identify what positions are included in the plan.

Answered: 1 week ago

Question

2. Identify the employees who are included in the plan.

Answered: 1 week ago