Mastering SQL with LeetCode: Problem 1789 - Primary Department for Each Employee

preview_player
Показать описание
Dive deep into the world of SQL with this tutorial focused on solving LeetCode Problem 1789, "Primary Department for Each Employee". This video guides you through a step-by-step solution to this problem, helping you grasp some more advanced SQL concepts along the way. This problem is part of the top 50 SQL problems that every data enthusiast should explore.

We take a deep dive into the use of CASE and COALESCE functions in SQL to solve complex problems. Starting with a clear breakdown of the problem, we move on to writing the SQL query and finally testing it. By the end of this video, you'll be comfortable using these powerful SQL features and will have sharpened your problem-solving skills.

Remember, SQL is a vital tool for any data professional, and the best way to master it is by practicing with real-world examples. Keep solving such problems and continue your journey to become an SQL expert. Don't forget to leave any questions in the comments section. If you find this video helpful, do like, share, and subscribe for more such tutorials.
Рекомендации по теме
Комментарии
Автор

keep the code in the middle of the screen pls. nicely explained btw ))) thanks

Your_Dream_D
Автор

Your solution does not pass all test cases
for example if there is an employee with 2 departments as 'NO' i.e, not a primary department?

manognapallam
Автор

HII. Thanks a lot. Where are you from?? Russia? a like your accent.
the question:
why we have to use this line:
MAX(department_id)) ?

thenks for an answer

Kos