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

IDNAMEDURATIONPRICE
1SQL5200
2T-SQL7700
3MySQL5600
4PL/SQL7800
5PostgreSQL6500

Certifications

IDNAMEPRICEID_TC
1PostgreSQL certification8005
2SQL certification3501
3T-SQL certification10002

Example

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

Results

IDNAMEPRICE
1SQL200
2T-SQL700
3MySQL600
4PL/SQL800
5PostgreSQL500