What is join and types of join in SQL server:-
JOINS:
A MECHANISM TO COMPARE ONE OR MORE TABLES.
PURPOSE : FOR EASY REPORTING AND DATA GENERATION.
EX: -
ASSUME ALL PRODUCTS IN ONE TABLE, SALES IN ANOTHER TABLE
A "JOIN" CAN REPORT LIST OF ALL PRODUCTS & THEIR SALES
A "JOIN" CAN REPORT LSIT OF ALL PRODUCTS WITHOU SALES.
TYPES OF JOINS:
1. CROSS JOIN: Used to report all possible combinations
2. INNER JOIN: Used to report only MATCHING data.
3. OUTER JOIN: Used to report MATCHING & MISSING data.
Left Outer Join
Right Outer Join
Full Outer Join
4. SELF JOIN : Used to compare columns within same table.
5. HASH JOIN : Applicable for tables with unknown size. Dynamic Tables
6. MERGE JOIN: Applicable for tables with LARGE data. in MBs, GBs
7. LOOP JOIN: Applicable for tables with SMALL data. in KBs
No comments:
Post a Comment