Use Of GROUP BY Clause In SQL | Interview Questions | Examples
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
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
Yeah Its Correct. Thank you for watching
@@CodeEra2020 how 🙄, data must be written in ' ' quotes ....recheck it..
@@sachinupreti7159 date is different data type.Not string not int.
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?
@@shabbiulhassan9677having is used for aggregate functions
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.
I am so glad you the video. Thank you so much for watching
Thanks for your excellent videos based on scenarios. Helps me a lot
Very helpful
Very helpful and you explain in very simple manner . Thank you👍
Thank you.
Great work..Pls take full SQL course from beginners.. it is very useful to them to crack the interview
very well structured lecture
Explained thoroughly
❤
Thank you so much😊
God bless you 🙂🙏
Very well explained Mam thanks.
Thank you so much.
TQQ madam very useful &easy to understand
Thank you it really helps
So glad to know that It helps you.. Thank you for watching
Thank you for the video
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;
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.
Nice video Didi
Thanks for liking
Thank you, nice explanatiom
Great
Thank you so much
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
What difficulty are you facing?
Null value it is display y as its sum is less than 17 k in the vedio at 10.20
Null is in Department column not in SUM(Salary) Column
Thank you so much...
Welcome. We're so happy that you like the video. Thanks for watching
I am your New subscriber
Thank you madam
Nice
Thank you so much
Madam for practice purspose can you plz provide more questions on sql
Sure,we will.
Nice 👍
helpful!!
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;
why in the output result at 11.25, NULL is not displayed although it has sum(salary) as 87000 which is greater than 17000
Same doubt :(
Why using aggrigate function in group by
there is a small mistake in data set .....department constraint cant be "NOT NULL" while creating table .