LEFT JOIN is a keyword that selects all records from the left table, but returns only records from the right table that match criteria

Syntax

SELECT * FROM Procuts  
LEFT JOIN Categories ON Products.CategoryId = Categories.CategoryId  

Example

In the example below, when using LEFT JOIN keyword, a database will return all products and only categories that match the condition

Products Table

ProductIDProductNameCategoryIDPrice
1Chais118
2Chang119
3Aniseed Syrup1010
Category Table
CategoryIDCategoryNameDescription
1BeveragesSoft drinks, coffees, teas, beers, and ales
2CondimentsSweet and savory sauces, relishes, spreads, and seasonings
3ConfectionsDesserts, candies, and sweet breads
Joined Table
ProductIdProductNameCategoryIdPriceCategory NameDescription
1Chais118BevergesSoft drinks, coffees, teas, beers, and ales
2Chang119BeveregesSoft drinks, coffees, teas, beers, and ales
3Ainseed Syrup1010NULLNULL