How To Do The LEFT JOIN In SQL? | Difference between Left Join and Inner Join

Описание к видео How To Do The LEFT JOIN In SQL? | Difference between Left Join and Inner Join

#sql #mysql #database

The LEFT JOIN keyword returns all records from the left table (table1), and the matching records from the right table (table2). The result is 0 records from the right side, if there is no match.

00:00 Joins and Data SQL
01:32 SQL LEFT JOIN syntax
02:18 How does the left join work in SQL?
03:08 Inner Join vs Left Join
03:49 Left Join and nulls in SQL
04:36 Left Join Summary

For each row from the T1 table, the query compares it with all the rows from the T2 table. If a pair of rows causes the join predicate to evaluate to TRUE, the column values from these rows will be combined to form a new row which is then included in the result set.

If a row from the left table (T1) does not have any matching row from the T2 table, the query combines column values of the row from the left table with NULL for each column values from the right table.

In short, the LEFT JOIN clause returns all rows from the left table (T1) and matching rows or NULL values from the right table (T2).

Комментарии

Информация по комментариям в разработке