DBMS Exp2
DBMS Exp2
Assessment 2
Exercise: III
Operators and Functions
Code Snippet
select first_name from employee55 where salary between 30000 and 70000;
desc employee55;
UPDATE Dept
SET Department_name='Headquarter'
WHERE Department_number=3;
UPDATE Dept
SET Department_name='Finance'
WHERE Department_number=4;
UPDATE Dept
SET Department_name='Research'
WHERE Department_number=5;
UPDATE employee55
SET Department_name='Manufacture'
WHERE Department_number=1;
UPDATE employee55
SET Department_name='Administration'
WHERE Department_number=2;
UPDATE employee55
SET Department_name='Headquarter'
WHERE Department_number=3;
UPDATE employee55
SET Department_name='Finance'
WHERE Department_number=4;
UPDATE employee55
SET Department_name='Research'
WHERE Department_number=5;
//1. How many different departments are there in the ‘employee’ table?
//2. For each department display the minimum and maximum employee salaries
//5. Print the Department name and average salary of each department.
//6. Display the department name which contains more than 30 employees.
SELECT d.DEPARTMENT_NAME
FROM employee55 e
GROUP BY d.DEPARTMENT_NAME
//8. Count separately the number of employees in the finance and research department.
//10. List out the employees who works in ‘manufacture’ department group by first name