LEFT JOIN is used to return all records from the left table and matching records from the right table.
If no matching record exists in the right table, NULL values are returned for right table columns.
LEFT JOIN focuses mainly on the left table.
Even if there is no related data in the right table, records from the left table are always displayed.
This join is very common in real applications.
Consider a situation where all customers must be shown, even if they have not placed any order.
LEFT JOIN helps achieve this requirement.
The second table stores order information.
Some customers may not have orders.
LEFT JOIN still shows those customers.
LEFT JOIN query uses the LEFT JOIN keyword.
The ON condition defines how both tables are connected.
All left table records are returned.
If a customer has no order, the order columns will show NULL.
LEFT JOIN is widely used in dashboards, reports, and admin panels.