Question
In SQL develop a new database with one table called customer with columns ID, NAME, TOTALPURCHASES, and RANK. Once the table is created add 10
In SQL develop a new database with one table called customer with columns ID, NAME, TOTALPURCHASES, and RANK. Once the table is created add 10 records using ID 1-10, arbitrary names and also total purchases that range between $100.00 to $1000.00 and leave the rank column blank. Once this is completed add two stored procedures:
1. The first procedure is set all "rank" values to null.
2. The second procedure inserts 'less than average' in the rank field of records with totalpurchases less than the average of all totalpurchases, and 'more than average' for those with totalpurchases more than average.
PLEASE SHOW THE PROCEDURES USED.
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