Practice Guide Review of SQL Group Functions and Subqueries
Practice Guide Review of SQL Group Functions and Subqueries
Terminology
Directions: Identify the vocabulary word for each definition below: 1. ________________ These functions operate on a whole table or on a specific grouping of rows to return one result. 2. _________________ Clause used in a query to divide the rows in a table into smaller groups. 3. _____________ Operator used when the outer query WHERE clause is designed to restrict rows based on all values returned from the inner query. 4. ________________ Use multiple row operators and return more than one row from the inner query. 5. ____________________ Operator used when the outer query WHERE clause is designed to restrict rows based on any value returned from the inner query. 6. __________________ Clause used in a query to restrict groups. 7. __________________ A SELECT statement that is embedded in a clause of another SQL statement.
Try It/Solve It
1. Write a SQL statement that will return the smallest area from wf_countries. 2. Without referring to the answer in question 1, write a SQL statement that lists the name of the country with the smallest area? 3. Write a SQL statement that lists the countries with the maximum highest elevation, along with the highest elevation value. 4. List the name of each country and the number of languages spoken in it. Order the results by the number of languages, from the most to the least. 5. List the name of each language and the number of countries it is spoken in. Order the results by the number of countries, from the most to the least. 6. List the region id and the number of countries in it where the region id is below 15. Restrict the list to those regions with less than 20 countries. 7. List the name of the country and its population that has a population the same as the largest population in the Oceania region.
Oracle Academy
1 Database Programming with PL/SQL Copyright 2010, Oracle. All rights reserved.