Question: (SQL Query Question) The following image is of a database with the tables listed (Food Name, Food Group, Nutrient Name and Nutrient Amount) {Please ignore

(SQL Query Question) The following image is of a database with the tables listed (Food Name, Food Group, Nutrient Name and Nutrient Amount) {Please ignore any other table, just these 4}

(SQL Query Question) The following image is of a database with the

Kindly write the following SQL queries to retrieve data from the above database:

1. How many foods have unsalt and canned in the name? Show the nutrient value and the unit for Sodium for those foods?

2. Write a query to calculate how many food names in the Baked Products group start with the letters B, C, or D. Write this query using 3 different ways (I did the first option for this query, just needs 2 more)

OPTION 1:

SELECT COUNT(FoodDescription)

FROM foodgroup, foodname

WHERE FoodGroupName = 'Baked Products'

AND foodgroup.FoodGroupID = foodname.FoodGroupID

AND SUBSTR(FoodDescription, 1, 1) IN ('B', 'C', 'D');

3. How many foods are there for the food group 'Spices and Herbs', listed in the database? Show the food group id, the food group name and the foods count.

YIELD NAME YieldID YieldName YieldName YIELD AMOUNT FoodID YieldID YieldAmount YieldDateOfEntry REFUSE NAME RefuselD RefuseName RefuseName REFUSE AMOUNT FoodID Refusel RefuseAmount RefuseDateOfEntry FOOD GROUP FoodGroupID Food Group Code FoodGroupName FoodGroupNameF MEASURE NAME MeasurelD MeasureName MeasureNameF CONVERSION FACTOR FoodID MeasurelD ConversionFactor Value ConvFactor DateOfEntry FOOD NAME FoodID FoodCode FoodGroupID FoodSourceID FoodDescription FoodDescription CountryCode FoodDateOfEntry FoodDateOfPublication ScientificName FOOD SOURCE FoodSourceID FoodSource Code FoodSource Description FoodSource DescriptionF NUTRIENT NAME NutrientNameID NutrientCode NutrientSymbol Unit NutrientName NutrientNameF Tagname Nutrient Decimals NUTRIENT AMOUNT FoodID NutrientNameld Nutrient SourceID Nutrient Value StandardError NumberOfObservation Nutrient DateOfEntry NUTRIENT SOURCE Nutrient SourcelD Nutrient Source Code NutrientSourceDescription NutrientSource DescriptionF

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!