Use Of GROUP BY Clause In SQL | Interview Questions | Examples

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ก.ย. 2024
  • In this video we will learn to us GROUP BY Clause in SQL with help of 5 different use cases of Group By Clause along with query practice.
    Please Like 👍, Share and Subscribe.
    Query PDF To Create Table And Add Data Into Table -
    drive.google.c...
    Join our Telegram Channel - t.me/joingroup...
    ⭐Constraints In SQL | Part-I
    • Constraints In SQL | ...
    ⭐Constraints In SQL | Part-II
    • Constraints In SQL | ...
    ⭐How To Delete Duplicate Rows In a Table
    • How To Delete Duplicat...
    ⭐How To Find Duplicate Rows In a Table
    • How To Find Duplicate ...
    ⭐Part 1:Top 9 SQL queries for interview -
    • Top 9 SQL queries for ...
    ⭐Part 2:Top 9 SQL queries for interview -
    • PART 2 : Top 9 SQL que...
    ⭐Find Nth Highest Salary in SQL | 5 Different Ways
    • Find Nth Highest Salar...
    ⭐Top SQL Interview Question
    • Top SQL Interview Ques...
    ⭐Find the number of Employees working in each department | SQL
    • Find the number of Emp...
    ⭐Types of Joins in SQL-
    • SQL Joins & Its Types ...
    ⭐Difference Between WHERE and HAVING Clause
    • Difference Between WHE...
    ⭐Aggregate Functions In SQL | COUNT, SUM, AVG, MIN, MAX | IFNULL( )
    • Aggregate Functions In...
    ⭐Difference Between DELETE, DROP and TRUNCATE
    • Difference Between DEL...
    ⭐SQL vs NoSQL | MySQL vs MongoDB
    • Difference between SQL...
    ⭐DBMS vs RDMS
    • DBMS vs RDBMS | What i...
    ⭐Normalization in DBMS-
    • Normalization and its ...
    ⭐Types of key in DBMS-
    • Types of Keys in DBMS ...
    ⭐Create MySQL Database and Table -
    • How to Create Database...
    #sql #GroupByClause #Having #GroupBy #sqlserver #database #mysql #PlacementPreparation

ความคิดเห็น • 51

  • @amanrathore9775
    @amanrathore9775 2 ปีที่แล้ว +9

    answers:
    1. select department , max(salary) from employee_info group by department;
    2. select gender ,count(id) from employee where dob between 01/01/1960 AND 31/12/1975 group by gender;
    3. select department , count(id) from employee_info group by department;
    Please check my queries @CodeEra :) Thanks

    • @CodeEra2020
      @CodeEra2020  2 ปีที่แล้ว

      Yeah Its Correct. Thank you for watching

    • @sachinupreti7159
      @sachinupreti7159 2 ปีที่แล้ว

      @@CodeEra2020 how 🙄, data must be written in ' ' quotes ....recheck it..

    • @phyapanchakpram
      @phyapanchakpram 2 ปีที่แล้ว

      @@sachinupreti7159 date is different data type.Not string not int.

    • @shabbiulhassan9677
      @shabbiulhassan9677 ปีที่แล้ว

      2. select gender ,count(id) from employee where dob between 01/01/1960 AND 31/12/1975 group by gender;
      Shouldn't we use HAVING clause instead of WHERE here?

    • @PenApostol
      @PenApostol ปีที่แล้ว

      @@shabbiulhassan9677having is used for aggregate functions

  • @debasreetenyson5386
    @debasreetenyson5386 2 ปีที่แล้ว +4

    Thank you so much for giving the vertical view of table after group by is used. The view made it so easy to understand. In no other video I found this. Thank you so much sister.

    • @CodeEra2020
      @CodeEra2020  2 ปีที่แล้ว

      I am so glad you the video. Thank you so much for watching

  • @mejawad6673
    @mejawad6673 2 ปีที่แล้ว +1

    Thanks for your excellent videos based on scenarios. Helps me a lot

  • @stereolyrics2386
    @stereolyrics2386 2 ปีที่แล้ว +1

    Very helpful and you explain in very simple manner . Thank you👍

  • @pradyumansinghshekhawat7364
    @pradyumansinghshekhawat7364 ปีที่แล้ว +1

    very well structured lecture
    Explained thoroughly

  • @SaumyaSharma007
    @SaumyaSharma007 ปีที่แล้ว +1

    God bless you 🙂🙏

  • @ptechsolutions9575
    @ptechsolutions9575 2 หลายเดือนก่อน

    Very helpful

  • @nakulanand2725
    @nakulanand2725 2 ปีที่แล้ว +1

    Very well explained Mam thanks.

  • @entertaintvshorts
    @entertaintvshorts 2 ปีที่แล้ว +2

    Null value it is display y as its sum is less than 17 k in the vedio at 10.20

    • @CodeEra2020
      @CodeEra2020  2 ปีที่แล้ว

      Null is in Department column not in SUM(Salary) Column

  • @potnurinagamohan3556
    @potnurinagamohan3556 2 ปีที่แล้ว

    Great work..Pls take full SQL course from beginners.. it is very useful to them to crack the interview

  • @hdmovies9432
    @hdmovies9432 2 ปีที่แล้ว +2

    Thank you it really helps

    • @CodeEra2020
      @CodeEra2020  2 ปีที่แล้ว

      So glad to know that It helps you.. Thank you for watching

  • @MRBLACK-id7zk
    @MRBLACK-id7zk 2 ปีที่แล้ว +3

    Great

  • @gollangianand6378
    @gollangianand6378 ปีที่แล้ว

    TQQ madam very useful &easy to understand

  • @vineelsai111
    @vineelsai111 ปีที่แล้ว +1

    select
    department,max(salary) from employee_info group by department;
    select
    count(*),gender from employees group by gender having dob between
    '1960-01-10' and '1975-12-31';
    select count(*),department
    from employees group by department;

  • @radhasakhi4546
    @radhasakhi4546 2 ปีที่แล้ว +2

    Nice video Didi

  • @prathapganesh7021
    @prathapganesh7021 9 หลายเดือนก่อน

    Thank you for the video

  • @hindushasaragadam6865
    @hindushasaragadam6865 2 ปีที่แล้ว

    Thank you, nice explanatiom

  • @kumbharsangita6391
    @kumbharsangita6391 2 ปีที่แล้ว +1

    Thank you so much...

    • @CodeEra2020
      @CodeEra2020  2 ปีที่แล้ว

      Welcome. We're so happy that you like the video. Thanks for watching

  • @sourabhgaming1431
    @sourabhgaming1431 2 ปีที่แล้ว +2

    Nice

  • @davidlewisn1017
    @davidlewisn1017 2 ปีที่แล้ว +1

    Hello,
    Hello,Great work you are doing in computer training.
    I am generating reports and i have challenges in using using sum and group by in my sql querries.
    Could you kindly offer some help i am stuck on these .
    Your help is much appreciated.
    David

    • @CodeEra2020
      @CodeEra2020  2 ปีที่แล้ว

      What difficulty are you facing?

  • @AnjaliMathur-dr5ui
    @AnjaliMathur-dr5ui 3 หลายเดือนก่อน

    1) select max(Salary), department
    from employee_info
    group by department;
    2) select count(ID), gender from employee_info
    where DOB between 01/01/1960 and 31/12/1975
    group by gender;
    3)select count(ID) , department from employee_info
    group by department;

  • @adeshtiwari5152
    @adeshtiwari5152 2 ปีที่แล้ว

    Is it always necessary to include those columns in "group by" which are used after Select?
    For ex: Select col1, col2 from table group by col1.
    In this above query do we also need to include col2 in group by as it is there after Select.
    Could you please confirm this point.

  • @kiranharijan2809
    @kiranharijan2809 ปีที่แล้ว +1

    Madam for practice purspose can you plz provide more questions on sql

  • @subbarayudu118
    @subbarayudu118 2 ปีที่แล้ว

    Thank you madam

  • @explorenewsee2815
    @explorenewsee2815 ปีที่แล้ว

    Nice 👍

  • @tapantiwari2026
    @tapantiwari2026 2 ปีที่แล้ว +1

    why in the output result at 11.25, NULL is not displayed although it has sum(salary) as 87000 which is greater than 17000

  • @AnilKumar-cl4hp
    @AnilKumar-cl4hp 2 ปีที่แล้ว

    I am your New subscriber

  • @adityashekharsingh2669
    @adityashekharsingh2669 ปีที่แล้ว

    helpful!!

  • @sujin8380
    @sujin8380 ปีที่แล้ว

    Why using aggrigate function in group by

  • @bharatkumarboddepalli6095
    @bharatkumarboddepalli6095 ปีที่แล้ว

    there is a small mistake in data set .....department constraint cant be "NOT NULL" while creating table .