Question
Write the SQL command sequences required to: a) Write the SQL code that will enter CUS_RANK of A for those customers whose balance is less
Write the SQL command sequences required to:
a) Write the SQL code that will enter CUS_RANK of A for those customers whose balance is less than $250
b) Create a temporary table name TEMP_1, whose structure is composed of the CUSTOMER.
c) Copy all rows from CUSTOMER that contain the customers whose balance is in the range from $250 to $500 into the TEMP_1 table.
d) Suppose you were to repeat steps (a), (b) or (c) very frequently, and your company has already established a way of describing customer balances as shown below:
BALANCE | LOW_LIMIT | HIGH_LIMIT |
Bad | 0 | 0 |
Good | 0 | 250 |
Excellent | 250 | +infinity |
How would you introduce this knowledge into the database and make use of it? Write the SQL statements that support your solution to this problem. (Hint: there is no single right answer to this problem).
CUS CODE CUS 10010 Ramas 10011 Dunne 10012 Smith 10013 Olowski 10014 Orlando 10015 O'Brian 10016 Brown 10017 Wliams 10018 Ferriss 10019 Smth 615 713 615 615 615 713 615 615 713 615 $0.00 50.00 $345 86 53675 $0.00 50.00 $221.19 $76893 21655 $0.00 Alfred 844-2573 894-1238 894-2285 894-2180 222-1672 442-3381 297-1228 290-2556 382-7185 297-3809 Myron Gecrge Table name: CUSTOMERStep 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