WITH MOST TESTED QUESTIONS AND ANSWERS | GRADED A+ |
ASSURED SUCCESS WITH DETAILED RATIONALES
1
What will be the results of this selection?
A. No rows will be returned — there is a syntax error.
B. All last names that do not begin with A or B.
C. All rows will be returned.
D. All last names that begin with A or B.
Rationale: NOT LIKE 'A%' excludes names beginning with A; combining with AND last_name NOT LIKE
'B%' excludes names beginning with B as well. The query returns rows whose last_name starts with
neither A nor B.
2
Which statement about logical operator precedence in SQL is correct?
A. The order of operator precedence is AND, NOT, OR.
B. The order of operator precedence is AND, OR, NOT.
C. The order of operator precedence is NOT, AND, OR.
D. The order of operator precedence is NOT, OR, AND.
Rationale: Standard SQL evaluates NOT first, then AND, then OR. Use parentheses to make intent
explicit when mixing operators.
3
Which of the following best describes the meaning of the LIKE operator?
A. Display rows based on a numeric range of values.
, B. To find NULL values.
C. To test for membership in a list.
D. Match a character pattern (wildcards such as % and _).
Rationale: LIKE is used for pattern matching (e.g., name LIKE 'J%n'), not for lists or numeric ranges.
4
You want reverse alphabetical order in an ORDER BY clause. Which keyword do you include?
A. SORT
B. ASC
C. CHANGE
D. DESC
Rationale: DESC specifies descending order; ASC is ascending (default).
5
Which statement about the ORDER BY clause is true?
A. The ORDER BY clause should immediately precede the FROM clause.
B. The ORDER BY clause can only contain columns included in the SELECT list.
C. You can use a column alias in the ORDER BY clause.
D. The default sort order of the ORDER BY clause is descending.
Rationale: You may reference a selected column’s alias in ORDER BY (e.g., SELECT col AS c FROM t
ORDER BY c). Default sort order is ascending and ORDER BY comes after FROM/WHERE/GROUP
BY/HAVING.
6
What rows are returned by this query?
sql
CopyEdit
SELECT employee_id FROM employees
WHERE employee_id BETWEEN 100 AND 150
OR employee_id IN (119, 175, 205)