SQL Quiz 1
This Database practice question using the ‘SCOTT’ in oracle.
1. Print EMPNO,ENAME with EMPNO number 7369,7698
1 2 3
| SELECT EMPNO, ENAME FROM EMP WHERE EMPNO IN ('7369','7698')
|
2. Print EMPNO, ENAME without EMPNO number 7369,7698
1 2 3
| SELECT EMPNO, ENAME FROM EMP WHERE EMPNO NOT IN ('7369','7698')
|
1 2 3
| SELECT * FROM EMP WHERE SAL BETWEEN 3000 AND 5000
|
1 2 3
| SELECT * FROM emp WHERE hiredate > '01-DEC-81'
|
5. Print max value EMPNO with job SALESMAN in EMP table.
1 2 3
| SELECT max(empno) FROM emp WHERE job IN 'SALESMAN'
|