Please enable JavaScript.
Coggle requires JavaScript to display documents.
JOINS - Coggle Diagram
JOINS
used to combine data or rows from two or more tables based on a common field between them
(CROSS PRODUCT + "some condition")
-
SELF JOIN
-
SELECT T1.column_1, T2.column_2 FROM Table AS T1, Table AS T2 WHERE T1.id = T2.id
OUTER JOINS
LEFT JOIN
This join returns all the rows of the table on the left side of the join and matches rows for the table on the right side of the join. For the rows for which there is no matching row on the right side, the result-set will contain null.
SELECT T1.COLUMNS, T2.COLUMNS FROM TABLE1 AS T1
LEFT JOIN
TABLE2 AS T2 ON COND.
RIGHT JOIN
This join returns all the rows of the table on the right side of the join and matching rows for the table on the left side of the join. For the rows for which there is no matching row on the left side, the result-set will contain null.
SELECT T1.COLUMNS, T2.COLUMNS FROM TABLE1 AS T1
RIGHT JOIN
TABLE2 AS T2 ON COND.
INNER JOIN
Inner Join joins two table on the basis of the column which is explicitly specified in the ON clause.
-
-