Provide working SOL DML statements for the following database schema and queries
ID: 3724914 • Letter: P
Question
Provide working SOL DML statements for the following database schema and queries EXERCISE CUSTOMER ID,Type, Firstname, Lastname, Address, City) INVENTORY (ID, ItemName, Type, MadelnStore, SupplierName, DailyAverageSold, Price) ORDERSID, Customer FK, Item FK, Quantity, DeliveryDate) 7. Show how many customers live in each city 8. Find customers that are restaurant owners (type) and live in San Diego For each order, find which items have been ordered, how many of each, and ordered by delivery day . Show: item name and quantity 9. 10. Find orders requesting "focaccia" . Show: order id, deliver date and item nameExplanation / Answer
SELECT count(*) FROM CUSTOMER
GROUP BY City
SELECT * FROM CUSTOMER
WHERE Type='Owner' and City = "San Diego"
select INVENTORY.ItemName, ORDERS.Quantity
from ORDERS
INNER JOIN INVENTORY on ORDERS.Item.FK = INVENTORY.ID
ORDER BY ORDERS.DeliveryDate
SELECT ORDERS.ID, ORDERS.DeliveryDate, Inventory.ItemName
FROM ORDERS
INNER JOIN INVENTORY ON ORDERS.Item.FK = INVENTORY.ID AND ORDERS.ItemName = "focaccia"
**Comment for any further queries.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.