Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

SQL Question, please don't use chatgpt which makes no sense Imagine you had a table named 'iron_rich_foods' as indicated below. 10 points Which query would

image text in transcribedimage text in transcribedSQL Question, please don't use chatgpt which makes no sense

Imagine you had a table named 'iron_rich_foods' as indicated below. 10 points Which query would show just the names and milligrams of iron per serving of all iron rich foods that have heme, ordered by the amount of iron per serving in descending order? (Note that many many SQL databases, including SQLite, do not have a boolean data type, and simply treat boolean values as integers, 1 or 0.).... Please note that the answer options for all questions about this data may mistakenly call the 'food' field 'name'... ignore that error - it is the 'food' field we are referring to.** SELECT * FROM iron_rich_foods WHERE has_heme=1 ORDER BY mg_iron_per_serving DESC; SELECT name, mg_iron_per_serving FROM iron_rich_foods WHERE has_heme=1 ORDER BY mg_iron_per_serving DESC; SELECT iron_rich_foods FROM name, mg_iron_per_serving ON has_heme=1 ORDER BY mg_iron_per_serving DESC; SELECT name, AVG(mg_iron_per_serving) FROM iron_rich_foods WHERE has_heme=1 ORDER BY mg_iron_per_serving DESC; Which of the following query would show us a list of foods ordered by * 10 points how much iron they contain irrespective of serving size? SELECT name, iron FROM iron_rich_foods ORDER BY iron DESC; SELECT name, iron FROM iron_rich_foods GROUP BY serving_size ORDER BY iron DESC; SELECT name, iron/serving_size FROM iron_rich_foods ORDER BY iron DESC; SELECT name, iron/serving_size FROM iron_rich_foods GROUP BY serving_size ORDER BY iron DESC; Which of the following queries would tell us how many foods in our data set have heme and how many do not? SELECT COUNT(has_heme=1 AND has_heme=0) FROM iron_rich_foods ORDER BY has_heme; SELECT COUNT(has_heme) FROM iron_rich_foods WHERE has_heme=1 AND has_heme =0; SELECT COUNT(name) FROM iron_rich_foods GROUP BY has_heme; SELECT COUNT(iron_rich_foods) ORDER BY has_heme

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Visual C# And Databases

Authors: Philip Conrod, Lou Tylee

16th Edition

1951077083, 978-1951077082

More Books

Students also viewed these Databases questions

Question

9. Power and politics can be destructive forces in organizations.

Answered: 1 week ago