LAB4+5

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

T1

select ename,deptno from emp where deptno in ('20','50') order by ename

T2

select ename,deptno ,(sal+2500)/4 as "QSALARY" from emp where job='CLERK'order by (sal+2500)/4

T3

select ename,JOB,HIREDATE FROM EMP WHERE HIREDATE BETWEEN ('02/20/1981') AND ('06/20/1981') ORDER BY HIREDATE

T4

select ename,SAL,COMM FROM EMP WHERE COMM IS NOT NULL ORDER BY SAL DESC , COMM DESC

T5

select ename,sal ,comm from emp

where comm<sal;

T6

select SYSDATE as "Date" FROM DUAL

T7

SELECT ename, round ((SYSDATE-hiredate)/ 30) MONTHS FROM emp

T8

SELECT ename,job , hiredate, hiredate+(6*30) as "NEW HIREDATE" FROM EMP ORDER BY HIREDATE DESC

T9

SELECT *FROM EMP ORDER BY JOB ASC , EMPNO DESC

T10

SELECT CONCAT(ENAME,JOB) FROM EMP ORDER BY EName,job

T11

SELECT empno,ename,sal,round(sal*1.15) as "New Sal" from emp

T12

SELECT empno,ename,sal,(sal*1.15) as "New Sal" , ((sal*1.15)-sal) as "Increase"from emp

T13

select SYSDATE as "CURRENT Date" FROM DUAL

T14

SELECT ename,SAL , hiredate, hiredate+(6*30)+1 as "FIRST DATE AFTER 6 MONTHS" FROM EMP

T15

SELECT ename, round ((SYSDATE-hiredate)/ 30) MONTHS_WORKED FROM emp ORDER BY round ((SYSDATE-hiredate)/ 30)

T16

SELECT ename, LPAD(sal,15,'$') SALARY FROM EMP

T17

SELECT INITCAP(ENAME) NAME ,LENGTH(ENAME) LEN FROM EMP WHERE INSTR(ENAME,'J')=1 OR INSTR(ENAME,'A')=1 OR INSTR(ENAME,'M')=1
T18

ENAME SAL
T19
ADAMS 1100

ALLEN 1600

BLAKE 2850

CLARK 2450

FORD 3000

JAMES 950

JONES 2975

KING 5000

MARTIN 1250

MILLER 1300

SCOTT 3000

SMITH 800

TURNER 1500

WARD 1250
14 rows returned in 0.00 seconds Download

ENAME SAL

WARD 1250

TURNER 1500

SMITH 800

SCOTT 3000

MILLER 1300

MARTIN 1250

KING 5000

JONES 2975

JAMES 950

FORD 3000

CLARK 2450

BLAKE 2850

ALLEN 1600

ADAMS 1100
14 rows returned in 0.02 seconds Download

T20

EMPNO ENAME JOB MGR HIREDATE SAL

7369 SMITH CLERK 7902 12/17/1980 800

7499 ALLEN SALESMAN 7698 02/20/1981 1600

7521 WARD SALESMAN 7698 02/22/1981 1250

7566 JONES MANAGER 7839 04/02/1981 2975


7654 MARTIN SALESMAN 7698 09/28/1981 1250

7698 BLAKE MANAGER 7839 05/01/1981 2850

7782 CLARK MANAGER 7839 06/09/1981 2450

7788 SCOTT ANALYST 7566 12/09/1982 3000

7839 KING PRESIDENT - 11/17/1981 5000

7844 TURNER SALESMAN 7698 09/08/1981 1500

7876 ADAMS CLERK 7788 01/12/1983 1100

7900 JAMES CLERK 7698 12/03/1981 950

7902 FORD ANALYST 7566 12/03/1981 3000

7934 MILLER CLERK 7782 01/23/1982 1300


14 rows returned in 0.01 seconds Download

You might also like