Order SQL query logical processing steps

Quick Overview

This question evaluates a candidate's understanding of SQL-92 logical query processing order and relational query semantics, testing competency in reasoning about clause evaluation, aggregation, and filtering.

Order SQL query logical processing steps

Company: Bitkernel

Role: Software Engineer

Category: Software Engineering Fundamentals

Difficulty: medium

Interview Round: Online Assessment

Consider a SQL query written in SQL-92 style: ```sql SELECT foo, COUNT(foo) FROM pokes WHERE foo > 10 GROUP BY foo HAVING COUNT(foo) > 1 ORDER BY foo; ``` Which of the following represents the **logical order** in which the SQL clauses are processed (conceptual evaluation order), according to the SQL-92 standard? Options: - A. `FROM → WHERE → GROUP BY → HAVING → SELECT → ORDER BY` - B. `FROM → GROUP BY → WHERE → HAVING → SELECT → ORDER BY` - C. `FROM → WHERE → GROUP BY → HAVING → ORDER BY → SELECT` - D. `FROM → WHERE → ORDER BY → GROUP BY → HAVING → SELECT`

Quick Answer: This question evaluates a candidate's understanding of SQL-92 logical query processing order and relational query semantics, testing competency in reasoning about clause evaluation, aggregation, and filtering.

|Home/Software Engineering Fundamentals/Bitkernel
Bitkernel logo
Bitkernel
Oct 24, 2025
mediumSoftware EngineerOnline AssessmentSoftware Engineering Fundamentals
3
0

Consider a SQL query written in SQL-92 style:

SELECT foo, COUNT(foo)
FROM pokes
WHERE foo > 10
GROUP BY foo
HAVING COUNT(foo) > 1
ORDER BY foo;

Which of the following represents the logical order in which the SQL clauses are processed (conceptual evaluation order), according to the SQL-92 standard?

Options:

  • A. FROM → WHERE → GROUP BY → HAVING → SELECT → ORDER BY
  • B. FROM → GROUP BY → WHERE → HAVING → SELECT → ORDER BY
  • C. FROM → WHERE → GROUP BY → HAVING → ORDER BY → SELECT
  • D. FROM → WHERE → ORDER BY → GROUP BY → HAVING → SELECT
Loading comments...