# Quiz: Logical Comparisons and Precedence Rules

1. Which of the following are examples of logical operators that might be used in a WHERE clause. (Choose Two)
AND, OR (*)
> <, =, <=, >=, <>
NOT IN (*)
LIKES
None of the above

2. What will be the results of the following selection?
SELECT *
FROM employees
WHERE last_name NOT LIKE ‘A%’ AND last_name NOT LIKE ‘B%’

All last names that begin with A or B
All last names that do not begin with A or B (*)
No rows will be returned. There is a syntax error
All rows will be returned

3. Which of the following would be returned by this SQL statement:
SELECT First_name, last_name, department_id
FROM employees
WHERE department_id IN(50,80)
AND first_name LIKE ‘C%’
OR last_name LIKE ‘%s%’

FIRST_NAME LAST_NAME DEPARTMENT_ID
Shelly Higgins 110

FIRST_NAME LAST_NAME DEPARTMENT_ID
Curtis Davies 50

FIRST_NAME LAST_NAME DEPARTMENT_ID
Randall Matos 50

FIRST_NAME LAST_NAME DEPARTMENT_ID
Michael Hartstein 20

All of the above (*)

4. Which of the following is earliest in the rules of precedence?
Concatenation operator
Logical condition
Comparison condition
Arithmetic operator (*)

5. Find the clause that will give the same results as:
SELECT *
FROM d_cds
WHERE cd_number NOT IN(90, 91, 92);
WHERE cd_id <=90 and cd_id >=92;
WHERE cd_id NOT LIKE (90, 91, 92);
WHERE cd_id != 90 and cd_id != 91 and cd_id != 92; (*)
WHERE cd_id != 90 or cd_id != 91 or cd_id!= 92;

6. Which logical operators in the WHERE clause means “Not Equal To”? (Choose Two)
NOT IN (…) (*)
=+
<> (*)
><

7. Which of the following statements best describes the rules of precedence when using SQL?
The order in which the columns are displayed
The order in which the expressions are sorted
The order in which the operators are returned
The order in which the expressions are evaluated and calculated (*)
All of the above

Solution for Test: Quiz: Introduction to The Oracle Academy
Solution for Test: Quiz: Data vs Information
Top