Subqueries & CTEs interview questions

18 Subqueries & CTEs questions from the SQL bank, written for Indian campus drives and tech interviews. Every question has a verified answer and an AI-tutor explanation on placd.

Free to start: the 2-minute IT readiness check — six questions and a result.

Take the free IT readiness check

or take a mock interview set up for this area

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

Answer + AI explanation with Pro

2. Which term means: "a query nested inside another, used in SELECT, FROM, or WHERE"?

Mid
  1. A.Subquery
  2. B.Recursive CTE
  3. C.IN vs EXISTS
  4. D.EXISTS

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

5. Which term means: "a subquery that references the outer query and is re-evaluated for each outer row"?

Senior
  1. A.CTE
  2. B.Correlated subquery
  3. C.Recursive CTE
  4. D.Subquery

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

8. Which term means: "a WITH-clause named temporary result set that improves readability and enables recursion"?

Mid
  1. A.Correlated subquery
  2. B.Subquery
  3. C.CTE
  4. D.EXISTS

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

11. Which term means: "a CTE that references itself to traverse hierarchies such as an org chart"?

Senior
  1. A.CTE
  2. B.Recursive CTE
  3. C.Correlated subquery
  4. D.IN vs EXISTS

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

14. Which term means: "tests whether a subquery returns any rows, short-circuiting on the first match"?

Mid
  1. A.CTE
  2. B.Recursive CTE
  3. C.IN vs EXISTS
  4. D.EXISTS

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

17. Which term means: "IN compares against a value list; EXISTS checks row existence and is often faster for large subqueries"?

Senior
  1. A.CTE
  2. B.EXISTS
  3. C.Recursive CTE
  4. D.IN vs EXISTS

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

Free to start

Start with a free readiness check

Sign up free for the 2-minute IT readiness check and a scored result. Answers, explanations and the AI tutor on every Subqueries & CTEs question come with Pro.

Take the free IT readiness check

or take a mock interview set up for this area

24,000+ questions & coding problemsSoftware & IT16,274 questionsGovernment jobs26 examsAptitudenew questions every timeAI practice interviewwith feedback65 topics to practiseMechanical1,149 questionsGATE ME9 papersEngineering Mathematics381 questions2-minute checkfreeDSA Problems1,422Civil1,005 questionsGATE CE9 papersCS Fundamentals1,209 questionsYour scores6 skillsSystem Design25Electrical / EEE1,047 questionsGATE EE9 papersRun your codeC++ · Java · PythonLow-Level Design144Electronics & Comm.975 questionsGATE EC9 papersAI help on every questionFull-Stack6,282Chemical1,005 questionsGATE CH9 papersAI whiteboardsystem designWork abroadEurope · remote · transfersESE ME1 paperGATE practice papers2019–2026ESE CE1 paperDate alertsbefore the last dateESE EE1 paperBehavioural courseHR round practiceESE ET1 paperResume optimizerProSSC JE ME1 paperApplication trackerSSC JE CE1 paperCompany-wise prepSSC JE EE1 paperRole roadmapsRRB JE1 subjectPriced in ₹UPI · cardsISRO SC1 paperGATE CS9 papersIBPS SO IT1 paperUGC NET CS1 paperSSC CGL26 papersIBPS PO26 papersRRB NTPC26 papersSSC CHSL26 papersIBPS Clerk26 papersSBI Clerk26 papersRRB Group D26 papersSSC CPO26 papersSSC GD26 papers