0

To help increase sales, your management decides to give customers a one-time bonus.

Here are the credit rules:

for 1-15 credits, add 1 credit
for 16-30 credits, add 2 credits
for 31+ credits, add 10% and round up (10% of 35 is 3.5, rounded up to 4)

Write an update statement that uses those rules to add credit to a customer's account.

Save your query as dba1lesson7project2.sql and then hand it in.

This is my project and below is what I have so far but I'M guessing that I've missed the mark by a long shot. Could you please steer me in the right direction? Thanks. The table is CustomerAccounts and the column is CurrentCredit.

update CustomerAccounts
set CurrentCredit = CurrentCredit + 1
where CurrentCredit > 1 and <= 15,

set CurrentCredit = CurrentCredit + 2
where CurrentCredit >15 and <= 30,

set CurrentCredit = CurrentCredit + 10%
where CurrentCredit >= 31;
3
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by d5e5
0

1) are you sure you could write CurrentCredit > 1 AND <= 15 I'm guessing the proper syntax is CurrentCredit > 1 AND CurrentCredit <= 15
2) CurrentCredit + 10% ?? I wouldn't understand it if I were MySql! CurrentCredit*1,1 is more wise.
Did you try your code on a db ?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.