Full Join

SQL FULL JOIN

The FULL JOIN returns all rows from the joined tables.

SQL Full Join syntax

SELECT column_name(s)
FROM A_table FULL 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
4Oracle-SQL certification2000NULL

Example

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

Results

IDNAMEPRICEIDNAME
1PostgreSQL certification8005PostgreSQL
2SQL certification3501SQL
3T-SQL certification10002T-SQL
4Oracle-SQL certification2000NULLNULL
NULLNULLNULL3MySQL
NULLNULLNULL4PL/SQL