Query To Find highest, lowest and Average Salary In Each Department | SQL Interview Question

Поділитися
Вставка
  • Опубліковано 6 вер 2024

КОМЕНТАРІ • 14

  • @prashantp9029
    @prashantp9029 2 роки тому +2

    I am eagerly waiting the same....
    Good work keep going

  • @kunalnagarkoti1841
    @kunalnagarkoti1841 Рік тому +2

    How to find "second highest salary" from the table. Please make a query on this on workbench MySQL

    • @himanshumalik1023
      @himanshumalik1023 Рік тому

      select salary, department from worker
      order by salary desc
      limit 2,1;
      or
      select w.salary, w.department from worker w
      where 4 = ( select count(distinct (w1.salary)) from worker w1 where w1.salary >= w.salary);

  • @TDNoteBook
    @TDNoteBook Рік тому +1

    Thank you very much.

  • @Shantesh_VK
    @Shantesh_VK 2 роки тому +1

    Thank you for bringing this video, pls make more videos on SQL queries

  • @prashantp9029
    @prashantp9029 2 роки тому +1

    Please upload video regarding trigger procedure functions with live example....

  • @hrudayaranjanmohanty2689
    @hrudayaranjanmohanty2689 2 роки тому

    So nice of you, please bring up some queries related to sql server

  • @user1994gms
    @user1994gms 2 роки тому

    Good

  • @saiharshareddy8808
    @saiharshareddy8808 2 роки тому

    Please continue to make videos mam

  • @Meena-cb6bf
    @Meena-cb6bf 2 роки тому

    Will you please make a video about Triggers ? What are they ?

  • @nareshsurabu3947
    @nareshsurabu3947 Рік тому

    How to find which emp is having that max and min salaries in each dept?

    • @himanshumalik1023
      @himanshumalik1023 Рік тому

      select w.department, w.salary, w.first_name from ( select max(salary) as total_salary, department from worker group by department ) as tempnew
      inner join worker w
      on tempnew.department=w.department
      and tempnew.total_salary=w.salary;

  • @kranthikumar6043
    @kranthikumar6043 2 роки тому

    I want only which dept is paying max sal...

    • @himanshumalik1023
      @himanshumalik1023 Рік тому

      select department, sum(salary)as total_salary from worker
      group by department order by total_salary desc;
      through this you can find the max salary department and use where department = "department name";