Question: 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)

Report #1: CUSTOMER PRODUCT MONTH STATE CUST AVG OTHER PROD AVG OTHER


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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!