100%(10)10 out of 10 people found this document helpful
This preview shows page 212 - 226 out of 422 pages.
10 - 14Oracle University and 7i Business Solutions, S.A. De C.V use onlyTHESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
MySQL for BeginnersChapter 10 - Joining TablesFurther PracticeThese are additional exercises for joining tables. Most of these exercises are put in the form of questions, which you will answerwith an appropriate join. You may use the mysqlclient, or the MySQL Workbench SQL Editorto complete this lab.Hint: Keep in mind the entities that have the same value in each table, which enable the tables to be linked.The following exercises use the worlddatabase:1.What languages are spoken in the country of Sweden? (Result should include country name and language.)2.For each language that is spoken in a particular country, list the name of the language as well as the name of the country. (Use an INNER JOINstatement. Result should include country name and language.)3.Modify the query used in question 2 so that it includes everycountry, even when there is no language associated with a country. (Use the LEFT JOINstatement instead.) What is the difference in the output?___________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________4.List the name of the country which has the largest number of cities.5.List the name of the countries that have one or more cities, with more than 7 000 000 inhabitants.6.How many pet owners have phone numbers starting with '1555' that own dogs?7.List the pet ownerand pet namefrom the pet_infotable and the pet typefrom the pet_typestable. Do a LEFT JOINand RIGHT JOIN, and note the difference.10 - 15