scalar subqueries

Scalar Subquery

Scalar Subquery

A subquery in the SELECT clause of the main query is called a scalar subquery. This is a single row, single column query, which looks just like a column or function in the SELECT clause. The structure is:

Read the Full Article →
Thumbnail image for Correlated Subquery

Correlated Subquery

A correlated subquery is a type of nested subquery that uses columns from the outer query in its WHERE clause. For example, a query to list employees whose salary is more than their department’s average:

Read the Full Article →
Subqueries and Their Types

Understanding Subqueries and Their Types

A subquery is – to put it simply – a query within a query. What purpose does a subquery serve? A subquery may be needed when it takes more than a single step to reach the answer. Suppose we need to find all employees who work in the same department as KING. We need to:

Read the Full Article →