SQL Tutorial : DRL / DQL - JOINS
Let's learn about next topic: JOINS
JOINS:
- FETCHING DATA FROM MULTIPLE TABLES BY COMPARING COLUMNS
BETWEEN THE TABLES
ORACLE JOINS :
1. EQUI JOIN
2. NON-EQUI JOIN3. SELF JOIN
4. OUTER JOIN
ANSI SQL JOINS :
1. CROSS JOIN
2. NATURAL JOIN
3. USING CLAUSE
4. ON CLAUSE
5. LEFT OUTER JOIN
6. RIGHT OUTER JOIN
7. FULL OUTER JOIN
SELECT LAST_NAME,SALARY ,DEPARTMENT_NAME
FROM EMPLOYEES,DEPARTMENTS
CARTESIAN PRODUCT :
- CROSS PRODUCT OF TWO TABLES
1.WHEN JOIN CONDITION IS OMITTED
2. WHEN JOIN CONDITION IS INVALID
- SELECT LAST_NAME,SALARY ,DEPARTMENT_NAME
FROM EMPLOYEES,DEPARTMENTS
WHERE DEPARTMENT_ID =DEPARTMENT_ID
Point to note:
- QUALIFYING IS THE PROCESS OF PREFIXING THE TABLE NAME OR
TABLE ALIASES BEFORE THE COLUMN NAME
1.AVOIDS CONFUSION
2.IMPROVES THE SEARCH
No comments:
Post a Comment