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
Get step-by-step solutions from verified subject matter experts
