Databases Reference
In-Depth Information
16. How is the nested query identified in a subquery?
(a) The nested query is enclosed in square brackets.
(b) The nested query is enclosed in angle brackets.
(c) The nested query is enclosed in quotes.
(d) The nested query is enclosed in parentheses.
17. Which of the following is a valid local variable name?
(a) TempVal
(b) #TempVal
(c) @TempVal
(d) *TempVal
18. Control-of-flow statements are defined as part of the ANSI SQL standard.
True or false?
19. Which must you specify when declaring a local variable?
(a) data type
(b) initial value
(c) default value
(d) related column
20. A Boolean expression is one that evaluates as true or false. True or False?
Applying This Chapter
The questions in this section are all in reference to the tables shown in
Figure 7-2. Assume that the values shown in the sample SALESPERSON,
CUSTOMER, and CUSTOMER EMPLOYEE tables represent the full table
content.
1. How many rows would you expect to be returned by the following query?
SELECT * FROM SALESPERSON WHERE COMMPERCT = 10
2. You want a list of cities in the CUSTOMER table and the number of cus-
tomers in each headquarters city (HQCITY). What query should you use?
3. Modify the query in question 2 to order the list by count, lowest to
highest. What query should you use?
4. You want a count of customers assigned to salespersons, by salesperson,
in salesperson number order. The query should return the salesperson
number, name, and customer count.
5. You need a list of customers in the CUSTOMER EMPLOYEE table and
the number of employees on file for each. Label the columns Customer
and Employee Count.
Tip: Enclose the table name in square brackets.
Search WWH ::




Custom Search