Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Help with a PL/SQL assignment

732791Nov 7 2009 — edited Nov 8 2009
I have an open-book assignment to do for a PL/SQL class, but I don't even know where to begin. The assignment is this:

Create a procedure, SHOP_SALES_NUM, to populate BB_SHOP_SALES

-Base tables for the data for the column in BB_SHOP SALES are BB_SHOPPER and BB_BASKET and orderplaced = 1
-Total price is an aggregated calculated field including only product amounts (quantity* price) and does NOT include shipping and tax
-All shoppers are to be processed (HINT: Cursor)

All I've got so far:

CURSOR shop_sales IS
SELECT s.firstname, s.lastname, b.idbasket, b.idshopper, b.quantity, b.subtotal
FROM bb_shopper s, bb_basket b
WHERE orderplaced = 1;
CREATE OR REPLACE PROCEDURE shop_sales_num (
fname IN bb_shopper.firstname%TYPE,
lname IN bb_shopper.lastname%TYPE,
bid IN bb_basket.idbasket%TYPE,
sid IN bb_basket.idshopper%TYPE,
qty IN bb_basket.quantity%TYPE,
sub IN bb_basket.subtotal%TYPE);
IS
BEGIN
UPDATE bb_shop_sales
END;

Obviously, it's incomplete and I don't even know if I'm on the right track. Can anyone help me solve this?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 6 2009
Added on Nov 7 2009
3 comments
900 views