A subquery is a query nested inside another query. Subqueries are useful to data practitioners for scaling and making more powerful queries. The main reason we have subqueries is the need to combine information from multiple tables. Information in a relational database isn’t stored in a single table; it’s shared between several tables.
In this course, you’ll learn various types of subqueries, how to use them, and why they are so valuable: scalar subquery, multi-rows subquery and multi-columns subquery. You’ll also learn how to write common table expressions in SQL.
Best of all, you’ll learn by doing — you’ll practice and get feedback directly in the browser.
- Nesting a query inside another query
- Employing different types of subqueries
- Employing common table expressions
- Scaling your project with complex queries
SQL Subqueries [6 lessons]
The Dataquest guarantee
Dataquest has helped thousands of people start new careers in data. If you put in the work and follow our path, you’ll master data skills and grow your career.
We believe so strongly in our paths that we offer a full satisfaction guarantee. If you complete a career path on Dataquest and aren’t satisfied with your outcome, we’ll give you a refund.