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);
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;
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";
I am eagerly waiting the same....
Good work keep going
How to find "second highest salary" from the table. Please make a query on this on workbench MySQL
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);
Thank you very much.
Thank you for bringing this video, pls make more videos on SQL queries
Please upload video regarding trigger procedure functions with live example....
So nice of you, please bring up some queries related to sql server
Good
Please continue to make videos mam
Will you please make a video about Triggers ? What are they ?
How to find which emp is having that max and min salaries in each dept?
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;
I want only which dept is paying max sal...
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";