Theoretically, Both subqueries and CTEs should have similar performance. SQL Database should be executing both with a similar execute plan. Which one do you prefer to use? Have you had a scenario where either Subquery or CTE had a better performance over other? Please do let us know in the comments below!
Thanks for this great video. I prefer CTEs. If someone who is relatively new to SQL, there is a chance that they won't understand a subquery as they would a CTE, especially when they are nested. You may not even know which part runs first. In subquery, you still have to give the query a name even though such name will not be used unlike CTE. It's important to state that any newly generated column in CTE OR subquery must be given an alias for it to run as well.
Theoretically, Both subqueries and CTEs should have similar performance.
SQL Database should be executing both with a similar execute plan.
Which one do you prefer to use?
Have you had a scenario where either Subquery or CTE had a better performance over other?
Please do let us know in the comments below!
Thanks for this great video. I prefer CTEs. If someone who is relatively new to SQL, there is a chance that they won't understand a subquery as they would a CTE, especially when they are nested. You may not even know which part runs first. In subquery, you still have to give the query a name even though such name will not be used unlike CTE. It's important to state that any newly generated column in CTE OR subquery must be given an alias for it to run as well.
Thank you for sharing
As long as both cte and nested do the same which is preferable in terms of performance?
Theoretically no difference. CTEs are just more readable.
Nice explanation. Thank you
Thank you, I followed along with Adventure Works SQL practice DB.
Thank you
Execute plan
Great tutorial, thank you
Glad it was helpful!
You speak like fast bowler if you don't mind can speak like spin bowler to better understand
I just join one organization as Role Sql Server Developer,
Mam your video is very helpful for getting my job.
Thanks mam. ❤
Keep going on
Many congratulations for your new job ! So glad our videos were helpful. Best wishes to you!
@@LearnatKnowstar thanks mam