Answered step by step
Verified Expert Solution
Question
1 Approved Answer
There is no table data to test the queries. Q5 SQL 30 Points This question is based on the following set of tables modeling the
There is no table data to test the queries.
Q5 SQL 30 Points This question is based on the following set of tables modeling the operations of a restaurant Menu (Item-ld, Price, Description) Ingredient (Item-ld, Food-Id, Quantity) Food (Food-Id,Description. Category,Amount-remaining) Order (Order-ld,Item-ld, Number-ordered) The ingredient table shows which foods are in the menu items. For example, the menu item for "French fries" might correspond to the food-ids of potato, oil and salt. The category of a Food could be vegetable, meat, dairy, etc. Quantity and Amount- remaining are measured in grams. Every order in the restaurant has a unique Order-ld which is associated with all of the ordered items, in the Order table. Q5.1 6 Points Write SQL statements to create a view Vegetarian-Menu that includes only items from the menu that do not contain meat. The columns should be the same as those of Menu. Q5.2 6 Points Explain in plain English the meaning of the following SQL query: SELECT Food.Food-id, count(Item-id) FROM Food LEFT OUTER JOIN Ingredient ON Food.Food-id=Ingredient.Food-id Group BY Food.Food-id Hint: The count of a column containing just null values is zero. Q5.3 6 Points Suppose that I placed an order with order number 1234. Write an SQL query to list each Food-id in my order's items, along with the total quantity of that Food-id. Present the results so that the foods are listed in descending order of total quantity. Note that a Food-id may be an ingredient of multiple items from an orderStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started