Day 13: How to find nth highest salary | Dense Rank Window Function row number Group By | PostgreSQL
ฝัง
- เผยแพร่เมื่อ 17 ต.ค. 2024
- Welcome to Day 12 of my 100 Days Challenge! Today, we're diving into UBER SQL interview questions to help you ace your next tech interview.
Join me as I walk through each problem step-by-step, providing detailed explanations and practical tips. Don't forget to like, subscribe, and hit the bell icon to stay updated with daily challenges!
Join the 100 Days Challenge Community:
Discord: / discord
Get the question & datasets
GitHub: github.com/naj...
Relevant Playlists:
SQL Interview Prep: • SQL Challenge - Data A...
#AmazonInterview #SQLInterviewQuestions #100DaysChallenge #DataScience #SQLTutorial #TechInterviews #DataAnalysis #LearnSQL #InterviewPrep #CodingChallenge #TechCareer #SQLPractice #AmazonTech #DataEngineering #PythonInterview #ExcelTips"
Thanks for the video series.
My pleasure!
well done keep going bro
Thank you, I will
How to do it without window functions?
87 days to go
DELIMITER //
CREATE PROCEDURE N_th_Salary(IN n INT)
BEGIN
WITH CTE_T AS (
SELECT *, DENSE_RANK() OVER (ORDER BY salary DESC) AS SAL_RANK
FROM employees
)
SELECT ID, NAME, SALARY
FROM CTE_T
WHERE SAL_RANK = n;
END //
DELIMITER ;
CALL N_th_Salary(5)