SQL Group By: An Explanation and How To Use It

  Рет қаралды 85,620

Database Star

Database Star

Күн бұрын

Пікірлер: 86
@goobygoobdisney
@goobygoobdisney Жыл бұрын
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
@DatabaseStar
@DatabaseStar Жыл бұрын
Glad it was helpful!
@rickvazquez6578
@rickvazquez6578 2 жыл бұрын
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!😃
@DatabaseStar
@DatabaseStar 2 жыл бұрын
Glad it helped you understand the concept further!
@sebastianhernandez9631
@sebastianhernandez9631 10 ай бұрын
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.
@DatabaseStar
@DatabaseStar 10 ай бұрын
Thanks! I'm glad the video helped you understand it.
@rjjalaparthi545
@rjjalaparthi545 Күн бұрын
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
@DatabaseStar
@DatabaseStar Күн бұрын
Glad it was helpful!
@manojkumar-yc4xq
@manojkumar-yc4xq 3 ай бұрын
What a clean and easy way of explaining the fact. Thank you SIR.
@DatabaseStar
@DatabaseStar 3 ай бұрын
You're welcome!
@user-iv9sh9fc3c
@user-iv9sh9fc3c 4 ай бұрын
you are definitely a database star. Thank you
@DatabaseStar
@DatabaseStar 4 ай бұрын
Thanks!
@ordinaryperson-my7qr
@ordinaryperson-my7qr Жыл бұрын
thanks sooooo much dude i NEVER wrapped my head around how this works now i am crystal clear :)
@DatabaseStar
@DatabaseStar Жыл бұрын
Awesome, good to hear!
@lexiwhitmore2197
@lexiwhitmore2197 Жыл бұрын
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.
@DatabaseStar
@DatabaseStar Жыл бұрын
Glad it was helpful!
@COOKINGBIRD
@COOKINGBIRD Жыл бұрын
Your SQL video was exactly what I needed. Thank you for explaining it so clearly. 😄🎬💻🔍
@DatabaseStar
@DatabaseStar Жыл бұрын
Thanks, glad you liked it!
@akanirokingsley3304
@akanirokingsley3304 5 ай бұрын
your explanations resonates with me on a deep level.
@DatabaseStar
@DatabaseStar 5 ай бұрын
This makes me happy. I’m glad the explanations help you!
@khawar1690
@khawar1690 4 ай бұрын
Very well explained. Aggregated function was helpful to me. Thank you
@DatabaseStar
@DatabaseStar 4 ай бұрын
Glad it was helpful!
@diamondsandlipgloss
@diamondsandlipgloss 2 ай бұрын
1:18 why do we need the parenthesis around the asterisk in the SELECT FROM statement?
@DatabaseStar
@DatabaseStar 2 ай бұрын
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.
@diamondsandlipgloss
@diamondsandlipgloss 2 ай бұрын
@@DatabaseStar got it, SO VERY helpful i don't know how i'll remember all of this 🤦🏾‍♀️
@thebigcheese1153
@thebigcheese1153 5 ай бұрын
Thanks for actually explaining it.
@DatabaseStar
@DatabaseStar 5 ай бұрын
You’re welcome!
@aashutosh937
@aashutosh937 Жыл бұрын
Thank you for explaining it in such a simple way :)
@DatabaseStar
@DatabaseStar Жыл бұрын
You're very welcome!
@bot299i82
@bot299i82 3 ай бұрын
😂 nobody understand group by
@DatabaseStar
@DatabaseStar 3 ай бұрын
It can be hard to understand
@DCh-ks6ug
@DCh-ks6ug 6 ай бұрын
that waaaaas veeeeery helpful thaaaaaank you
@DatabaseStar
@DatabaseStar 6 ай бұрын
You're welcome!
@nickjoseph2711
@nickjoseph2711 2 жыл бұрын
Super helpful. First slide's visual really helped...
@DatabaseStar
@DatabaseStar 2 жыл бұрын
Glad you liked it!
@Aliyaaugust
@Aliyaaugust 3 ай бұрын
Great explanation 💯🤍🤍🤍
@DatabaseStar
@DatabaseStar 3 ай бұрын
Thanks!
@jatinsharma8353
@jatinsharma8353 Жыл бұрын
awesome most easiest explanation. Thanks man
@DatabaseStar
@DatabaseStar Жыл бұрын
Glad it helped!
@tsunamio7750
@tsunamio7750 8 ай бұрын
Nice video! Your indentation hurts me, but thank you for this video; It is very well presented!
@DatabaseStar
@DatabaseStar 8 ай бұрын
Thanks! Do you prefer a different style of indentation for SQL code?
@mrjump6745
@mrjump6745 Жыл бұрын
very detailed. clear. beautiful thanks ALOT really helpful
@DatabaseStar
@DatabaseStar Жыл бұрын
Glad it was helpful!
@higiniofuentes2551
@higiniofuentes2551 11 ай бұрын
Thank you for this very useful video!
@DatabaseStar
@DatabaseStar 11 ай бұрын
No problem, glad you liked it!
@douaz6905
@douaz6905 18 күн бұрын
Thank you very much
@DatabaseStar
@DatabaseStar 18 күн бұрын
You’re welcome!
@leonsant-jennings7417
@leonsant-jennings7417 Жыл бұрын
Cheers boss, I knew I had to use Group By but I didn't fully understand why.
@DatabaseStar
@DatabaseStar Жыл бұрын
Thanks, glad it was helpful!
@mustaphaelouahabi9316
@mustaphaelouahabi9316 Жыл бұрын
👋 Bravo! A very well-explained demo!
@DatabaseStar
@DatabaseStar Жыл бұрын
Thanks!
@mustaphaelouahabi9316
@mustaphaelouahabi9316 Жыл бұрын
@@DatabaseStar....... You're very welcome! Can you please make a crash course about "MySQL for Advanced Data Analytics"?
@Mike-vj8do
@Mike-vj8do 10 ай бұрын
real good video, thank you!
@DatabaseStar
@DatabaseStar 10 ай бұрын
You’re welcome!
@dragoneer8756
@dragoneer8756 9 ай бұрын
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
@DatabaseStar
@DatabaseStar 9 ай бұрын
Glad you liked the video. Can’t believe they left that out of your class!
@dragoneer8756
@dragoneer8756 9 ай бұрын
@@DatabaseStar It was a very rushed class tbh. Teaching finished at the beginning of November so I'm self-studying for finals😅😅
@salmaa7810
@salmaa7810 Жыл бұрын
very helpful; thank you!
@DatabaseStar
@DatabaseStar Жыл бұрын
Thanks!
@SpringRain23
@SpringRain23 Жыл бұрын
Excellent video !
@DatabaseStar
@DatabaseStar Жыл бұрын
Glad you liked it!
@arvindt553
@arvindt553 7 ай бұрын
Can you please give an example with two tables that have many to many relationships
@DatabaseStar
@DatabaseStar 7 ай бұрын
Good idea, I can do that.
@user-vz7qd1br5o
@user-vz7qd1br5o 6 ай бұрын
thank you.
@DatabaseStar
@DatabaseStar 6 ай бұрын
You're welcome
@mostafa2199
@mostafa2199 2 жыл бұрын
thanks it really helped
@DatabaseStar
@DatabaseStar 2 жыл бұрын
Glad it helped!
@Entertainmentmod
@Entertainmentmod 2 жыл бұрын
Very good information
@DatabaseStar
@DatabaseStar 2 жыл бұрын
Thanks!
@statesman6379
@statesman6379 Жыл бұрын
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?
@DatabaseStar
@DatabaseStar Жыл бұрын
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.
@statesman6379
@statesman6379 Жыл бұрын
@@DatabaseStar Thanks for the awesome reply! I just subscribed.
@vaylx2253
@vaylx2253 2 жыл бұрын
Thanks for that.
@DatabaseStar
@DatabaseStar 2 жыл бұрын
Glad it was helpful!
@swan_oahu
@swan_oahu Жыл бұрын
Thank you 👍
@DatabaseStar
@DatabaseStar Жыл бұрын
No worries!
@hfghffggjngyh4754
@hfghffggjngyh4754 23 күн бұрын
thax
@DatabaseStar
@DatabaseStar 23 күн бұрын
You're welcome
@emekatimothyiloba699
@emekatimothyiloba699 Жыл бұрын
Thanks
@DatabaseStar
@DatabaseStar Жыл бұрын
No problem!
@mikkii3989
@mikkii3989 Жыл бұрын
I honestly gonna die with this language :")
@DatabaseStar
@DatabaseStar Жыл бұрын
Hahah
@finnnelson5472
@finnnelson5472 Жыл бұрын
🙌
@DatabaseStar
@DatabaseStar Жыл бұрын
Thanks!
@Entertainmentmod
@Entertainmentmod 2 жыл бұрын
Can you t sql vedios
@DatabaseStar
@DatabaseStar 2 жыл бұрын
Sure I can make TSQL videos.
When to Use a Subquery in SQL
8:50
Database Star
Рет қаралды 33 М.
English or Spanish 🤣
00:16
GL Show
Рет қаралды 18 МЛН
SQL Indexes - Definition, Examples, and Tips
12:14
Database Star
Рет қаралды 76 М.
UUID vs INT: What’s Better For Your Primary Key?
9:40
Database Star
Рет қаралды 13 М.
7 Mistakes Beginners Make with SQL
10:47
Database Star
Рет қаралды 19 М.
Learn Database Normalization - 1NF, 2NF, 3NF, 4NF, 5NF
28:34
Decomplexify
Рет қаралды 1,9 МЛН
7 Database Design Mistakes to Avoid (With Solutions)
11:29
Database Star
Рет қаралды 75 М.
SQL Index |¦| Indexes in SQL |¦| Database Index
9:57
Socratica
Рет қаралды 616 М.
you need to learn SQL RIGHT NOW!! (SQL Tutorial for Beginners)
24:25
NetworkChuck
Рет қаралды 1,5 МЛН