Three questions from the bank, with answers. The practice test draws different ones each time.
Question 1 · operators · junior
When using the BETWEEN operator for numerical ranges, are the boundary values included in the results?
SELECT * FROM products
WHERE price BETWEEN 10 AND 50;
A.Exclusive of both 10 and 50
B.Inclusive of both 10 and 50
C.Exclusive of 10 but inclusive of 50
D.Inclusive of 10 but exclusive of 50
Show answer
B. Inclusive of both 10 and 50
The BETWEEN operator includes both boundary values in the range query. A common trap is assuming the bounds are exclusive or writing manual compound inequalities with errors.
Question 2 · filtering · junior
Which operator allows you to easily check if a column value matches any value in a given list?
SELECT * FROM orders
WHERE status IN ('shipped', 'delivered', 'processing');
A.IN
B.WITH
C.ANY
D.BETWEEN
Show answer
A. IN
The IN operator checks if a value matches any value within a specified list, acting as a shorthand for multiple OR conditions. A common trap is using multiple OR conditions incorrectly with precedence or forgetting parentheses.
Question 3 · null-handling · junior
How do you correctly filter for rows where a column contains a NULL value?
SELECT * FROM employees
WHERE manager_id IS NULL;
A.ISNULL(manager_id)
B.manager_id == NULL
C.manager_id IS NULL
D.manager_id = NULL
Show answer
C. manager_id IS NULL
SQL uses the IS NULL operator to check for missing or unknown values because NULL represents the absence of a value and cannot be compared using standard equality operators like '='. A common trap is writing 'manager_id = NULL', which always evaluates to unknown/false.