Complex SQL Breakdown (CTEs, Subquery, and More)

Published: 24 May 2023
on channel: Database Star
6,170
190

📝 Get my free SQL Cheat Sheets: https://databasestar.mykajabi.com/lpk...
🎓 Master SQL Fundamentals: https://databasestar.mykajabi.com/sql...

At some point in your SQL journey, you'll come across SQL queries that are more complicated - queries that are long, or contain things like Common Table Expressions, subqueries, and other features.

In this video, we'll start with a complex SQL query, and take small steps to understand what it is doing. We'll add comments along the way, and at the end we'll be able to understand what the whole query is doing.


⏱ TIMESTAMPS:
00:00 - Our complex query
01:37 - Formatting the query
03:22 - Base tables
05:58 - First subquery
08:24 - First CTE
09:53 - Subquery in second CTE
12:28 - The next subquery
15:04 - Second CTE
17:18 - Main query

🔗 VIDEO LINKS:
The query we start with in this video: https://github.com/bbrumm/databasesta...
Sample data for the query: https://github.com/bbrumm/databasesta...


On this page of the site you can watch the video online Complex SQL Breakdown (CTEs, Subquery, and More) with a duration of hours minute second in good quality, which was uploaded by the user Database Star 24 May 2023, share the link with friends and acquaintances, this video has already been watched 6,170 times on youtube and it was liked by 190 viewers. Enjoy your viewing!