diff --git a/task.sql b/task.sql index 8adf22b..9b7af16 100644 --- a/task.sql +++ b/task.sql @@ -7,5 +7,8 @@ USE ShopDB; START TRANSACTION; -- And some data should be created inside the transaction +INSERT INTO Orders (CustomerID, Date) VALUES(1, CURDATE()); +INSERT INTO OrderItems (OrderID, ProductID, Count) VALUES(LAST_INSERT_ID(), 1, 1); +UPDATE Products SET WarehouseAmount = WarehouseAmount - 1 WHERE ID = 1; COMMIT; \ No newline at end of file