Last active
September 23, 2022 15:22
-
-
Save theabhayprajapati/164cebddcced27abe667761e250b24a0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select d.DeptName, Min(salary) "Minimum Salary", Max(Salary) "Maximum Salary" from employee e, department d where e.DeptId=d.DeptId group by e.deptId; | |
SELECT Desgn, COUNT(Desgn) FROM Employee GROUP BY Desgn; | |
SELECT Desgn, MIN(Salary), MAX(Salary), SUM(Salary), AVG(Salary) FROM Employee GROUP BY Desgn; | |
SELECT MAX(Salary) - MIN(Salary) AS 'Range of Salary' FROM Employee; | |
select m.Empno "Manager ID", e.Salary "Minimum Salary" from Employee m, Employee e where e.DeptId=m.DeptId AND m.Desgn ="Manager" AND e.Salary = (select MIN(Salary) from Employee where DeptID=m.DeptId) ORDER BY e.FirstName DESC; | |
select d.deptId, empno, concat(FirstName, " ", LastName) "Employee Name", Salary from Employee d INNER JOIN Department e on d.deptId =e.deptId WHERE salary>(select AVG(salary) from Employee); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment