Back to course home
0% completed
Vote For New Content
Types of Subqueries
Subqueries can be categorized based on where they appear in an SQL statement and their purpose. They are categorized as,
- Nested Scalar Subquery
- Single-Row Subquery
- Multiple-Row Subquery
- Single-Column Subquery
- Correlated Subquery
Example Data
The given table will be used for the demonstration of subtypes of nested queries.
1. Nested Scalar Subquery
A Nested Scalar Subquery returns a single value and is often used in a comparison. In this example, we retrieve the student_name
where the student_id
is the maximum.
Query
SELECT student_name FROM students
.....
.....
.....
Like the course? Get enrolled and start learning!
On this page