Question: Using World database on MySQL Server as the sample database, write SQL statements to solve the following questions (5points/each). 1. Select the cities (*) in
Using World database on MySQL Server as the sample database, write SQL statements to solve the following questions (5points/each).
1. Select the cities (*) in the United States of America or Brazil, and sort the result first by country and second by city name.
2. Select the cities in the USA and the population larger than 1,000,000, and sort the result by population from largest to smallest.
3. Select the cities in either Texas or California and the population larger than 500,000, and sort the result by population in descending order.
4. Select the cities that have name starting from Sal, and sort the result by country.
5. Count the number (name the result as NoOfCity), the average population (name it as "AvgPopulation"), and the total population (name it as "TotalPopulation) in the USA.
6. List all the countries in North America, and sort the result first by region, and second by surface area in descending order.
7. Find out what is the official language in USA, Canada, China, Mexico, and Brazil.
8. Find out the city that has the largest population in China (need to display both the name of the city and the population).
9. Find out the city that has the lowest population in the USA (need to display both the name of the city and the population).
10. Find out the top 10 cities that have the largest population in the USA (need to display both the name of the cities and the corresponding population).
The world database is online but I just need the sql statements please and thank you!
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
