Solving Medium Level SQL LeetCode Questions | Part 2/3

preview_player
Показать описание
Today we try Leetcode's Medium Level Database questions. LeetCode is a great place to practice some technical questions before you interview. I used it a few years ago and I really liked how easy it was to practice these questions as well as learn from it. You can actually see what the answer is as well as get community feedback so you can practice it yourself.

____________________________________________

SUBSCRIBE!
Do you want to become a Data Analyst? That's what this channel is all about! My goal is to help you learn everything you need in order to start your career or even switch your career into Data Analytics. Be sure to subscribe to not miss out on any content!
____________________________________________

RESOURCES:

Coursera Courses:

Udemy Courses:

*Please note I may earn a small commission for any purchase through these links - Thanks for supporting the channel!*
____________________________________________

SUPPORT MY CHANNEL - PATREON


Every dollar donated is put back into my channel to make my videos even better. Thank you all so much for your support!
____________________________________________

Websites:
____________________________________________

*All opinions or statements in this video are my own and do not reflect the opinion of the company I work for or have ever worked for*
Рекомендации по теме
Комментарии
Автор

Very helpful! Thanks Alex. Btw, is the hard questions, part 3 available now?

haowang
Автор

Hi Alex, thank you for the crisp content. A suggestion: For videos in series, you can add link to all parts in description and mention in the video as well.
Thanks again!

navanshusharma
Автор

This is actually really enjoyable and helpful to watch. Please continue to do more!

TheOrionMusicNetwork
Автор

"SELECT d.Name AS Department, e.Name AS Employee, e.Salary
FROM Employee e
JOIN Department d
ON e.DepartmentId = d.Id
AND e.Salary = (SELECT MAX(e1.Salary)
FROM Employee e1 WHERE e1.DepartmentId = d.Id)"

AbhishekSharma-hynl
Автор

Hi Alex, thank you very much, do you have the 3 part ready?

neffect
Автор

Wishing you a very merry Christmas and the chance to do lots more fishing in the new year to you and your family!

mohammedbouchcoucha
Автор

Merry Christmas Alex!🎄🎅⛄ And that hat looks good on you 🧢. I just learned new functions in SQL, Thank You 🙌

saurabhjoshi
Автор

Hey Alex, thanks for the video. Happy Holidays!!

Mrricardoacuna
Автор

Merry christmas Alex ! Love the hat :)

Holt
Автор

Great video! In your opinion, how hard would you say SQL questions for a data analyst internship interview compare to this?

omerlavian
Автор

Hi Alex where's the part 3 of this series unable to find it. Also thanks for your content.

abhijitkunjiraman
Автор

Hi Alex! Do you have a study guide for LeetCode practice interview questionsyou can share?

damondupre
Автор

This is Awesome!!! Thank you so much for your super helpful video.🌻

ericatsai
Автор

I am using a subquery to solve 2nd one, But it gives me a error said
FUNCTION test.max does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
and here is my code

select d.name as department, e.name as employee, salary
from employee e join department d
on e.departmentid = d.id
where salary in (
select max (salary)
from
employee
group by departmentid # get the highest salary for each department
)

trh_kairos
Автор

FYI if there is no solution, the discuss panel usually has a lot of them to test out and compare to

LastToTheParty
Автор

@alex kindly release hard part of sql series

rishigupta
Автор

if i'm not wrong it could've been either dense_rank or rank as we were doing salary desc, right?

Amin-txku
Автор

Good evening Alex!
Your videos are very helpful to beginners such as me. I tried the last question, the highest salary, with cte like you, did and I also tried subquery but I got a little bit confused about it.
select
d.name as Department,
e.Name as Employee,
Salary
from Employee e
join Department d
on e.departmentid=d.id
where (e.DepartmentId, salary) in
(select DepartmentId, max(salary) from employee group by DepartmentId)

This answer is accepted, but why does it go wrong if "e." is added to the "DepartmentId", like "e.DepartmentId" in the last line?
It seems that they don't have too much difference...
Looking forward to seeing your reply.
Leon
Kind Regards

xuanyuliang
Автор

decent video, but feels a little draggy (with watching you think) rather than informative, efficient, and to the point.

HaileyNixon-fj
visit shbcf.ru