Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

H ello, Please help with this. According to the ERD bellow: Task 1: Pull a full

ID: 3591931 • Letter: H

Question

Hello, Please help with this. According to the ERD bellow:

Task 1: Pull a full list of ingredients for a recipe

Write query to SELECT ingredients for a recipe.

Task 2: Pull the kCal content for a recipe

Write query to SELECT kCal content for a recipe

Task 3: Find the recipes that can be prepared in under an hour

Write query to SELECT the recipes that take less than an hour to make

Recipe Recipelngredient Ingredient longint varchar(48) varchar(4000) PK RcpRecipelD longint varchar(64) varchar(128) timestamp int timestamp int PK InglngredientID PK ReclngRecipelngredientID longint FK1 RecIngRecipelD FK2 ReclngingredientID contains used in ingredient:s RcpName RcpDirections RcpPrepTimeMinsint RcpCookTimeMins int RcpTotalTimeMins nt RcpYieldServingsLow int RcpYieldServingsHigh int RcpCalsPerServing int RcpSource RcpSkillLevelID RcpPicturelD RcpCreatec RcpCreatedBy longint ongint varchar(16) varchar(64) timestamp int timestamp ReclngAmount RcplngPreplnfo RcplngCreated RcplngCreatedBy RcplngLastModified RcplngLastModifiedBy IngName IngDescription IngCreated IngCreatedBy IngLastModified IngLastModifiedBy varchar(128) int int timestamp int timestamp SkillLevel PK SkillD longint varchar(16) timestamp SkillDescription SkillCreated SkillCreatedBy SkillLastModified SkillLastModifiedBy as picture details RcpLastModifiedBy int timestamp int Picture PK PicturelD PictureCredit Picture PictureCreated PictureCreatedBy PictureLastModified timestamp PictureLastModifiedBy int longint varchar(128) BLOB timestamp int

Explanation / Answer

Task 1: Pull a full list of ingredients for a recipe

Write query to SELECT ingredients for a recipe.

SELECT I.* from Ingredient I, RecipeIngredient RI, Recipe R

Where I.IngredientID = RI.RcpIngredientID

and RI.RcpingRecipeID = R.RcpRecipeID;

Task 2: Pull the kCal content for a recipe

Write query to SELECT kCal content for a recipe

SELECT RcpRecipeID, RcpName ,RcpCalPerServing/1000 as KCal

from Recipe;

Task 3: Find the recipes that can be prepared in under an hour

Write query to SELECT the recipes that take less than an hour to make

SELECT RcpRecipeID, RcpName

from Recipe

where RcpTotalTimeMins < 60;