Question
Assignment 6-2: Calculating a Shoppers Total Spending Many of the reports generated from the system calculate the total dollars in a shoppers purchases. Follow these
Assignment 6-2: Calculating a Shoppers Total Spending Many of the reports generated from the system calculate the total dollars in a shoppers purchases. Follow these steps to create a function named TOT_PURCH_SF that accepts a shopper ID as input and returns the total dollars the shopper has spent with Brewbeans. Use the function in a SELECT statement that shows the shopper ID and total purchases for every shopper in the database.
1. Develop and run a CREATE FUNCTION statement to create the TOT_PURCH_SF function. The function code needs a formal parameter for the shopper ID and to sum the TOTAL column of the BB_BASKET table.
2. Develop a SELECT statement, using the BB_SHOPPER table, to produce a list of each shopper in the database and his or her total purchases.
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