Monday, 17 June 2019

SQL Tutorial : COMPLEX VIEW


SQL Tutorial : COMPLEX VIEW

Let's learn about next topic: COMPLEX VIEW

COMPLEX VIEWS:
*****************

- CREATE OR REPLACE VIEW EMP_DEPTV
AS
SELECT E.LAST_NAME,D.DEPARTMENT_NAME
FROM COPY_EMP E,COPY_DEPT D
WHERE E.DEPARTMENT_ID=D.DEPARTMENT_ID


- CREATE OR REPLACE  VIEW EMPV
AS
SELECT DISTINCT EMPLOYEE_ID EID ,LAST_NAME LNAME ,SALARY SAL ,JOB_ID
FROM COPY_EMP


- NAMED SUB-QUERY IN THE FROM CLAUSE IS CALLED AS A INLINE
VIEW.

USAGE:

1.TOP-N-ANALYSIS
2.DISPLAY DATA FROM MULTIPLE TABLES
   USING SUB-QUERY

- DROPING VIEW:

DROP VIEW EMPV

No comments:

Post a Comment