Calculate the total shopper spending, PL-SQL Programming

Many of the reports generated from the system calculate the total dollars in purchases for a shopper. Complete the following steps to create a function named TOT_PURCH_SF that accepts a shopper id as input and returns the total dollars that the shopper has spent with the company.  Use the function in a SELECT statement that shows the shopper id and total purchases for every shopper in a database.

1. Develop and run a CREATE FUNlculate the Total Shopper Spending CTION 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 from 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 respective totals.

Posted Date: 3/12/2013 2:02:18 AM | Location : United States







Related Discussions:- Calculate the total shopper spending, Assignment Help, Ask Question on Calculate the total shopper spending, Get Answer, Expert's Help, Calculate the total shopper spending Discussions

Write discussion on Calculate the total shopper spending
Your posts are moderated
Related Questions
Write a stored procedure that accepts the post code in which the customer resides as the input parameter. The procedure should then use an explicit cursor to display comprehensive

Project Description: I want to write some SQL statements. The things I need are between pages 5-7. The only problem is that i want it till tomorrow. Skills required is SQL

Declaring Subprograms   You can declare subprograms in any PL/SQL subprogram, block, or package. But, you should declare subprograms at the end of the declarative part after a

Using FIRST and LAST FIRST and LAST return the first and last (minimum and maximum) index numbers in a collection. When the collection is empty, the FIRST and LAST return NULL

Project Description: I want to rebuild it and add better content to it It will include up to 5 forms The data will be saved on SQL server and the data access layer could b

Inserting Objects: You can use the INSERT statement to add objects to an object table. In the illustration below, you insert a Person object into the object table persons:

Opening a Cursor Opening the cursor executes the query & identifies the result set that consists of all rows that meet the query search criteria. For the cursors declared usin

Example of GROUP BY and COLLECT Operator Example: Using GROUP BY and COLLECT to obtain C_ER2 SELECT CourseId, CAST ( COLLECT (ROW (StudentId, Mark)) AS ROW (Studen

How Exceptions Propagate ? Whenever an exception is raised, and if the PL/SQL cannot find a handler for it in the present subprogram or block, the exception propagates. That is

Example of Using Aggregation on Nested Tables Example: How many students sat each exam WITH C_ER AS (SELECT CourseId, CAST (TABLE (SELECT DISTINCT StudentId, Mark FROM EXAM