Left Join

SQL LEFT JOIN

The LEFT JOIN returns all rows from the table A, whether or not there is a match with table B.

SQL Left Join syntax

SELECT column_name(s)
FROM A_table LEFT JOIN B_table
ON A_table.column_name = B_table.column_name;

Training_Course

ID NAME DURATION PRICE
1 SQL 5 200
2 T-SQL 7 700
3 MySQL 5 600
4 PL/SQL 7 800
5 PostgreSQL 6 500

Certifications

ID NAME PRICE ID_TC
1 PostgreSQL certification 800 5
2 SQL certification 350 1
3 T-SQL certification 1000 2

Example

SELECT t.ID,t.NAME,t.PRICE
FROM Training_Course t LEFT JOIN Certifications c 
ON t.ID = c.ID_TC ;

Results

ID NAME PRICE
1 SQL 200
2 T-SQL 700
3 MySQL 600
4 PL/SQL 800
5 PostgreSQL 500