To create a manager database and execute DML queries using SQL.
UPDATE: It is used to update existing data within a table.
DELETE: It is used to delete records from a database table.
create table manager(enumber number(6),ename char(15),salary number(5),commission number(4),annualsalary number(7),Hiredate date,designation char(10),deptno number(2),reporting char(10));
insert into manager values(7369,'Dharsan',2500,500,30000,'30-June-81','clerk',10,'John');
insert into manager values(7839,'Subu',3000,400,36000,'1-Jul-82','manager',null,'James');
insert into manager values(7934,'Aadhi',3500,300,42000,'1-May-82','manager',30,NULL);
insert into manager values(7788,'Vikash',4000,0,48000,'12-Aug-82','clerk',50,'Bond');
update managers set salary=salary+(salary*10/100);
delete managers where salary<2750;
Q3) Display each name of the employee as “Name” and annual salary as “Annual Salary” (Note: Salary in emp table is the monthly salary)
SELECT
ename AS "Name",
salary*12 AS "Annual Salary"
FROM
managers;
select ename from managers where designation='clerk';
select ename from managers where designation!='manager';
select ename from managers where commission=0;
select ename from managers where ename LIKE 'S%' OR ename LIKE '%S';
select ename,designation,deptno,hiredate from managers order by hiredate ASC;
select * from managers where hiredate < '30 SEP 81';
Q11) List ename, deptno and sal after sorting emp table in ascending order by deptno and then descending order by sal.
select ename,deptno,salary from managers ORDER BY deptno ASC,salary desc;
select ename from managers where deptno NOT IN (30,40,10);
select count(*) as rownumber from managers;
select MAX(salary) as maximumsal,MIN(salary) as minimumsal,AVG(salary)
as averagesal from managers;
Q15) List the jobs and number of employees in each job. The result should be in the descending order of the number of employees.
select designation,count(*) as number_employee from managers GROUP BY designation ORDER BY number_employee DESC;
Executing DML queries using SQL was executed successfully.