A subquery in the WHERE clause is used to filter records.
The outer query uses the result of the inner query to decide which rows should be selected.
This allows dynamic filtering.
The inner query executes first.
Its result is passed to the WHERE condition of the outer query.
This creates dependent logic.
Subqueries in WHERE clause are commonly used to compare values with calculated results.
This is useful for salary, marks, and score comparisons.
The outer query uses the result returned by the subquery.
This allows SQL to apply conditions dynamically.
This type of query is common in analytics and performance comparison.
Subqueries in WHERE clause are frequently asked in interviews.
They represent advanced SQL thinking.