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;
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.