Objective Assessment (OA) & Pre-Assessment Exam Prep
150 Verified Practice Questions with Correct Answers & Detailed
Rationales
Updated for 2026/2027 Academic Year | Guaranteed Pass A+
SECTION 1: SQL FUNDAMENTALS & QUERY EXECUTION
(Questions 1-25)
Question 1.
Which SQL clause is used to filter rows BEFORE they are grouped by an aggregate
function?
A. HAVING
B. WHERE
C. GROUP BY
D. ORDER BY
Correct Answer: B
Rationale: The WHERE clause filters individual rows before any grouping or aggregation
occurs . The HAVING clause (A) is used to filter groups AFTER the GROUP BY clause has
been applied. GROUP BY (C) is used to create groups of rows, and ORDER BY (D) sorts
the final output . Understanding this distinction is critical because WHERE cannot
contain aggregate functions (like SUM, AVG, COUNT), while HAVING can .
,Question 2.
What is the default sort order of the ORDER BY clause if no direction (ASC or DESC) is
specified?
A. Descending
B. Ascending
C. Random
D. No default; it throws an error
Correct Answer: B
Rationale: In SQL, the ORDER BY clause sorts results in ascending order (ASC) by
default if no direction is specified . This means data is sorted from lowest to highest (A-
Z, 0-9, oldest to newest for dates). To sort in descending order, you must explicitly use
DESC.
Question 3.
Which wildcard character matches exactly ONE single character in a SQL LIKE clause?
A. % (percent sign)
B. * (asterisk)
C. _ (underscore)
D. ? (question mark)
Correct Answer: C
Rationale: In SQL, the underscore (_) wildcard matches exactly one character . The
percent sign (%) matches zero or more characters . The asterisk (*) and question mark (?)
are used in other contexts but are not standard SQL wildcards for the LIKE operator. For
example, WHERE name LIKE 'J_n' would match "Jan", "Jen", "Jon", but not "John" (which
would require J_n%).
Question 4.
Which operator is used in SQL to combine rows from two or more tables based on a
related column between them?
,A. UNION
B. SELECT
C. JOIN
D. WHERE
Correct Answer: C
Rationale: The JOIN clause is used to combine rows from two or more tables based on
a related column between them . UNION (A) combines results from multiple SELECT
statements vertically (stacking rows). SELECT (B) is used to retrieve data from a table,
and WHERE (D) is a filter for conditions on individual rows.
Question 5.
What is the result of the mathematical expression SELECT ; in MySQL?
A. 3
B. 3.75
C. 4
D. NULL
Correct Answer: B
Rationale: In MySQL, division of integers produces a decimal result (3.75) rather than
integer division . Unlike some other programming languages, MySQL does not perform
integer division unless you explicitly use the DIV operator. This is important to remember
when writing queries that perform calculations.
Question 6.
What is the correct logical order of execution for a SELECT statement?
A. SELECT, FROM, WHERE, GROUP BY, HAVING, ORDER BY
B. FROM, WHERE, GROUP BY, HAVING, SELECT, ORDER BY
C. FROM, WHERE, HAVING, GROUP BY, SELECT, ORDER BY
D. SELECT, FROM, WHERE, HAVING, GROUP BY, ORDER BY
Correct Answer: B
, Rationale: The logical order of SQL execution is: FROM (identifies tables), WHERE (filters
rows), GROUP BY (groups rows), HAVING (filters groups), SELECT (selects columns),
ORDER BY (sorts results) . This order explains why you can use column aliases in ORDER
BY but not in WHERE, and why WHERE cannot use aggregate functions.
Question 7.
Which SQL statement correctly uses a subquery?
A. SELECT * FROM employees WHERE salary > (SELECT AVG(salary) FROM employees);
B. SELECT * FROM employees WHERE salary > SELECT AVG(salary) FROM employees;
C. SELECT * FROM employees WHERE (SELECT AVG(salary) FROM employees) > salary;
D. SELECT * FROM employees WHERE salary > (SELECT salary FROM employees);
Correct Answer: A
Rationale: The correct syntax requires the subquery to be enclosed in parentheses .
Option A is correct because the subquery (SELECT AVG(salary) FROM employees) returns a
single value that is compared to each row's salary. Option B is missing parentheses.
Option C has the comparison reversed but would work syntactically. Option D would
return multiple rows and cause an error.
Question 8.
Which clause in SQL is used to sort the result set in ascending or descending order?
A. GROUP BY
B. ORDER BY
C. HAVING
D. WHERE
Correct Answer: B
Rationale: The ORDER BY clause is used to sort the result set in ascending or
descending order . GROUP BY groups rows, HAVING filters groups, and WHERE filters
individual rows.