Question
Based on this textbook: https://www.chegg.com/homework-help/using-searched-case-statements-brewbean-s-application-needs-chapter-3-problem-4hap-solution-9781133947363-exc Problem Using Searched CASE Statements The Brewbeans application needs a block to determine whether a customer is rated HIGH, MID,
Based on this textbook: https://www.chegg.com/homework-help/using-searched-case-statements-brewbean-s-application-needs-chapter-3-problem-4hap-solution-9781133947363-exc
Problem
Using Searched CASE Statements
The Brewbeans application needs a block to determine whether a customer is rated HIGH, MID, or LOW based on his or her total purchases. The block needs to select the total amount of orders for a specified customer, determine the rating, and then display the results onscreen. The code rates the customer HIGH if total purchases are greater than $200, MID if greater than $100, and LOW if $100 or lower. Use an initialized variable to provide the shopper ID.
1. Start SQL Developer, if necessary.
2. Modify the code used in Assignment 3-3 to use a searched CASE statement to check the shoppers total purchase amount and determine the correct rating.
3. Run the block, and verify the results.
4. Enter and run the following code to confirm that the total for this shopper is indeed greater than $200:
SELECT SUM(total)
FROM bb_basket
WHERE idShopper = 22
AND orderplaced = 1
GROUP BY idshopper;
5. Test other shoppers who have a completed order.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started