Subqueries & CTEs · Question 3 · Easy

A subquery that returns exactly one row with one column, so it can be used wherever a single value is expected, is called a:

  1. Correlated subquery
  2. Derived table
  3. Common table expression
  4. Scalar subquery
Answer and explanation

Answer: D. Scalar subquery

Explanation: A scalar subquery produces a single value, as in salary > (SELECT AVG(salary) FROM Faculty). A derived table is a subquery in FROM, and a correlated subquery is one that refers to the outer query.

Previous: Table Members: mid | name 1 | Geeta 2 | Hari 3 | Imran 4 | Jaya Table Loans… · Next: Table Faculty: fid | name | dept | salary 1 | Anand | CSE | 90000 2 | Bhavna |…

Practise subqueries & ctes

Try a fresh set of subqueries & ctes questions with an explanation after every answer, free and without signing up: Subqueries & CTEs practice. Or sit a full placement mock test.

More subqueries & ctes questions

More sql practice

Window Functions · NULL Handling · SQL Functions & CASE · UNION, INTERSECT & EXCEPT · Tables, Keys & Constraints · DML & Transactions · SELECT, WHERE & ORDER BY · SQL Joins

LogicWiz Exams home · All practice topics · Placement mock tests · Daily 10 challenge