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 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
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