Back to Browse

When to Use a Subquery in SQL

55.2K views
Apr 12, 2022
8:49

📝 Get my free SQL Cheat Sheets: https://databasestar.mykajabi.com/lpkj-sql-cheat-sheets/?video=tlvxb7UduJw 🎓 Master SQL Fundamentals: https://databasestar.mykajabi.com/sql-simplified/?video=tlvxb7UduJw How do you know when to use a subquery? Subqueries in SQL are a handy feature that let you use the results of one query as input into another query. They can simplify your query and make it easier to maintain. But how do you know when to use a subquery instead of other methods, such as joins? In this video, you’ll learn what a subquery is, when you should use a subquery, a simple example of a query, and transforming it to use a subquery to solve a problem. You’ll also see when you should use a subquery or a join, as well as several other tips for working with SQL subqueries. Timestamps: 00:00 What you’ll learn in this video 00:34 When you should use a subquery 01:41 A step-by-step example without a subquery 03:56 Using a subquery 05:06 Subquery vs join 06:43 Tips for working with subqueries

Download

1 formats

Video Formats

360pmp410.0 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

When to Use a Subquery in SQL | NatokHD