Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

NEED SQL CODE PLEASE Please use standard aggregate functions, please refrain from using CASE, WHEN, BETWEEN, THEN clauses if possible For each customer , product

NEED SQL CODE PLEASE

Please use standard aggregate functions, please refrain from using CASE, WHEN, BETWEEN, THEN clauses if possible

For each customer, product, month and state combination, compute (1) the customer's average sale of this product for the given month and state, (2) the customer's average sale for the given month and state, but for all other products (3) the customer's average sale for the given product and state, but for all other months and (4) the average sale of the product and the month but for all other states.

Please find attached a sample of the report should look like (SAMPLE ONLY, NOT CORRECT ANSWER)

image


If reference is needed, please use the data in the google drive link (public access)

https://drive.google.com/file/d/1POS248JsBc66WR1MacyrZMOp_d9vjgzF/view?usp=share_link

Report #1: CUSTOMER PRODUCT MONTH STATE CUST AVG OTHER PROD AVG OTHER MONTH AVG OTHER STATE AVG ======== ======= ==: === Helen Bread Emily Milk === 1 NY 3 NJ ====== 243 1426 ==== 1493 926 199 482 ==== 268 478

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_2

Step: 3

blur-text-image_3

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

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Databases questions

Question

Given find the value of k. es 1 e kx dx = 1 4'

Answered: 1 week ago