MySQL: GROUP BY

  Рет қаралды 73,705

Bro Code

Bro Code

Күн бұрын

Пікірлер: 41
@BroCodez
@BroCodez 2 жыл бұрын
You can copy and paste all of the following statements if you would like to follow along in this video. P.S. Make sure you have a customers table if you're linking the foreign key on customer_id. ------------------------------------------------------------ DROP TABLE IF EXISTS transactions; CREATE TABLE transactions ( transaction_id INT PRIMARY KEY AUTO_INCREMENT, amount DECIMAL(5, 2), customer_id INT, order_date DATE, FOREIGN KEY (customer_id) REFERENCES customers(customer_id) ); INSERT INTO transactions VALUES (1000, 4.99, 3, "2023-01-01"), (1001, 2.89, 2, "2023-01-01"), (1002, 3.38, 3, "2023-01-02"), (1003, 4.99, 1, "2023-01-02"), (1004, 1.00, NULL, "2023-01-03"), (1005, 2.49, 4, "2023-01-03"), (1006, 5.48, NULL, "2023-01-03"); SELECT * FROM transactions; ------------------------------------------------------------ -- EXAMPLE 1 -- SELECT SUM(amount), order_date FROM transactions GROUP BY order_date; -- EXAMPLE 2 -- SELECT COUNT(amount), customer_id FROM transactions GROUP BY customer_id HAVING COUNT(amount) > 1 AND customer_id IS NOT NULL;
@youneverknew_me
@youneverknew_me 2 жыл бұрын
I've read the article about GROUP BY but still don't understand. Your explanation is simply the best!
@lordofdeath9247
@lordofdeath9247 Жыл бұрын
bro you are a treasure , thank you for existing
@APDesignFXP
@APDesignFXP 2 жыл бұрын
Dude couldn’t have a better timing i just got my assignment in sql
@zabehullahalizadeh2310
@zabehullahalizadeh2310 2 жыл бұрын
I love your voice and the way that you teach us. Thank you Bro Code
@zoiskiee28
@zoiskiee28 3 ай бұрын
This video explained it so much better than the first one I saw, thank you.
@maxlin3931
@maxlin3931 10 ай бұрын
FINALLY an explanation that i understand. Thanks!
@MDMushu-ff5od
@MDMushu-ff5od 7 ай бұрын
Just like wowww
@stupidstone4780
@stupidstone4780 2 ай бұрын
You are a god much love from IT student from serbia
@israelcyrus2586
@israelcyrus2586 2 жыл бұрын
love u bro from Tamilnadu.
@alamzia2905
@alamzia2905 Жыл бұрын
what a top notch explanation sir.
@abundance2616
@abundance2616 Жыл бұрын
Thanks a lot for explaining it so nicely
@thebettertwin6910
@thebettertwin6910 11 ай бұрын
Thank you, great explanation
@pravinv_
@pravinv_ Жыл бұрын
we can use where Clause also. Give the Where clause above the GroupBy Clause.But for Aggregate functions we need to use Having within Groupby
@olufemiolawale3848
@olufemiolawale3848 Жыл бұрын
Well explained.
@YoshiGG_
@YoshiGG_ Жыл бұрын
thank you brocode Another day Another Victory for the ogs
@celineharakee
@celineharakee Жыл бұрын
life saver, I owe u my life
@kin_1997
@kin_1997 6 ай бұрын
you are the best
@mdfaisalmahamud
@mdfaisalmahamud 2 жыл бұрын
Love From Bangladesh 🇧🇩
@Blizz-rm6ec
@Blizz-rm6ec 8 ай бұрын
thank you i have an asessment tomorrow it helped a lot
@RxxxQueen
@RxxxQueen 4 ай бұрын
I love you, thank you 😭😭
@offlinemoe
@offlinemoe Жыл бұрын
Thank you, it helped me a lot
@ned7757
@ned7757 Жыл бұрын
Your videos have really helped me. I really appreciate it!
@gabrielodiase7357
@gabrielodiase7357 Жыл бұрын
God bless you bro
@jaishriram6602
@jaishriram6602 4 ай бұрын
Having clause can be used as a substitute for the where clause, in case we are using group by clause.
@DarkSoulGaming7
@DarkSoulGaming7 2 жыл бұрын
Love from TN too , India!
@keroro3187
@keroro3187 2 жыл бұрын
Thank you very much
@ilijapopovic1826
@ilijapopovic1826 2 жыл бұрын
Love you bro
@hackerexploit8957
@hackerexploit8957 2 жыл бұрын
Please make a bash & powershell series too 😊
@maisie2735
@maisie2735 Жыл бұрын
THANK YOU 😭
@Personal1123-et3bb
@Personal1123-et3bb 9 ай бұрын
Thanks
@stanhe9922
@stanhe9922 8 ай бұрын
u the goat
@TvideosTv
@TvideosTv 8 ай бұрын
THANK YOU SO MUCH AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
@shawnchristophermalig4339
@shawnchristophermalig4339 Жыл бұрын
Can you make a video, explaining the math or innerworkings of GROUP by? I think what others seemed to get confused about group by is the fact that the math isn't mathin'. I mean that you visualize select, but it's hard to visualize into thinking the group by. :) Questions like: is it correct that 2 invisible became a pattern marker for group by? Something like that! 😁
@itz_phil5146
@itz_phil5146 2 жыл бұрын
Are you able to do more videos about javaFX?
@shortsShowcase250
@shortsShowcase250 Жыл бұрын
Can we use DISTINCT instead of GROUP BY
@vaibhavsinhbihola1
@vaibhavsinhbihola1 Жыл бұрын
Hey I am also using MySQL workbench mine text editor is not same as you how I can changed it to dark and like you
@QURAN_010
@QURAN_010 Жыл бұрын
I like your voice bro *_^
@sidneywolfe9260
@sidneywolfe9260 2 жыл бұрын
𝓅𝓇𝑜𝓂𝑜𝓈𝓂
@reema5315
@reema5315 8 ай бұрын
Would you marry me?
@fredianriko5648
@fredianriko5648 Жыл бұрын
could you please share the sql dump so we could also practice with the exact data you have?
MySQL: ROLLUP
3:51
Bro Code
Рет қаралды 24 М.
MySQL: JOINS are easy (INNER, LEFT, RIGHT)
5:04
Bro Code
Рет қаралды 527 М.
Мясо вегана? 🧐 @Whatthefshow
01:01
История одного вокалиста
Рет қаралды 7 МЛН
REAL or FAKE? #beatbox #tiktok
01:03
BeatboxJCOP
Рет қаралды 18 МЛН
Мен атып көрмегенмін ! | Qalam | 5 серия
25:41
MySQL Full Course for free 🐬
3:00:00
Bro Code
Рет қаралды 2,3 МЛН
Advanced Aggregate Functions in SQL (GROUP BY, HAVING vs. WHERE)
6:00
Becoming a Data Scientist
Рет қаралды 274 М.
MySQL: ON DELETE
7:31
Bro Code
Рет қаралды 27 М.
MySQL: TRIGGERS
16:50
Bro Code
Рет қаралды 147 М.
Learn SQL In 60 Minutes
56:24
Web Dev Simplified
Рет қаралды 2,2 МЛН
6 SQL Joins you MUST know! (Animated + Practice)
9:47
Anton Putra
Рет қаралды 244 М.
Мясо вегана? 🧐 @Whatthefshow
01:01
История одного вокалиста
Рет қаралды 7 МЛН