How to use a INSERT statements to add the following two recipes into the database.

  • I have these recipes: Kitchen Sink Cookies

    Submitted By: Cara

    Reference: allrecipes.com (http://allrecipes.com/Recipe/Kitchen-Sink-Cookies/Detail.aspx)

    INGREDIENTS

    •1 cup butter, softened

    •2 cups packed brown sugar

    •2 eggs

    •2 teaspoons vanilla extract

    •2 1/3 cups all-purpose flour

    •1 teaspoon baking soda

    •1 teaspoon salt

    •2 cups rolled oats

    •1 cup semisweet chocolate chips

    •1 cup vanilla baking chips

    •1/2 cup butterscotch chips

    •1 cup chopped pecans

    DIRECTIONS

    1.Preheat the oven to 375 degrees F (190 degrees C).

    2.In a large bowl, cream together the butter and brown sugar until smooth. Beat in the eggs one at a time, then stir in the vanilla. Combine the flour, baking soda and salt; stir into the creamed mixture. Mix in the oats, chocolate chips, vanilla chips, butterscotch chips and chopped pecans. Drop by tablespoonfuls onto ungreased cookie sheets. Cookies should be at least 2 inches apart.

    3.Bake for 8 to 10 minutes in the preheated oven. Allow cookies to cool on baking sheet for 5 minutes before removing to a wire rack to cool completely.

    No Bake Cookies II

    Submitted By: Sandy

    Reference: allrecipes.com (http://allrecipes.com/Recipe/No-Bake-Cookies-II/Detail.aspx)

    INGREDIENTS

    •2 cups white sugar

    •1/2 cup butter

    •1/2 cup milk

    •3 tablespoons cocoa powder

    •3 cups quick cooking oats

    •1 teaspoon vanilla extract

    DIRECTIONS

    1.Mix together sugar, butter or margarine, and milk in a saucepan. Bring to a boil and boil for one minute, stirring constantly.

    2.Remove from heat and mix in cocoa, quick oatmeal and vanilla. Drop by spoonfuls on waxed paper.

    Part 4 – Queries

    Write queries that will return the information requested below. Each query should be numbered and saved into a new file called queries.sql.

    1.How many ingredients are in “Kitchen Sink Cookies”?

    2.What are the names of the three most used ingredients by quantity in all recipes authored by Cara?

    3.What is the name of all recipes that do not use egg as an ingredient?

    4.List all ingredient names in the database sorted by name. Exclude duplicates.

    5.What are the directions, in order of the steps, for “No Bake Cookies II”?

    6.What is the second word of each recipe title?

    I'm a little bit confused do i enter it like:

    CREATE TABLE recipe ( recipe_name varchar(100), recipe varchar(MAX))

    GO

    insert into recipe values ('Kitchen Sink Cookies',

    'Kitchen Sink Cookies

    Submitted By: Cara

    Reference: allrecipes.com (http://allrecipes.com/Recipe/Kitchen-Sink-Cookies/Detail.aspx)

    INGREDIENTS

    1 cup butter, softened

    2 cups packed brown sugar

    2 eggs

    2 teaspoons vanilla extract

    2 1/3 cups all-purpose flour

    1 teaspoon baking soda

    1 teaspoon salt

    2 cups rolled oats

    1 cup semisweet chocolate chips

    1 cup vanilla baking chips

    1/2 cup butterscotch chips

    1 cup chopped pecans

    DIRECTIONS

    1. Preheat the oven to 375 degrees F (190 degrees C).

    2. In a large bowl, cream together the butter and brown sugar until smooth. Beat in the eggs one at a time, then stir in the vanilla. Combine the flour, baking soda and salt; stir into the creamed mixture. Mix in the oats, chocolate chips, vanilla chips, butterscotch chips and chopped pecans. Drop by tablespoonfuls onto ungreased cookie sheets. Cookies should be at least 2 inches apart.

    3. Bake for 8 to 10 minutes in the preheated oven. Allow cookies to cool on baking sheet for 5 minutes before removing to a wire rack to cool completely.')

    go

    insert into recipe values ('No Bake Cookies II ',

    'No Bake Cookies II

    Submitted By: Sandy

    Reference: allrecipes.com (http://allrecipes.com/Recipe/No-Bake-Cookies-II/Detail.aspx)

    INGREDIENTS

    • 2 cups white sugar

    • 1/2 cup butter

    • 1/2 cup milk

    • 3 tablespoons cocoa powder

    • 3 cups quick cooking oats

    • 1 teaspoon vanilla extract

    DIRECTIONS

    1. Mix together sugar, butter or margarine, and milk in a saucepan. Bring to a boil and boil for one minute, stirring constantly.

    2. Remove from heat and mix in cocoa, quick oatmeal and vanilla. Drop by spoonfuls on waxed pape');

  • We can't directly do homework or other coursework for you. However, we can give you general pointers.

    First you need to design tables to hold data. Each table should be for one specific type of data. You seem to have a good understanding of that part of it.

    Each column in every table should be *1* piece of information. For example, a quantity should probably be separated from the item itself. But procedural text -- do a, then do b, etc. -- usually needs broken up only by the step numbers, not within a step, even if there are several values in the step.

    That last process can be tricky to properly gauge. Use the qs to help guide you to the best design, as you know you will need to be able to write reasonably easy queries at least to satisfy those qs.

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply