#sql #learnsql #interview #SQLQueries #InterviewPreparation
In this video, you will learn the SQL GROUP BY clause with all aggregate functions using a real SQL interview question explained in Hindi.
We explain how to use GROUP BY with aggregate functions like COUNT, SUM, AVG, MIN, and MAX using a practical employee table example commonly asked in IT company interviews.
------------------------------------------------------------------------------------------------------------------
📌 Learn SQL Through Interview Questions Series– Full Playlist:- • Learn SQL Through Interview Questions Series
------------------------------------------------------------------------------------------------------------------
🔥 Topics covered in this video:
What is GROUP BY clause in SQL
GROUP BY with aggregate functions
COUNT(), SUM(), AVG(), MIN(), MAX()
SQL interview question with explanation
SQL Server example with real data
------------------------------------------------------------------------------------------------------------------
▶️ Timestamp:-
00:00 Intro
01:05 What is Group By?
02:14 What is Aggregate Function?
02:35 Types of Aggregate Function
04:05 First Interview Question
04:42 Second Interview Question
05:29 Third Interview Question
06:47 Fourth Interview Question
08:04 Fifth Interview Question
09:37 Sixth Interview Question
10:46 Conclusion
------------------------------------------------------------------------------------------------------------------
📘 For Practice Refer Below Table Structure :-
CREATE TABLE [dbo].[EMPLOYEEDATA](
[ID] [int] NULL,
[FIRSTNAME] [nvarchar](20) NULL,
[LASTNAME] [nvarchar](20) NULL,
[GENDER] [nvarchar](20) NULL,
[DEPT] [nvarchar](20) NULL,
[SALARY] [float] NULL,
[JOININGDT] [date] NULL
)
GO
INSERT [dbo].[EMPLOYEEDATA] ([ID], [FIRSTNAME], [LASTNAME], [GENDER], [DEPT], [SALARY], [JOININGDT])
VALUES (1, N'Riya', N'Sharma', N'Female', N'IT', 55000, CAST(N'2021-06-15' AS Date)),
(2, N'Arjun', N'Mehta', N'Male', N'IT', 72000, CAST(N'2020-03-10' AS Date)),
(3, N'Ruhi', N'Verma', N'Female', N'HR', 48000, CAST(N'2022-01-20' AS Date)),
(4, N'Rahul', N'Singh', N'Male', N'Finance', 65000, CAST(N'2019-11-05' AS Date)),
(5, N'Pooja', N'Patel', N'Female', N'HR', 52000, CAST(N'2021-09-12' AS Date)),
(6, N'Himanshu', N'Kumar', N'Male', N'IT', 80000, CAST(N'2018-07-01' AS Date)),
(7, N'Sneha', N'Iyer', N'Female', N'Finance', 60000, CAST(N'2020-02-18' AS Date)),
(8, N'Vikram', N'Rao', N'Male', N'Admin', 45000, CAST(N'2022-04-25' AS Date)),
(9, N'Anjali', N'Nair', N'Female', N'IT', 70000, CAST(N'2019-08-30' AS Date)),
(10, N'Karan', N'Malhotra', N'Male', N'Sales', 58000, CAST(N'2021-01-14' AS Date)),
(11, N'Priya', N'Gupta', N'Female', N'Sales', 62000, CAST(N'2020-10-09' AS Date)),
(12, N'Suresh', N'Reddy', N'Male', N'Finance', 75000, CAST(N'2017-12-03' AS Date)),
(13, N'Meena', N'Joshi', N'Female', N'Admin', 43000, CAST(N'2022-06-01' AS Date)),
(14, N'Rohit', N'Bansal', N'Male', N'IT', 90000, CAST(N'2016-05-17' AS Date)),
(15, N'Kavya', N'Chopra', N'Female', N'HR', 50000, CAST(N'2023-02-11' AS Date))
GO
------------------------------------------------------------------------------------------------------------------
👍 Support the Channel
If this video helps you:
👍 Like the video
🔔 Subscribe to the channel
💬 Comment your answer to the interview question
------------------------------------------------------------------------------------------------------------------
Keywords:-
#sql #learnsql #sqlinterviewquestions #sqlinterview #sqlserver #subscribe