Calculate the total shopper spending, PL-SQL Programming

Assignment Help:

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.


Related Discussions:- Calculate the total shopper spending

Exception handling, set serveroutput on declare a number(5); b n...

set serveroutput on declare a number(5); b number(5); c number(5); begin a:=&a; b:=&b; c:=a/b; dbms_output.put_line(c); exception when zero_d

%isopen - implicit cursor attributes, %ISOPEN The Oracle closes the SQ...

%ISOPEN The Oracle closes the SQL cursor automatically after executing its related SQL statement. As a result, the %ISOPEN forever yields FALSE.

Rowid - sql pseudocolumns, ROWID The ROWID returns the rowid (binary a...

ROWID The ROWID returns the rowid (binary address) of a row in the database table. You can use the variables of the type UROWID to store rowids in a readable format. In the il

Scope rules - user-defined exceptions, Scope Rules You cannot declare ...

Scope Rules You cannot declare an exception twice in the similar block. Though, you can, declare the similar exception in 2 different blocks. The Exceptions declared in a bloc

Role of abstraction in pl/sql, Role of Abstraction in pl/sql: The abst...

Role of Abstraction in pl/sql: The abstraction is a high-level description or model of a real-world entity. The Abstractions keep our daily lives convenient. They help us ca

produce vertical output format- oracle, Create a Oracle procedure to produ...

Create a Oracle procedure to produce vertical output format when selecting rows from a database table.

Defining ref cursor types, Defining REF CURSOR Types To make cursor va...

Defining REF CURSOR Types To make cursor variables, you take 2 steps. At first, you define a REF CURSOR type, and then declare the cursor variables of that type. You can defin

Using for update, Using FOR UPDATE If you declare a cursor which will ...

Using FOR UPDATE If you declare a cursor which will be referenced in the CURRENT OF clause of an UPDATE or DELETE statement, you should use the FOR UPDATE clause to obtain an

Best practices/Data Warhousing, What are 3 good practices of modeling and/o...

What are 3 good practices of modeling and/or implementing data warehouses?

Goto statement - sequential control, GOTO Statement The GOTO statement b...

GOTO Statement The GOTO statement branches to a label unconditionally. The label must be exclusive within its scope and should precede an executable statement or a PL/SQL block.

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd