Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

using the appendix, write sql queries to answer the questions Appendix 1. Pizza

ID: 3806750 • Letter: U

Question

using the appendix, write sql queries to answer the questions Appendix 1. Pizza Delivery Shop DB design. Relational schemas. Customer (CustomerPhoneKey (PK), LastName, FirstName, Address1, Address2, City, State, Zip). Customer order(Orderkey [PK], OrderDate, OrderTime, CustomerPhoneKey [FK], EmployeeKeyCFK]). Employee (EmployeeKey [PK], LastName, FirstName, HireDate). Product (ProductKey (PK], ProductName, UnitSize, UnitPrice). OrderDetail (OrderDetailKey [PK], Orderkey IFK], Product Key IFK], Order DetailQuantity, OrderDetailPriceCharged).

Explanation / Answer

f.we use like operator.% means 1 or more charcters

select * from Customer where lastname like 'K%'

g.we have aggregate funtion AVG.

SELECT AVG(UnitPrice) AS PriceAverage FROM Product;

h.wwe have max() function to find highest vallue

select max(UnitPrice) AS HighestPrice FROM Product;