Write Subqueries in T-SQL

Beginner
Data Analyst
Data Engineer
Data Scientist
Database Administrator
Developer
Solution Architect
Student
Technology Manager
Azure SQL Database
SQL Server
Azure SQL Managed Instance
Azure SQL Server on Virtual Machines
SQL Server on Azure Virtual Machines

Learn how to use subqueries to combine multiple SELECT statements and compose nested queries.

Learning objectives

After completing this module, you will be able to:

  • Understand what subqueries are
  • Use scalar or multi-valued subqueries
  • Use self-contained or correlated subqueries

Prerequisites

Before starting this module, you should have experience of using Transact-SQL SELECT queries to retrieve and filter data from a table in a database.