a. Get the description EMP table.
b. List all employees details.
c. List all employee names and their salaries, whose salary lies between 1500/- and 3500/- both inclusive.
d. List all employee names and their and their manager whose manager is 7902 or 7566 0r 7789.
e. List all employees who belongs to the department 10 or 20.
CREATE TABLE emp (
EMPNO NUMBER(4) NOT NULL,
ENAME VARCHAR2(10),
JOB VARCHAR2(9),
MGR NUMBER(4),
HIREDATE DATE,
SAL NUMBER(7,2),
COMM NUMBER(7,2),
DEPTNO NUMBER(3),
AGE NUMBER(3)
ESAL NUMBER(4)
);
a) DESC emp;
b) SELECT * FROM emp;
c) SELECT ENAME, SAL FROM emp WHERE SAL BETWEEN 1500 AND 3500;
d) SELECT ENAME, MGR FROM emp WHERE(MGR = 7902) or (MGR = 7566 ) or (MGR = 7789 )
e)SELECT * FROM emp WHERE DEPTNO = 10 or DEPTNO = 20;
Comments
Leave a comment