Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Securing SQL Server Protecting Your Database From Attackers

Authors: Denny Cherry

2nd Edition

1597499471, 978-1597499477

More Books

Students also viewed these Databases questions

Question

5. Have you stressed the topics relevance to your audience?

Answered: 1 week ago