Mate you clarified something for me, I was wondering why I always had to add every other column I had to group by :) plenty helpful keep up the great tutorials!😃
I'm preparing for DP-900 exam and I was having a hard time with the Group By statement and aggregate functions. This video has helped me understand it perfectly. Thanks! Subscribed.
Clear cut explanation, i always had doubt why we need to group by column which we used in select statement when we use aggregate functions in select, now its so clear. Thanks for the help
This was helpful and clear, thank you! I liked your group by question, because I tend to create a question like that when I'm struggling to formulate the correct query.
To be honest i was really confused because i get it what it does i just dont know how does it influences the answer. Like what the hell😭 And why is it almost the last one??
Good question. It's because the word COUNT is a function, and functions need to have brackets at the end of the name so they can run. Inside the brackets for functions, we specify parameters, such as values or columns to be processed by the function. The COUNT function can count columns: for example, COUNT(first_name) counts the number of first_name values that are not NULL. The asterisk is a different parameter to the COUNT function, and it means "count the entire row". So, COUNT(*) means count the entire row. Hope that answers your question.
My only question is if you have 3 columns in the Select Statement with an aggregate function, for example, is it mandatory to always include all 3 columns in the group by clause? And if not, then how do we know which of the 3 columns must be included?
Good question. Yes, it's mandatory to include all three columns in the Group By clause. If you don't, you'll get an error about columns in the Select not in the Group By (the exact error will depend on the database vendor). The only exception is some versions of MySQL allow you to have a mismatch between the Group By and the Select. But you'll get a result that won't be correct, such as showing the first group only but the aggregate function on all rows.
Want to easily remember the SQL commands for your database? Get my free SQL Cheat Sheets here: databasestar.mykajabi.com/lpkj-sql-cheat-sheets/?
I don't usually comment on tutorial videos, but this video is so clear I just want you to know how helpful you are for beginners like me
Glad it was helpful!
Mate you clarified something for me, I was wondering why I always had to add every other column I had to group by :) plenty helpful keep up the great tutorials!😃
Glad it helped you understand the concept further!
I'm preparing for DP-900 exam and I was having a hard time with the Group By statement and aggregate functions. This video has helped me understand it perfectly. Thanks! Subscribed.
Thanks! I'm glad the video helped you understand it.
you are definitely a database star. Thank you
Thanks!
thanks sooooo much dude
i NEVER wrapped my head around how this works
now i am crystal clear :)
Awesome, good to hear!
your explanations resonates with me on a deep level.
This makes me happy. I’m glad the explanations help you!
What a clean and easy way of explaining the fact. Thank you SIR.
You're welcome!
Clear cut explanation, i always had doubt why we need to group by column which we used in select statement when we use aggregate functions in select, now its so clear. Thanks for the help
Glad it was helpful!
This was helpful and clear, thank you! I liked your group by question, because I tend to create a question like that when I'm struggling to formulate the correct query.
Glad it was helpful!
Your SQL video was exactly what I needed. Thank you for explaining it so clearly. 😄🎬💻🔍
Thanks, glad you liked it!
Very well explained. Aggregated function was helpful to me. Thank you
Glad it was helpful!
10/10 explanation. Very simple.
Thanks, glad you found it helpful!
Thanks for actually explaining it.
You’re welcome!
Thank you for explaining it in such a simple way :)
You're very welcome!
that waaaaas veeeeery helpful thaaaaaank you
You're welcome!
Super helpful. First slide's visual really helped...
Glad you liked it!
awesome most easiest explanation. Thanks man
Glad it helped!
Great explanation 💯🤍🤍🤍
Thanks!
Thank you for this very useful video!
No problem, glad you liked it!
Nice video! Your indentation hurts me, but thank you for this video; It is very well presented!
Thanks! Do you prefer a different style of indentation for SQL code?
Good to know, most important part was that the field selected should be in the group by clause. THey completely left that out in class
Glad you liked the video. Can’t believe they left that out of your class!
@@DatabaseStar It was a very rushed class tbh. Teaching finished at the beginning of November so I'm self-studying for finals😅😅
👋 Bravo!
A very well-explained demo!
Thanks!
@@DatabaseStar....... You're very welcome!
Can you please make a crash course about "MySQL for Advanced Data Analytics"?
Cheers boss, I knew I had to use Group By but I didn't fully understand why.
Thanks, glad it was helpful!
real good video, thank you!
You’re welcome!
very detailed. clear. beautiful
thanks ALOT
really helpful
Glad it was helpful!
😂 nobody understand group by
It can be hard to understand
To be honest i was really confused because i get it what it does i just dont know how does it influences the answer. Like what the hell😭 And why is it almost the last one??
1:18 why do we need the parenthesis around the asterisk in the SELECT FROM statement?
Good question. It's because the word COUNT is a function, and functions need to have brackets at the end of the name so they can run.
Inside the brackets for functions, we specify parameters, such as values or columns to be processed by the function.
The COUNT function can count columns: for example, COUNT(first_name) counts the number of first_name values that are not NULL.
The asterisk is a different parameter to the COUNT function, and it means "count the entire row". So, COUNT(*) means count the entire row.
Hope that answers your question.
@@DatabaseStar got it, SO VERY helpful
i don't know how i'll remember all of this 🤦🏾♀️
Sir can we use order by with sum, count, avg at the end?
Like....order by sum(*) desc limit 3, plz clarify.
very helpful; thank you!
Thanks!
Excellent video !
Glad you liked it!
Thank you very much
You’re welcome!
thanks it really helped
Glad it helped!
Thank you 👍
No worries!
thank you.
You're welcome
Very good information
Thanks!
Can you please give an example with two tables that have many to many relationships
Good idea, I can do that.
Thanks for that.
Glad it was helpful!
thax
You're welcome
Thanks
No problem!
My only question is if you have 3 columns in the Select Statement with an aggregate function, for example, is it mandatory to always include all 3 columns in the group by clause? And if not, then how do we know which of the 3 columns must be included?
Good question. Yes, it's mandatory to include all three columns in the Group By clause. If you don't, you'll get an error about columns in the Select not in the Group By (the exact error will depend on the database vendor).
The only exception is some versions of MySQL allow you to have a mismatch between the Group By and the Select. But you'll get a result that won't be correct, such as showing the first group only but the aggregate function on all rows.
@@DatabaseStar Thanks for the awesome reply! I just subscribed.
I honestly gonna die with this language :")
Hahah
🙌
Thanks!
Can you t sql vedios
Sure I can make TSQL videos.