Subqueries & CTEs interview questions

18 real Subqueries & CTEs questions from the SQL bank, as asked in Indian campus drives and tech interviews. Every question has a verified answer and an AI-tutor explanation on placd — free to start.

1. What is Subquery?

Mid
  1. A.a WITH-clause named temporary result set that improves readability and enables recursion
  2. B.tests whether a subquery returns any rows, short-circuiting on the first match
  3. C.a CTE that references itself to traverse hierarchies such as an org chart
  4. D.a query nested inside another, used in SELECT, FROM, or WHERE
Reveal the answer + AI explanation — free account

3. Which statement is correct?

Mid
  1. A.Subquery — a subquery that references the outer query and is re-evaluated for each outer row
  2. B.Subquery — tests whether a subquery returns any rows, short-circuiting on the first match
  3. C.Subquery — a CTE that references itself to traverse hierarchies such as an org chart
  4. D.Subquery — a query nested inside another, used in SELECT, FROM, or WHERE
Reveal the answer + AI explanation — free account

4. What is Correlated subquery?

Senior
  1. A.a CTE that references itself to traverse hierarchies such as an org chart
  2. B.a WITH-clause named temporary result set that improves readability and enables recursion
  3. C.tests whether a subquery returns any rows, short-circuiting on the first match
  4. D.a subquery that references the outer query and is re-evaluated for each outer row
Reveal the answer + AI explanation — free account

6. Which statement is correct?

Senior
  1. A.Correlated subquery — a query nested inside another, used in SELECT, FROM, or WHERE
  2. B.Correlated subquery — a subquery that references the outer query and is re-evaluated for each outer row
  3. C.Correlated subquery — a WITH-clause named temporary result set that improves readability and enables recursion
  4. D.Correlated subquery — tests whether a subquery returns any rows, short-circuiting on the first match
Reveal the answer + AI explanation — free account

7. What is CTE?

Mid
  1. A.a query nested inside another, used in SELECT, FROM, or WHERE
  2. B.a WITH-clause named temporary result set that improves readability and enables recursion
  3. C.a subquery that references the outer query and is re-evaluated for each outer row
  4. D.IN compares against a value list; EXISTS checks row existence and is often faster for large subqueries
Reveal the answer + AI explanation — free account

9. Which statement is correct?

Mid
  1. A.CTE — tests whether a subquery returns any rows, short-circuiting on the first match
  2. B.CTE — IN compares against a value list; EXISTS checks row existence and is often faster for large subqueries
  3. C.CTE — a WITH-clause named temporary result set that improves readability and enables recursion
  4. D.CTE — a subquery that references the outer query and is re-evaluated for each outer row
Reveal the answer + AI explanation — free account

10. What is Recursive CTE?

Senior
  1. A.a subquery that references the outer query and is re-evaluated for each outer row
  2. B.a WITH-clause named temporary result set that improves readability and enables recursion
  3. C.IN compares against a value list; EXISTS checks row existence and is often faster for large subqueries
  4. D.a CTE that references itself to traverse hierarchies such as an org chart
Reveal the answer + AI explanation — free account

12. Which statement is correct?

Senior
  1. A.Recursive CTE — a subquery that references the outer query and is re-evaluated for each outer row
  2. B.Recursive CTE — a CTE that references itself to traverse hierarchies such as an org chart
  3. C.Recursive CTE — a query nested inside another, used in SELECT, FROM, or WHERE
  4. D.Recursive CTE — a WITH-clause named temporary result set that improves readability and enables recursion
Reveal the answer + AI explanation — free account

13. What is EXISTS?

Mid
  1. A.IN compares against a value list; EXISTS checks row existence and is often faster for large subqueries
  2. B.a WITH-clause named temporary result set that improves readability and enables recursion
  3. C.tests whether a subquery returns any rows, short-circuiting on the first match
  4. D.a subquery that references the outer query and is re-evaluated for each outer row
Reveal the answer + AI explanation — free account

15. Which statement is correct?

Mid
  1. A.EXISTS — tests whether a subquery returns any rows, short-circuiting on the first match
  2. B.EXISTS — a query nested inside another, used in SELECT, FROM, or WHERE
  3. C.EXISTS — IN compares against a value list; EXISTS checks row existence and is often faster for large subqueries
  4. D.EXISTS — a WITH-clause named temporary result set that improves readability and enables recursion
Reveal the answer + AI explanation — free account

16. What is IN vs EXISTS?

Senior
  1. A.tests whether a subquery returns any rows, short-circuiting on the first match
  2. B.a subquery that references the outer query and is re-evaluated for each outer row
  3. C.IN compares against a value list; EXISTS checks row existence and is often faster for large subqueries
  4. D.a WITH-clause named temporary result set that improves readability and enables recursion
Reveal the answer + AI explanation — free account

18. Which statement is correct?

Senior
  1. A.IN vs EXISTS — a subquery that references the outer query and is re-evaluated for each outer row
  2. B.IN vs EXISTS — IN compares against a value list; EXISTS checks row existence and is often faster for large subqueries
  3. C.IN vs EXISTS — tests whether a subquery returns any rows, short-circuiting on the first match
  4. D.IN vs EXISTS — a WITH-clause named temporary result set that improves readability and enables recursion
Reveal the answer + AI explanation — free account

Free to start

Answers, AI explanations, and a scored voice mock interview

Sign up free to check your answers with explanations, ask the AI tutor anything on any question, and take one full AI mock interview — scored like a real panel.

Practice Subqueries & CTEs free