SQL Query | How to find employees with highest salary in a department

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 พ.ย. 2020
  • This video is part of the series of videos on SQL Queries on Employee Salary database
    How to find employees with maximum salary in a department
    Check out all the SQL Queries and TH-cam videos for this series here -
    know-star.blogspot.com/2021/0...
    How to install SQL Server for practice?
    • How to install SQL Ser...
    Check out the complete list of SQL Query Interview Questions -
    • SQL Query Interview Qu...
    Best Data Science / Analytics / SQL courses
    Learn SQL Basics for Data Science Specialization
    imp.i384100.net/qnXYk5
    Data Science Fundamentals with Python and SQL Specialization
    imp.i384100.net/mgVYre
    Python for Everybody Specialization
    imp.i384100.net/DVz7Aj
    Google Data Analytics Professional Certificate
    imp.i384100.net/OR37oQ
    Coursera Plus - Data Science Career Skills
    imp.i384100.net/c/3299742/132...
    Please do not forget to like, subscribe and share.
    For enrolling and enquiries, please contact us at
    Website - knowstar.org/
    Facebook - / knowstartrainings
    Linkedin - www.linkedin.com/company/know...
    Email - learn@knowstar.org

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

  • @rapo107
    @rapo107 3 ปีที่แล้ว +4

    No words to explain how valuable this video... Take a bow ma'am..🙏🙏🙏

  • @pavanyeluri8728
    @pavanyeluri8728 2 ปีที่แล้ว

    Can we use correlated sub query using each where clause with dept as the joining condition?

  • @marcocruz5351
    @marcocruz5351 3 ปีที่แล้ว

    Can i please see the ERD table of this example? thanks!

  • @S17051985
    @S17051985 2 ปีที่แล้ว

    Mam, how to find out number of transactions including current and historical transactions for an id if records are maintained in different database??

  • @f4tm4_f4t4l3
    @f4tm4_f4t4l3 2 ปีที่แล้ว +1

    thank you soooo much for the second solution. i looked at so many solutions but they were all in postgrSQL or mySQL and didnt work with tSQL ... finally i can rest in peace

  • @srat859
    @srat859 2 ปีที่แล้ว +1

    Nice and great explanation more to come as videos. It helps a lot people like me

  • @kishorkumar007
    @kishorkumar007 3 ปีที่แล้ว +1

    Thxs for sharing this. I always stuck in this scenario question. This video will help

  • @BnfHunterr
    @BnfHunterr ปีที่แล้ว +1

    can we do this with cte

  • @RK-wf7re
    @RK-wf7re ปีที่แล้ว

    Can't we use subquery to derive these outputs??

  • @alwaysbehappy1337
    @alwaysbehappy1337 3 ปีที่แล้ว +2

    Thanks a lot...👍👍👍

  • @sibilyantv401
    @sibilyantv401 3 ปีที่แล้ว +1

    Display the 35 years old and above with the highest salary ., pls help me

  • @ariumboroseno
    @ariumboroseno 2 ปีที่แล้ว +2

    It is a great video, but it would be nice if you put .sql file in description so we can practice with same example 😁😁 just advice

    • @LearnatKnowstar
      @LearnatKnowstar  2 ปีที่แล้ว +1

      Thank you. Sure, we will try to add the sql files for upcoming videos👍

    • @jirkablaha1562
      @jirkablaha1562 ปีที่แล้ว

      ​@@LearnatKnowstarCould you please put the URL to that test database? I tried several but none were right.

  • @surajpatil3579
    @surajpatil3579 2 ปีที่แล้ว +2

    Very helpful

  • @hv0032113
    @hv0032113 3 ปีที่แล้ว +1

    Great tutorial

  • @selvan8000
    @selvan8000 3 ปีที่แล้ว +2

    Nice video and helpful

  • @hafizqasimxprt855
    @hafizqasimxprt855 3 ปีที่แล้ว

    show the ERD table

  • @ukkashs444
    @ukkashs444 ปีที่แล้ว +1

    How to get max salary as well as min salary on department wise with employee other details as well.

    • @LearnatKnowstar
      @LearnatKnowstar  ปีที่แล้ว +1

      You can use windows function - rank as explained in the second approach in the video.
      Max Sal = Rank = 1 Order sal desc
      Min Sal = Rank = 1 Order Sal Asc

  • @TheVaibhavdang
    @TheVaibhavdang ปีที่แล้ว

    Nice video.
    Kindly share the same data aswell .That would be really helpful

    • @LearnatKnowstar
      @LearnatKnowstar  ปีที่แล้ว

      The same query is covered in our latest tutorial on complex queries
      th-cam.com/video/E_6haE_10eE/w-d-xo.html
      There is practice data available for that tutorial. Hope it helps!

    • @TheVaibhavdang
      @TheVaibhavdang ปีที่แล้ว

      @@LearnatKnowstar Thank you so much. In real time scenerio of HR database,I used cte to make a temp table joing employees and departments table to practice your question.😀😀
      Thank you so much for the dataset.It will save some time.

  • @rajeshbathula5505
    @rajeshbathula5505 2 ปีที่แล้ว

    Ma'am, How to find the difference between punch in & punch out times of each employee, if those values are not in the same record?

    • @LearnatKnowstar
      @LearnatKnowstar  2 ปีที่แล้ว +1

      You can try to do a self join to fetch the two related records.

    • @rajeshbathula5505
      @rajeshbathula5505 2 ปีที่แล้ว

      @@LearnatKnowstar Thank you...

  • @arshadpathan8040
    @arshadpathan8040 2 ปีที่แล้ว +1

    Query : list the name of the employee and department having salary >50000

  • @RajaSekhar-qs2lz
    @RajaSekhar-qs2lz ปีที่แล้ว +1

    Find out top 2 salaries from each department and list them out:
    Table1
    ======
    DEPT
    id
    dept_name
    Table2
    ==========
    EMP
    emp_id
    dept_id # foreign_key salary

  • @jaitiwari241
    @jaitiwari241 ปีที่แล้ว +1

    Maam where is sql script

    • @LearnatKnowstar
      @LearnatKnowstar  ปีที่แล้ว

      You can find it here -
      know-star.blogspot.com/2021/01/sql-interview-queries-on-employee.html?m=1

  • @Abhinavkumar-og3xd
    @Abhinavkumar-og3xd ปีที่แล้ว +1

    Please speak in hindi.

  • @dimpyrathore818
    @dimpyrathore818 3 ปีที่แล้ว +2

    Very helpful