Beginner SQL question(s)
Posted
by
unit
on Stack Overflow
See other posts from Stack Overflow
or by unit
Published on 2011-02-16T07:17:38Z
Indexed on
2011/02/16
7:25 UTC
Read the original article
Hit count: 149
I am two months in to an intro sql course, it's late at night, and I am drawing a blank. I have two tables, one customers, and one orders. I have to increase any customers credit limit by twenty five percent for all customers who have made two or more orders in which each order is more than the amount of 250.00. I get how to UPDATE CreditLimit * 1.25 and Cust with an order > 250, but how the hell do I get it to check if they have made two orders over 250?
Second question, we are just starting to take subqueries, and I am having a difficult time getting it into my skull. Another question posed by the prof of our class is to increase the credit limit of a customer who has an order that exceeds their credit limit. (Credit limit is on a customers table, order and amount are on an orders table). I then take that customer and UPDATE his CreditLimit +1000. Thanks for any help.
© Stack Overflow or respective owner