Select From Emp Where Deptno 20 and Job in ("Clerk","Manager")
Select From Emp Where Deptno 20 and Job in ("Clerk","Manager")
Select From Emp Where Deptno 20 and Job in ("Clerk","Manager")
1. Display all the data from emp for those employees who are MANAGERs or who
are CLERKs that work in department 20.
2. Display all details from emp for any employee whose name contains the letter S
or A.
SELECT * FROM EMP WHERE ENAME LIKE "%A%" OR ENAME LIKE %S%"
3. Display the total take home (Salary +Comm) pay for all employees;
select ename, sal+ifnull(comm,0) from emp
4. Display the salary and salary with a 10% increase (with a heading of “10%
Increase” for all employees).
????????????????????????
5. Display the employee name and job separated by a comma and with a heading of
NAMEJOB.
??????????????????/
6. Display the average salary for each department.
7. Display the max salary, min salary and average salary for all employees grouped
by job.
Select job, max(sal) as mac, min(sal) as min, avg(sal)as avg from emp group
by job
14. Update the Dept table to change the location of Department Number 50 to Miami.
UPDATE DEPT set LOC="Miami" WHERE DEPTNO=50
15. Display the employee name and total salary of all employees who
are salesmen.
SELECT ENAME, SAL+IFNULL(COMM,0) FROM emp WHERE JOB="SALESMAN"
16. Delete all records in the Dept table which have a department
number of 50 and then view the contents of the table to ensure
that the operation has been completed correctly.