Customer Employee PK CustomerPhoneKey PK Employeekey CustomerLastName %23 EmployeeLastName CustomerFirstName EmployeeFirstName CustomerAddress1 EmployeeHireDate CustomerAddress2 CustomerCity CustomerState Product CustomerZip PK ProductKey ProductName ProductUnitSize ProductUnitPrice CustomerOrder PK Orderkey OrderDate OrderDetail OrderTime FK CustomerPhoneKey PK OrderDetailkey FK OrderKey FK ProductKey EmployeeKey OrderDetailQuantity OrderDetailPriceCharged Use the ERD of Perfect Pizza database which of a pizza delivery shop to write SQL queries for the following: a) Join the product and the OrderDetail table so that the result contains the product name, product unit size, and product unit price, as well as the charged price. Do it for order 2000. b) List all the order and order details for each order made by the customer with the phone number 2065556623. c) Return the name of the product with the highest price and its price. Use a subquery. d) List any Products that have never been ordered? Use a sub query. e) Which product unit prices are greater than the average unit price? Include the product name, the product price, and the average in the results. Use Subqueries.

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter7: File Handling And Applications
Section: Chapter Questions
Problem 6PE
icon
Related questions
Question

Please do (d) and (e) for me

Customer
Employee
PK CustomerPhoneKey
PK EmployeeKey
CustomerLastName
EmployeeLastName
CustomerFirstName
EmployeeFirstName
CustomerAddress1
EmployeeHireDate
CustomerAddress2
CustomerCity
CustomerState
Product
CustomerZip
PK ProductKey
ProductName
ProductUnitSize
ProductUnitPrice
CustomerOrder
PK Orderkey
OrderDate
OrderDetail
OrderTime
PK OrderDetailkey
FK CustomerPhoneKey
FK Employeekey
FK OrderKey
FK ProductKey
OrderDetailQuantity
OrderDetailPriceCharged
Use the ERD of Perfect Pizza database which of a pizza delivery shop to write SQL queries for
the following:
a) Join the product and the OrderDetail table so that the result contains the product name, product
unit size, and product unit price, as well as the charged price. Do it for order 2000.
b) List all the order and order details for each order made by the customer with the phone number
2065556623.
c) Return the name of the product with the highest price and its price. Use a subquery.
d) List any Products that have never been ordered? Use a sub query.
e) Which product unit prices are greater than the average unit price? Include the product name,
the product price, and the average in the results. Use Subqueries.
Transcribed Image Text:Customer Employee PK CustomerPhoneKey PK EmployeeKey CustomerLastName EmployeeLastName CustomerFirstName EmployeeFirstName CustomerAddress1 EmployeeHireDate CustomerAddress2 CustomerCity CustomerState Product CustomerZip PK ProductKey ProductName ProductUnitSize ProductUnitPrice CustomerOrder PK Orderkey OrderDate OrderDetail OrderTime PK OrderDetailkey FK CustomerPhoneKey FK Employeekey FK OrderKey FK ProductKey OrderDetailQuantity OrderDetailPriceCharged Use the ERD of Perfect Pizza database which of a pizza delivery shop to write SQL queries for the following: a) Join the product and the OrderDetail table so that the result contains the product name, product unit size, and product unit price, as well as the charged price. Do it for order 2000. b) List all the order and order details for each order made by the customer with the phone number 2065556623. c) Return the name of the product with the highest price and its price. Use a subquery. d) List any Products that have never been ordered? Use a sub query. e) Which product unit prices are greater than the average unit price? Include the product name, the product price, and the average in the results. Use Subqueries.
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Database Functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
Fundamentals of Information Systems
Fundamentals of Information Systems
Computer Science
ISBN:
9781337097536
Author:
Ralph Stair, George Reynolds
Publisher:
Cengage Learning