diff --git a/task.sql b/task.sql index 8adf22b..2aa530a 100644 --- a/task.sql +++ b/task.sql @@ -3,9 +3,10 @@ USE ShopDB; -- Some data should be created outside the transaction (here) --- Start the transaction -START TRANSACTION; - --- And some data should be created inside the transaction - -COMMIT; \ No newline at end of file +-- Start the transaction +START TRANSACTION; +-- And some data should be created inside the transaction +INSERT INTO Orders(CustomerID, Date) VALUE (1, '2023-01-01'); +INSERT INTO OrderItems(OrderID, ProductID, Count) VALUE (1, 1, 1); +UPDATE Products SET WarehouseAmount = WarehouseAmount - 1 WHERE ID = 1 and Name = 'AwersomeProduct'; +COMMIT; \ No newline at end of file