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"

ความคิดเห็น • 7

  • @bankimdas9517
    @bankimdas9517 2 หลายเดือนก่อน

    Thanks for the video series.

    • @zero_analyst
      @zero_analyst  2 หลายเดือนก่อน

      My pleasure!

  • @gsrsakhilakhil528
    @gsrsakhilakhil528 2 หลายเดือนก่อน

    well done keep going bro

    • @zero_analyst
      @zero_analyst  2 หลายเดือนก่อน

      Thank you, I will

  • @Saswat-nh1cq
    @Saswat-nh1cq 2 หลายเดือนก่อน

    How to do it without window functions?

  • @vinothkumars7421
    @vinothkumars7421 2 หลายเดือนก่อน

    87 days to go

  • @nikhilgupta9228
    @nikhilgupta9228 2 หลายเดือนก่อน +1

    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)