Datasheet
56
Chapter 1
Introducing SQL
11. Refer to the EMP table in question 2. When you issue the following query, which line has
an error?
1. SELECT empno “Enumber”, ename “EmpName”
2. FROM emp
3. WHERE deptno = 10
4. AND “Enumber” = 7782
5. ORDER BY “Enumber”;
A. 1
B. 5
C. 4
D. No error; the statement will finish successfully.
12. You issue the following query:
SELECT empno, ename
FROM emp
WHERE empno = 7782 OR empno = 7876;
Which other operator can replace the OR condition in the WHERE clause?
A. IN
B. BETWEEN .. AND ..
C. LIKE
D. <=
E. >=
13. The following are clauses of the SELECT statement:
1. WHERE
2. FROM
3. ORDER BY
In which order should they appear in a query?
A. 1, 3, 2
B. 2, 1, 3
C. 2, 3, 1
D. The order of these clauses does not matter.
14. Which statement searches for PRODUCT_ID values that begin with DI_ from the ORDERS table?
A. SELECT * FROM ORDERS
WHERE PRODUCT_ID = ‘DI%’;
B. SELECT * FROM ORDERS
WHERE PRODUCT_ID LIKE ‘DI_’ ESCAPE ‘\’;
C. SELECT * FROM ORDERS
WHERE PRODUCT_ID LIKE ‘DI\_%’ ESCAPE ‘\’;
95127c01.indd 56 2/18/09 6:37:12 AM