Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DB2 9 For Linux UNIX And Windows Advanced Database Administration Certification Certification Study Guide

Authors: Roger E. Sanders, Dwaine R Snow

1st Edition

1583470808, 978-1583470800

More Books

Students also viewed these Databases questions

Question

If there were no law against it, would it be OK to blind someone?

Answered: 1 week ago