Complex SQL Query Breakdown Step By Step

Опубликовано: 16 October 2024
на канале: Database Star
16,374
447

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

When you work with SQL you may come across a query that seems quite complex. It could have many tables and joins, many columns, functions, subqueries, and more features you may or may not have heard of.

In this video, I'll show you how to understand a complex query. We will
start with a complex SQL query
improve the formatting of it
create a diagram of the tables and columns
run parts of the query
add comments
At the end of this process, we'll be able to understand and describe what the query does.

You can follow this kind of process for your own complex query.

⏱ TIMESTAMPS:
00:00 Intro
00:40 Our query
01:31 Formatting the query
02:51 Create a diagram
09:46 View the table data
11:01 Run subqueries
12:38 Add comments
13:38 Run the main query

🔗 VIDEO LINKS:
Sample SQL: https://github.com/bbrumm/databasesta...