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

Sdílet
Vložit
  • čas přidán 22. 08. 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

Komentáře • 51

  • @amanrathore9775
    @amanrathore9775 Před 2 lety +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  Před 2 lety

      Yeah Its Correct. Thank you for watching

    • @sachinupreti7159
      @sachinupreti7159 Před 2 lety

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

    • @phyapanchakpram
      @phyapanchakpram Před 2 lety

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

    • @shabbiulhassan9677
      @shabbiulhassan9677 Před rokem

      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 Před rokem

      @@shabbiulhassan9677having is used for aggregate functions

  • @debasreetenyson5386
    @debasreetenyson5386 Před 2 lety +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  Před 2 lety

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

  • @mejawad6673
    @mejawad6673 Před 2 lety +1

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

  • @ptechsolutions9575
    @ptechsolutions9575 Před 2 měsíci

    Very helpful

  • @stereolyrics2386
    @stereolyrics2386 Před 2 lety +1

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

  • @potnurinagamohan3556
    @potnurinagamohan3556 Před 2 lety

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

  • @pradyumansinghshekhawat7364

    very well structured lecture
    Explained thoroughly

  • @SaumyaSharma007
    @SaumyaSharma007 Před rokem +1

    God bless you 🙂🙏

  • @nakulanand2725
    @nakulanand2725 Před 2 lety +1

    Very well explained Mam thanks.

  • @gollangianand6378
    @gollangianand6378 Před rokem

    TQQ madam very useful &easy to understand

  • @hdmovies9432
    @hdmovies9432 Před 2 lety +2

    Thank you it really helps

    • @CodeEra2020
      @CodeEra2020  Před 2 lety

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

  • @prathapganesh7021
    @prathapganesh7021 Před 9 měsíci

    Thank you for the video

  • @vineelsai111
    @vineelsai111 Před rokem +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;

  • @adeshtiwari5152
    @adeshtiwari5152 Před 2 lety

    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.

  • @radhasakhi4546
    @radhasakhi4546 Před 2 lety +2

    Nice video Didi

  • @hindushasaragadam6865
    @hindushasaragadam6865 Před 2 lety

    Thank you, nice explanatiom

  • @MRBLACK-id7zk
    @MRBLACK-id7zk Před 2 lety +3

    Great

  • @davidlewisn1017
    @davidlewisn1017 Před 2 lety +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

  • @entertaintvshorts
    @entertaintvshorts Před 2 lety +2

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

    • @CodeEra2020
      @CodeEra2020  Před 2 lety

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

  • @kumbharsangita6391
    @kumbharsangita6391 Před 2 lety +1

    Thank you so much...

    • @CodeEra2020
      @CodeEra2020  Před 2 lety

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

  • @AnilKumar-cl4hp
    @AnilKumar-cl4hp Před 2 lety

    I am your New subscriber

  • @subbarayudu118
    @subbarayudu118 Před rokem

    Thank you madam

  • @sourabhgaming1431
    @sourabhgaming1431 Před 2 lety +2

    Nice

  • @kiranharijan2809
    @kiranharijan2809 Před rokem +1

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

  • @explorenewsee2815
    @explorenewsee2815 Před rokem

    Nice 👍

  • @adityashekharsingh2669

    helpful!!

  • @AnjaliMathur-dr5ui
    @AnjaliMathur-dr5ui Před 3 měsíci

    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;

  • @tapantiwari2026
    @tapantiwari2026 Před 2 lety +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

  • @sujin8380
    @sujin8380 Před rokem

    Why using aggrigate function in group by

  • @bharatkumarboddepalli6095

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