Page 36 - SQL
P. 36

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.)


        Read Clean Code in SQL online: https://riptutorial.com/sql/topic/9843/clean-code-in-sql













































































        https://riptutorial.com/                                                                               18
   31   32   33   34   35   36   37   38   39   40   41