Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions task.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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;
-- 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;
Loading