I have a GUI where I can add sales to a table SALES. It takes in an EmployeeID and StoreID. When I add a sale, I'd like the SaleAmount to be added to the employee (EMPLOYEE Table) and the store (STORE Table)associated with the sale. I have had no luck searching this elsewhere.
Asked
Active
Viewed 10 times
0
-
1What RDBMS are you using? MySQL, SQLite, SQL-Server? Doing an update with data from a different table is different in each. – Barmar Apr 21 '22 at 18:21
-
DDL - create an insert trigger to do it ... – Patrick Artner Apr 21 '22 at 18:21
-
See https://stackoverflow.com/questions/12394506/mysql-update-table-based-on-another-tables-value for MySQL – Barmar Apr 21 '22 at 18:21
-
@Barmar I'm using MySQL, apologies! – NameNotFound Apr 21 '22 at 18:58