10 14 Oracle University and 7i Business Solutions SA De CV use only THESE eKIT

10 14 oracle university and 7i business solutions sa

This preview shows page 212 - 226 out of 422 pages.

10 - 14 Oracle University and 7i Business Solutions, S.A. De C.V use only THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Image of page 212
MySQL for Beginners Chapter 10 - Joining Tables Further Practice These are additional exercises for joining tables. Most of these exercises are put in the form of questions , which you will answer with an appropriate join. You may use the mysql client, or the MySQL Workbench SQL Editor to 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 world database: 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 JOIN statement. Result should include country name and language.) 3. Modify the query used in question 2 so that it includes every country, even when there is no language associated with a country. (Use the LEFT JOIN statement 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
Image of page 213
Image of page 214
Image of page 215
Image of page 216
Image of page 217
Image of page 218
Image of page 219
Image of page 220
Image of page 221
Image of page 222
Image of page 223
Image of page 224
Image of page 225
Image of page 226

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture