Write the join queries for the database described in the attached documents. The
ID: 3904260 • Letter: W
Question
Write the join queries for the database described in the attached documents.
The assignment directions are contained in the following pdf file named Word SQL Assignment:
Write the join queries for the database described in the attached documents.
The assignment directions are contained in the following pdf file named Word SQL Assignment:
Explanation / Answer
If you have any doubts, please give me comment...
--1)
SELECT Continent, C.Name, District, CT.name, Population
FROM country C, city CT
WHERE C.Code = CT.countryCode AND Population>300000
ORDER BY Continent, C.Name, District, CT.name;
-- 2)
SELECT C.Name, Percentage, Population
FROM country C, countrylanguage CL
WHERE C.Code = CL.CountryCode AND IsOfficial = 'T' AND Language ='English'
ORDER BY Percentage, C.Name ASC;
-- 3)
SELECT LifeExpectancy, Population, Name, HeadOfState, Language
FROM country C, countrylanguage CL
WHERE C.Code = CL.CountryCode AND IsOfficial = 'T' AND POPULATION>100000000
ORDER BY LifeExpectancy, Population;
-- 4)
SELECT C.Name, CT.name
FROM country C, city CT
WHERE C.Code = CT.countryCode AND SurfaceArea < 2000000;
-- 5)
SELECT C.Name, IndepYear, CT.Name, Language, Percentage
FROM country C, city CT, countrylanguage CL
WHERE C.Code = CL.CountryCode AND C.Code = CT.countryCode AND IndepYear>1991
ORDER BY C.Name ASC, Percentage DESC;
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.