JcGaming

Sql fix

Aug 29th, 2024
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. SELECT Balance FROM Accounts WHERE AccountID = 2;
  2.  
  3. START TRANSACTION;
  4.  
  5. UPDATE Accounts SET Balance = Balance - 1500 WHERE AccountID = 2;
  6.  
  7. INSERT INTO Transactions (AccountID, TransactionType, Amount, TransactionDate)
  8. VALUES (2, 'Withdrawal', 1500, NOW());
  9.  
  10. COMMIT;
  11.  
Advertisement
Add Comment
Please, Sign In to add comment