SQL Interview Question | How to find departments having only male / female employees?

  Рет қаралды 24,471

Learn at Knowstar

Learn at Knowstar

Күн бұрын

Пікірлер: 16
@ipsitapanigrahi5004
@ipsitapanigrahi5004 3 жыл бұрын
The second approach can be used for a lot of complex problems, thank you for discussing this.
@LearnatKnowstar
@LearnatKnowstar 3 жыл бұрын
Thank you
@Shimpivaibhav0922
@Shimpivaibhav0922 3 жыл бұрын
HI Maám, I was stuck at one of the complex query, and then i found your this video. The Having clause with SUM has saved my time and worked for me.. thanksss a Lottttttt..... I Really Appreciate you...
@LearnatKnowstar
@LearnatKnowstar 3 жыл бұрын
Thanks so much.
@sravankumar1767
@sravankumar1767 2 жыл бұрын
Superb explanation 👌 👏
@surajpatil3579
@surajpatil3579 3 жыл бұрын
This sql interview questions playlist is too much helpful..please cover more scenarios
@LearnatKnowstar
@LearnatKnowstar 3 жыл бұрын
Thanks so much
@TheVaibhavdang
@TheVaibhavdang 2 жыл бұрын
Thanks for the solution.But I have thought it in another way With cte as (Select distinct [DepartmentName],[Gender],dense_rank() over (partition by DepartmentName order by Gender) as rn from [dbo].[DimEmployee]) select Top 2 c.DepartmentName,c.Gender,count(rn) over (partition by c.DepartmentName ) as cnt from cte c order by count(rn) over (partition by c.DepartmentName) What do you think of this solution?
@rk-ej9ep
@rk-ej9ep 2 жыл бұрын
Nice maamm...
@LearnatKnowstar
@LearnatKnowstar 2 жыл бұрын
Thank you!
@hovardlee
@hovardlee 2 жыл бұрын
You can also use CTE and then use exists / not exists on CTE.
@RaviKumar-ub6vy
@RaviKumar-ub6vy 3 жыл бұрын
Hi Madam, Could you please share the employee table script which you have created .. So that we can practice.. Thank you
@LearnatKnowstar
@LearnatKnowstar 3 жыл бұрын
You can find a similar script here. You can modify it a little to suit this scenario. know-star.blogspot.com/2021/02/sql-query-how-to-find-employees-hired.html?m=1
@dynamicreflections
@dynamicreflections 2 жыл бұрын
Can't we use MINUS operator
@inhlam5909
@inhlam5909 2 жыл бұрын
1. Use EXCEPT 2. Use Having condition (aggregation)
@515jesbinjenet2
@515jesbinjenet2 Жыл бұрын
what about Find the department name having maximum female employee
SIZE DOESN’T MATTER @benjaminjiujitsu
00:46
Natan por Aí
Рет қаралды 8 МЛН
Как Я Брата ОБМАНУЛ (смешное видео, прикол, юмор, поржать)
00:59
The 25 SQL Questions You MUST Know for Data Analyst Interviews
32:47
KSR Datavizon
Рет қаралды 246 М.
Practice SQL Interview Query | Big 4 Interview Question
14:47
SIZE DOESN’T MATTER @benjaminjiujitsu
00:46
Natan por Aí
Рет қаралды 8 МЛН