-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathV1_6__Opration_001_010.sql
34 lines (24 loc) · 1.24 KB
/
V1_6__Opration_001_010.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
--ALTER TABLE emp RENAME COLUMN job_name TO job;
--ALTER TABLE emp RENAME COLUMN emp_id TO empno;
--ALTER TABLE emp RENAME COLUMN commission TO comm;
--1) Display the details of all employees
Select * from emp;
--2) Display the depart information from department table
--select * from dept;
--3) Display the name and job for all the employees
select ename,job from emp;
--4) Display the name and salary for all the employees
select ename,sal from emp;
--5) Display the employee no and totalsalary for all the employees
select empno,ename,sal,comm, sal+comm from emp;
--6) Display the employee name and annual salary for all employees.
select ename, 12*(sal+comm) from emp;
--7) Display the names of all the employees who are working in depart number 10.
select ename from emp where deptno=10;
--8 ) Display the names of all the employees who are working as clerks and drawing a salary more than 3000.
select ename from emp where sal>3000;
select ename from emp where job = 'CLERK' and sal>3000;
--9) Display the employee number and name who are earning comm.
select empno,ename from emp where comm is not null;
--10) Display the employee number and name who do not earn any comm.
select empno,ename from emp where comm is null;