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
Use the MASCOT tables CREDITRS, PORDS and PAYMENTS to write SQL queries to solve the following business problems. These tables / data are available to you via the USQ Oracle server

UNNEST operator in SQL The inverse operator of GROUP is UNGROUP. SQL has an operator, UNNEST, that can be used for similar purposes, but its method of invocation is somewhat p

Special cases of projection This section describes the identity projection, r {ALL BUT}, and the projection on no attributes, r { }, which yields TABLE_DUM when r is empty, ot

heap sort program in pl/sql

Package Specification The package specifications contain the public declarations. The scopes of these declarations are local to your database representation and global to the

Raise_application_error -  procedure of package DBMS_STANDARD , allows to issue an user_defined error messages by stored sub-program or database trigger.

Object Types An object type is a user-defined complex datatype which encapsulates the data structure along with the functions and procedures required to manipulate the data. Th

Table Represents an Extension - SQL It describes how each tuple in a relation represents a true instantiation of some predicate and each true instantiation is represented by s

EXECUTE IMMEDIATE Statement   The EXECUTE IMMEDIATE statement prepare (parses) and instantly executes a dynamic SQL statement or an anonymous PL/SQL block. Syntax:

SQLs counterpart of the key words: The text from the opening parenthesis to the end of the fourth line specifies the declared type of the table, meaning that every table ever