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
Logical Operators The logical operators AND, NOT, and OR follow the tri-state logic shown in table below. The AND and OR are binary operators; NOT is a unary operator.

Using Subqueries A subquery is a query (typically enclosed by parentheses) that appears within another SQL data manipulation statement. If evaluated, the subquery gives a va

Using Cursor Attributes: Every cursor has 4 attributes: %NOTFOUND, %FOUND, %ISOPEN, and %ROWCOUNT. If appended to the cursor name, they return the helpful information about

Example of Shorthand for a row constraint Example: Shorthand for a row constraint ALTER TABLE EXAM_MARK ADD CONSTRAINT Mark_in_range CHECK (Mark BETWEEN 0 AND 100);

Assignment of Variable - Updating a Variable Syntax: SET SN = SID ('S2'); This can obviously be read as "set the variable SN to be equal in value to SID ( 'S2' )".

Manipulating Collections Within PL/SQL, the collections add procedural power and flexibility. The biggest benefit is that your program can compute subscripts to process the spec

Procedures The procedure is a subprogram which can take parameters and be invoked. Normally, you can use a procedure to perform an action. The procedure has 2 sections: the spe

Parameter and Keyword Description: cursor_name: This identifies an explicit cursor formerly declared within the present scope. cursor_variable_name: These identif

Anatomy of a Command Figure, showing a simple SQL command, is almost identical to its counterpart in the theory book. The only difference arises from the fact that SQL uses a

Need Database Development with Analysis Tools Project Description: I want a database for large governmental and private data sets on one country that can be simply extended t