Insert into

how i can write a query that will create tables to support recipes? see below.

Ok, i know how to write simple insert into statement (insert into table_name  values ('cookies','sugar')) but i am not sure how i insert the following in to table

there are two recipes for Cookies and I have no idea how to insert direction in to the table? i know there will be two table Kitchen_Sink_Cookies and No_Bake_Cookies. Also i am not sure how to insert reference as website???? no idea at all.
 
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.


Your help will be greatly appreciated.

Thank you,

Hiren Nakum
hnakumAsked:
Who is Participating?
 
elimesikaCommented:
HI

You need 3 tables for that , one for general info , one for ingredients and one for directions.
See sample code below.

Enjoy
/* main table */
create table RECIPES (
recipe_name varchar(255) NOT NULL primary key,
/* type = Kitchen_Sink_Cookies or No_Bake_Cookies */
recipe_type varchar(255) NOT NULL, 
submitted_by varchar(255),
reference varchar(max)
)

/* INGREDIENTS table , define FK to RECIPES on recipe_name */
/* recipe_name + step are PK */
create table INGREDIENTS (
recipe_name varchar(255) NOT NULL,
step int NOT NULL,
ingredient  varchar(max) NOT NULL
)

/* DIRECTIONS table , define FK to RECIPES on recipe_name */
/* recipe_name + step are PK */

create table DIRECTIONS (
recipe_name varchar(255) NOT NULL,
step int NOT NULL,
direction varchar(max) NOT NULL
)

Open in new window

0
 
hnakumAuthor Commented:
N/A
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.