Joins

suggest change

Explicit joins should always be used; implicit joins have several problems:

SELECT d.Name,
       e.Fname || e.LName AS EmpName
FROM      Departments AS d
LEFT JOIN Employees   AS e ON d.ID = e.DepartmentID;
SELECT RecipeID,
       Recipes.Name,
       COUNT(*) AS NumberOfIngredients
FROM      Recipes
LEFT JOIN Ingredients USING (RecipeID);

(This requires that both tables use the same column name.  
USING automatically removes the duplicate column from the result, e.g., the join in this query returns a single `RecipeID` column.)

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


Clean Code in SQL:
*Joins

Table Of Contents