Complex SQL Query Breakdown Step By Step

preview_player
Показать описание

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:
Рекомендации по теме
Комментарии
Автор

I'm self-taught in SQL, and I use simple queries because that's all I need to achieve my goals. But I've missed this kind of explanation in my past when I googled tutorials that were faintly intelligible and confusing. Been subscribed for a while now and have watched a couple dozen of your videos. Thanks for your work!

maxyudin
Автор

I have to say that your explanations are clear and informative, well-organized. Thank you. You've helped break a difficult subject into bite-sized pieces I can handle.

baruchben-david
Автор

Fantastic tutorial, it's really helpful to understand how to break down the subqueries and visualize each table/column

WestCoastKop
Автор

Please create a complex query using CTE's and Window functions with aggregate data (i.e. quarterly revenue, quarterly sales, etc)

adamlibertini
Автор

Brilliant explanation, thank you. I have recently started getting more invested in understanding data and how SQL works to aid that journey. Complex queries have till now intimidated me, but your explanation made perfect sense and is actually a logical yet simple way to decompose a complex query to its constituent parts. Thank you indeed. I was thinking of using a UML diagram to replace your diagram boxes as then I can see the structure clearer.

kvanniekerk
Автор

Thank you for all your videos!! I thoroughly enjoy them

punkyM
Автор

Kindly make more videoa like this... thanks in advance.

attaullahkhan
Автор

The main Summing sum(ss.ts), sum(ss.tas) ... series are of no use as they are grouped by content id and only one content id is there per college_id, like a one to one mapping so there is no 2 content id to get another sum in the main query apart from the summation of total submission or views and the summation. Also the condition sum(ss.ts) <> 0 ... series is not needed instead we can say ss.ts <>0... ... as ts, tas, tv, tuv all already represents sum of total submission or views. Please let me know if my understanding is correct.

karthikbala
Автор

I was looking for something like this. This really helps. Thanks.
Is it possible to do one with the with clause and unions and joins all together.

kumarmv-lorm
Автор

Its all about ... sets of all sets ... that doesnt contain themselves.

rustyspottedcat
Автор

very important content but sound is so low... plz have a look. ty

Learn_IT_with_Azizul
Автор

Sir, when i am exporting data i couldn't see the ongoing exporting details in Oracle SQL developer like how many rows exporting is going on like this and how to enable this, please help me

cute_stories_official
Автор

I have a doubt. I have table with two fields, one field is array in table 1
uID | Contact
2 | 1221, 1223
3 | 1123

Now value of 1221 and 1223 are in table Two. I want a query to join table 1 and table 2 using array of field2

KUMAR-qoq
Автор

i just started learning sql, i want to ask when should i use procedure ?

ai-ools
join shbcf.ru