INTERVIEW QUESTIONS: SUBQUERIES

7 programming challenges to help you master the fundamentals of DATABASE MANAGEMENT SYSTEM USING ORACLE.

1

What is a subquery in SQL?

2

What are the different types of subqueries?

3

What is the difference between a subquery and a join?

4

What is a single-row subquery?

5

What is a multi-row subquery?

6

EMP (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO)

DEPT (DEPTNO, DNAME, LOC)

Display employees whose salary is greater than the average salary.

7

EMP (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO)

DEPT (DEPTNO, DNAME, LOC)

Display employees who earn more than employee ‘SMITH’.