Commisions (commisionID INT, EmployeeID, amount INT, created Datetime)
Sales (saleID INT, EmployeeID, amount INT, created datetime)
The summary table:
Employee (employeeID, totalCommisions INT, totalSales INT, created DateTime)
There can be 0 or more rows per employee in both Commissions and Sales tables.
Query#1 The query is to update the Employee table, summing the total commision into the totalCommision column for the employee, and the same for the totalSales.
Query#2 Same as above, but limit the total commission for a given day to $100. So if they earned $150 commission in a day, set the value to $100.