Тёмный

SQL WITH Statements (Common Table Expressions - CTE) 

Becoming a Data Scientist
Подписаться 22 тыс.
Просмотров 95 тыс.
50% 1

Step-by-step tutorial shows you how to use the WITH statement in SQL to create Common Table Expressions (CTE)!
Watch the Subquery video: • How to do Subqueries i...
Get the Northwind Database: • How to Load a Sample P...
Support the Channel:
1) Subscribe: www.becomingads.com/o/youtube
2) DataCamp:
3) Udacity:

Наука

Опубликовано:

 

8 фев 2020

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 77   
@vikrantyoung4868
@vikrantyoung4868 2 года назад
Simple and easy to understand explanation. It really made understanding the WITH statement so simpler. Thanks much.
@salsaica2
@salsaica2 Год назад
Thank you for the video, very clear, I like the format, it's straightforward and very well explained!
@jude3026
@jude3026 3 года назад
U ROCK. im going through your channel and god you couldnt get less helpful. thanks man
@lalifali8426
@lalifali8426 3 года назад
You explained it so well and fast I'm now fully prepared for what may come
@Tushelek
@Tushelek Год назад
Thanks, mate! Your explanation is very easy to understand.
@roodyg5352
@roodyg5352 6 месяцев назад
Thank you! This video helped me understand CTEs a little bit better.
@jundolor4013
@jundolor4013 2 года назад
Great video! This helped me run a complex query at work. Thanks 😀
@Findawaytomak3it
@Findawaytomak3it 4 месяца назад
Dude! thank you for taking the time to break down cte's simplified (subquery >> cte). Bro, you rock!!! 😎🤟
@RodrigoCruz-iz3kb
@RodrigoCruz-iz3kb 3 года назад
Your video helped me a lot, thank You my friend!
@danielmejia8530
@danielmejia8530 3 года назад
Nice man! subscribing.... Greetings from Colombia!
@atothezeezee
@atothezeezee 4 года назад
This was excellent - thank you.
@ukaszk.8305
@ukaszk.8305 3 года назад
You are a sensation! Please, keep going :)
@marcinbednarz9488
@marcinbednarz9488 2 года назад
Hi Nathan, thanks for explaining me CTE Objects. It's know very clear to me. Appriciate
@snipezu805
@snipezu805 2 года назад
Thanks, easy and straight forward!
@manideepgupta2433
@manideepgupta2433 3 года назад
Finally!! Whoa! Thanks man.
@gomojo1024
@gomojo1024 10 месяцев назад
Thanks! Liked, Commented and Subscribed!
@ericsims3368
@ericsims3368 3 года назад
Super helpful - thanks a bunch!
@jasonwalker4155
@jasonwalker4155 3 года назад
ahhh That makes it much clearer. Thank you!
@zhiyizhang9102
@zhiyizhang9102 3 года назад
great example and explanation!
@meanpillscasper
@meanpillscasper 2 года назад
Just a small correction, using the with statement makes indeed things easier to read and debug but the program won't be any faster. It's just a thing you should do to help other humans understand your code.
@josemarino4270
@josemarino4270 2 года назад
Sweet and simple: thanks!
@higiniofuentes2551
@higiniofuentes2551 2 года назад
Thank you for this very useful video!
@amberjones6191
@amberjones6191 3 года назад
That was super helpful!
@123arskas
@123arskas 11 дней назад
Thank you. It was wonderful explanation
@daniellakshan
@daniellakshan 4 года назад
thanks bro, you saved a lot of time
@user-dc7oj3el7o
@user-dc7oj3el7o Год назад
Best explanation ever!! 👍
@oualidben5660
@oualidben5660 3 года назад
Very clear, Thank You Sir !
@moisefonguendegue5078
@moisefonguendegue5078 3 года назад
Good explanation. God bless you. AMEN.
@hereandnow8578
@hereandnow8578 3 года назад
clear and concise. ty
@amare_._
@amare_._ 3 года назад
This is clearer than my textbook explanation lol thanks for the video!
@ghinwamoujaes9059
@ghinwamoujaes9059 3 года назад
This is great!
@ChrisShepperd
@ChrisShepperd 2 года назад
The way you describe what cte's are made all the difference. It's so simple when you know yhe why for the how.
@user-bx8ow4xg6h
@user-bx8ow4xg6h 3 месяца назад
Thanks a lot for simple explanation
@mikesizemore5939
@mikesizemore5939 2 года назад
Great video!
@waldojams
@waldojams 3 года назад
Thanks for the video. I was looking for more info about caching, but noticed (after some reading) that the caching doesn't happen because of the CTE, but instead, it's decided arbitrarily by Postgres. So for instance, either doing subqueries or CTEs might result in the same performance in the end, even though CTEs makes code more readable.
@vitalykolesov9434
@vitalykolesov9434 3 года назад
Hvala puno!
@shujaatali4728
@shujaatali4728 2 года назад
Nice video, thank you
@alexg97343
@alexg97343 Год назад
Great explanation
@BilalAli-gr3ry
@BilalAli-gr3ry Год назад
Very helpful..... Love from India
@soseofficial3923
@soseofficial3923 2 года назад
thankyou sir, it really helped me.
@factorise001
@factorise001 2 года назад
hats off!!
@alecdelu83
@alecdelu83 3 года назад
Thanks!
@tauseef_khawaja
@tauseef_khawaja Год назад
conceptual and easy way to describe
@deepakms5918
@deepakms5918 2 года назад
Super sir 👍👍👍
@jilliansolomon1178
@jilliansolomon1178 3 года назад
Thankful for your videos - super helpful! Do you have to use a GROUP BY clause when using CTE's?
@houstonfirefox
@houstonfirefox Год назад
It's not a requirement but you certainly could
@andyn6053
@andyn6053 3 года назад
what is the difference between cte:s and temp tables? temp tables are only stored temporarly and cant be accessed as an cte?
@tamaramattson4768
@tamaramattson4768 2 месяца назад
How can I union two cte together, there is one sum on a budget, column are exactly the same I have group by , send me video please
@larryhatcher8927
@larryhatcher8927 2 года назад
I've been studying SQL now for about 6 months....I think the CTEs are really a good place to start but the more knowledge you gain the more you tend to move away from them and use subqueries
@houstonfirefox
@houstonfirefox Год назад
Congrats on your learning Larry. Like all tools, CTEs, subqueries and cursors all have their appropriate use cases. While it is true that you could program almost everything using subqueries, other methods (such as CTEs) could be used as well to make your code easier to follow for those coming behind you to maintain it. Like a painting, everyone has their own style and choice of tools 😉
@yeoshuabenzaken7736
@yeoshuabenzaken7736 6 месяцев назад
in the 3rd example nothing changed when you joined another cte. So why did you join them?
@crotteverte7496
@crotteverte7496 Год назад
3:29 is the main purpose of CTE : OPTIMISATION An EXPLAIN of both syntaxe would have revealed it. Over code simplification, when you need to interprete subqueries results CTEs are way faster than subqueries since de BDD engine build the CTE result (in bdd server memory not cloud lol) ONCE en start with it for interpretation.
@haramrit09k
@haramrit09k 3 года назад
Definitely helpful! Thank you for this. Can you also do a video on recursive CTEs?
@anthonyedison2388
@anthonyedison2388 3 года назад
i know Im kinda off topic but does anyone know a good site to watch new movies online?
@kamerondeacon3657
@kamerondeacon3657 3 года назад
@Anthony Edison I use FlixZone. Just google for it =)
@jaxonatlas1592
@jaxonatlas1592 3 года назад
@Kameron Deacon yea, I've been watching on FlixZone for since april myself =)
@anthonyedison2388
@anthonyedison2388 3 года назад
@Kameron Deacon thanks, I signed up and it seems to work =) I really appreciate it !
@kamerondeacon3657
@kamerondeacon3657 3 года назад
@Anthony Edison happy to help xD
@Lashistoriasdelilith
@Lashistoriasdelilith Месяц назад
I don't understand what the ctdorders have inside...
@sheenabian9368
@sheenabian9368 Год назад
and, boom!
@mabblers
@mabblers 3 года назад
Excellent explanation . How dose work when you're working with 10 tables and 5 has millions of records in them? Is this viable considering this is all done in memory? Thanks
@houstonfirefox
@houstonfirefox Год назад
In most database systems, the 'name' of the CTE simply references an internal temporary table that is invisible to you (unless you select from it). So, in effect, the results of the CTE will create a temporary table behind the scenes in order to hold the results of the CTE. It is deleted automatically when you go out of scope of the CTE.
@VeronicaAngryPolak
@VeronicaAngryPolak Год назад
why did you use "using" in your join statement and not "on"?
@hasanmougharbel8030
@hasanmougharbel8030 Год назад
hello there, god bless your efforts..I have a simple enquiry as new sql learner. How are CTEs different from temporary tables? Thanks for taking care of this.
@houstonfirefox
@houstonfirefox Год назад
A temporary table will exist during the entire duration of the session whereas a CTE is a "named result set" that exists for the duration of the statement immediately following it. If you would like to persist the results of the CTE, then use the CTE to populate a temporary table for processing later. Hope this clears things up
@superfreiheit1
@superfreiheit1 2 года назад
Why the pc screen is so blurred?
@TheCazz10
@TheCazz10 2 года назад
I didn't think CTE's are stored anywhere... temp tables are
@smz3610
@smz3610 2 года назад
You have a crypto channel too?! I have seen your YF vids
@adridesu1
@adridesu1 5 месяцев назад
I don't see the point of using WITH for a single query. If you would use the same WITH for multiple queries, I can understand how it helps.
@christiangrundemann9843
@christiangrundemann9843 3 года назад
why no disclaimer to be careful/avoid using temp tables
@paradix847
@paradix847 3 года назад
Could you elaborate on why one should be careful using temp tables?
@christiangrundemann9843
@christiangrundemann9843 3 года назад
@@paradix847 scope, memory and performance issues. if a temp table isn’t dropped and the client makes another request to the server, the temp table that was not disposed correctly can throw ambiguous errors
@paradix847
@paradix847 3 года назад
@@christiangrundemann9843 Hey that's good to have in mind. Thanks for the explanation.
@gotchihaeyo1825
@gotchihaeyo1825 Год назад
Cte isn't tepm table. It works like a temp table. That's what I know. So no disclaimer.
@hari7027
@hari7027 2 месяца назад
Can I pass list of acctnumbers in with and it will traverse through each one of them to fetch acctid from diff table
@lightoficeberg
@lightoficeberg 3 года назад
Thanks! That was very helpful :)
Далее
Writing CASE WHEN Statements in SQL (IF/THEN)
5:50
Просмотров 85 тыс.
How to do Subqueries in SQL with Examples
8:20
Просмотров 166 тыс.
SQL Index |¦| Indexes in SQL |¦| Database Index
9:57
Solving real world data science tasks with Python Pandas!
1:26:07
Database Indexing for Dumb Developers
15:59
Просмотров 48 тыс.
iPhone socket cleaning #Fixit
0:30
Просмотров 17 млн
НОВЫЕ ФЕЙК iPHONE 🤯 #iphone
0:37
Просмотров 331 тыс.
iPhone socket cleaning #Fixit
0:30
Просмотров 17 млн