project 2
project 2
1. Write a query to get the Employees from the Employee table created in the previous
assignment having a salary between 13000 and 17000.
Write your query here
SELECT Employee_name, Department, Salary
FROM employee_data
WHERE Salary BETWEEN 13000 AND 17000;
2. Write a query to get data of employee1, Employee7, Employee10 and Employee15
From the “Employees” table.
Write your query here
SELECT Employee_name, Department, Salary
FROM employee_data
WHERE Employee_name IN ('Employee1', 'Employee7', 'Employee10',
'Employee15');
3. Write a query to get the data of Employees whose name starts with “J” .
Write your query here
SELECT Employee_name, Department, Salary
FROM employee_data
WHERE Employee_name LIKE 'J%';
4. Write a query to order the employee table according to the salaries from high to low
Write your query here
SELECT Employee_name, Department, Salary FROM employee_data
ORDER BY Salary DESC;
5. Write a query to get average salary of all the employees
Write your query here
SELECT AVG(Salary) AS Average_Salary
FROM employee_data;
10. Write a query to group the employees into the low paid(<15000), decently paid(15000-
20000) and high paid (>20000)employees according to their salary.
a. Write your query here
SELECT Employee_name, Department, Salary, CASE WHEN Salary < 15000
THEN 'Low Paid' WHEN Salary BETWEEN 15000 AND 20000 THEN 'Decently
Paid' ELSE 'High Paid' END AS Salary_Category FROM Employee;