SQL Left Join

The SQL Left Join or Left Outer Join allows you to retrieve all rows from the left table and the matched rows from the right table.

Tutorials dojo strip

SQL Left Join Syntax

SQL

SQL Left Join Retrieving All Patients and Their Appointments Example

This query retrieves all patients from the Patients table, even those who do not have a corresponding entry in Appointments table.

SQL

SQL Left Join Listing All Doctors and Their Patients’ Names

This query shows all doctors, even those who currently do not have any patients assigned to them. For doctors without patients, the Patient Name filed will be NULL.

SQL

SQL Left Join Visual Diagram

SQL Left Join Labs

Tutorials dojo strip