JobsPing

SQL interview practice

Covers joins, indexes, transactions, window functions, query plans. Questions are written for real interviews at junior, mid and senior level.

Start a SQL practice test

15 multiple-choice questions · 15 minutes · instant score with explanations

Sample SQL interview questions

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;
  1. A.Exclusive of both 10 and 50
  2. B.Inclusive of both 10 and 50
  3. C.Exclusive of 10 but inclusive of 50
  4. 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');
  1. A.IN
  2. B.WITH
  3. C.ANY
  4. 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;
  1. A.ISNULL(manager_id)
  2. B.manager_id == NULL
  3. C.manager_id IS NULL
  4. 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.

Ready to apply? Browse remote SQL jobs →