You really need to do some more research into the
EXISTS
operator, and use what you have learned earlier about using it versus a
JOIN
UPDATE a
SET a.Account_Balance = a.Account_Balance * 1.1
FROM Account a
INNER JOIN Has h ON a.Account_Number = h.Account_Number
WHERE h.Cust_ID = 3
The beauty of using a
JOIN
statement for the
UPDATE
is the ability to pre-check it easily... simply comment out the
UPDATE...SET
lines in the above query and add in a simple
SELECT
like this to see what rows will be affected and before/after values; like this
SELECT h.Cust_ID, a.Account_Balance, NewBalance = a.Account_Balance * 1.1
FROM Account a
INNER JOIN Has h ON a.Account_Number = h.Account_Number
WHERE h.Cust_ID = 3