Datasheet
Review Questions
59
20. Column alias names cannot be used in which clause?
A. SELECT clause
B. WHERE clause
C. ORDER BY clause
D. None of the above
21. What is wrong with the following statements submitted in SQL*Plus?
DEFINE V_DEPTNO = 20
SELECT LAST_NAME, SALARY
FROM EMPLOYEES
WHERE DEPARTMENT_ID = V_DeptNo;
A. Nothing is wrong. The query lists the employee name and salary of the employees who
belong to department 20.
B. The DEFINE statement declaration is wrong.
C. The substitution variable is not preceded with the & character.
D. The substitution variable in the WHERE clause should be V_DEPTNO instead of V_DeptNo.
22. Which two statements regarding substitution variables are true?
A. &variable is defined by SQL*Plus, and its value will be available for the duration of the
session.
B. &&variable is defined by SQL*Plus, and its value will be available for the duration of
the session.
C. &n (where n is a any integer) variables are defined by SQL*Plus when values are passed
in as arguments to the script, and their values will be available for the duration of the
session.
D. &&variable is defined by SQL*Plus, and its value will be available only for every refer-
ence to that variable in the current SQL.
23. Look at the data in table PRODUCTS. Which SQL will list the items on the BL shelves? (Show
the result with the most available quantity at the top row.)
PRODUCT_ID PRODUCT_NAME SHELF AVAILABLE_QTY
---------- -------------------- ------ -------------
1001 CREST BL36 354
1002 COLGATE BL36 54
1003 AQUAFRESH BL37 43
2002 SUNNY-D LA21 53
2003 CAPRISUN LA22 45
95127c01.indd 59 2/18/09 6:37:12 AM