Answered step by step
Verified Expert Solution
Question
1 Approved Answer
PLEASE WRITE AN ANSWER IN MYSQL WORKBENCH Use a subquery to calculate the average tax amount from each order if the tax amount is not
PLEASE WRITE AN ANSWER IN MYSQL WORKBENCH
Use a subquery to calculate the average tax amount from each order if the tax amount is not zero, then list the order_ids, customer_id, and tax_amount of the orders with tax amounts higher than the average.
orders table:
Columns:
order_id | int(11) AI PK |
customer_id | int(11) |
order_date | datetime |
ship_amount | decimal(10,2) |
tax_amount | decimal(10,2) |
ship_date | datetime |
ship_address_id | int(11) |
card_type | varchar(50) |
card_number | char(16) |
card_expires | char(7) |
billing_address_id | int(11) |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started