Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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 order

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

C++ Database Development

Authors: Al Stevens

1st Edition

1558283579, 978-1558283572

More Books

Students also viewed these Databases questions

Question

What is accrued interest?

Answered: 1 week ago