IS202 Database Systems
(Spring 2011)
Lab. #3
Due date April 20th, 2011
Don't
forget to bring a written (printed) copy of your work
(i.e. SQL queries and their results for the following 10 questions) to the lab.
Your work should contain the SQL statement as well as the outputs.
Write and run MySQL queries for the following questions. Also provide the query
results.
If a query results in more than 10 rows (tuples) give only the first five and
last five rows.
In each case, indicate the number of rows the query returns.
Write the following queries in MySQL:
1. Find those country names that start with the string Turk.
2. Find the largest city (and its population) in the world.
3. Find the smallest city (and its population) in the world.
4. Find the total population over all cities.
5. Find the total population over all countries.
6. Find the language spoken by largest population.
7. List countries by population (descending order).
8. Find the names of countries having at least one city with a population
greater than 5 million.
9. Find among the countries of Query #7 where the official language is English.
10. Find Those Langugaes spoken in at least two countries.
During the Lab hours:
1. You will be asked to turn in your written answers for the above queries
2. You will be asked to write one or two SQL queries (very similar to the above
queries)
3. Your performance will be graded for both step 1 (written work) and step 2
(query practice).