The different types of JOINs in Microsoft SQL Server - INNER, LEFT, RIGHT, FULL and CROSS #shorts

preview_player
Показать описание
Let's explore in 60 seconds the various types of JOINs in SQL.
My SQL Server Udemy courses are:
----
There are five different types of JOINS:
1. The INNER JOIN - this is the default JOIN. Only those rows in the two tables which match.
2. The LEFT JOIN - all of the left-hand table rows with only those in the right-hand table which matches.
3. The RIGHT JOIN - all of the right-hand table rows with those in the right-hand table which matches.
4. The FULL JOIN - all of the two table rows, taking account of matching.
5. The CROSS JOIN - all of the first table's rows against all of the second table's rows. This multiplies the two tables' rows, has not account of matching, and therefore is not often used.
----
The query I used is:
WITH table1 AS
table2 AS
SELECT *
FROM table1 LEFT JOIN table2
Рекомендации по теме
Комментарии
Автор

Hi, what if there are null and duplicates in any of the table, or in both the tables?

_-_Abhinav_-_
Автор

i didnot understand if an table has an foreign key how it possible to the column (foreign key)to contain an value out of reference

mohamedtalal
Автор

Pl correct me if I am wrong . Outer joins finds to be obsolete since they gives either of the tables data ....simply select * will retrieve the same data from the table

kalaiselvichandrakasu