Transact-SQL (T-SQL) supports writing queries with in queries or nested inside a SELECT, INSERT, UPDATE and DELETE. This lab is divided into five exercises. In the first exercise we will look at self-contained scalar subquery, problems that it can solve and limitations associated with it. In the second exercise we will overcome the limitations of scalar subquery by using multivalued subquery. In the third exercise we will learn about correlated subqueries. Exercise four is for self-assessment where a problem will be given and we have to solve it using subquery. Finally, exercise 5 presents a T-SQL challenge that needs to be solved (T-SQL challenge is slightly tougher self-assessment).
Exercise 1: Self-Contained Scalar Subqueries
Exercise 2: Self-Contained Multivalued Subqueries
Exercise 3: Correlated Subqueries
Exercise 4: Self-Assessment
Exercise 5: T-SQL Challenge