Search⌘ K
AI Features

Practice Exercises on ACID

Practice creating and managing SQL transactions that demonstrate ACID principles, including savepoints and rollbacks. Learn how to handle concurrency using appropriate isolation levels and locking techniques to prevent deadlocks and ensure data consistency in multi-transaction environments.

Problem 1

A new supplier, ‘Gadget Innovators’, needs to be added. Write a single transaction to insert ‘Gadget Innovators’ into the Suppliers table and then link this new supplier to the ‘Smartphone’ (ProductID = 2) in the Product_Suppliers table.

MySQL 8.0
-- write your code here

Problem 2

A customer wants to order a ‘Laptop’ (ProductID = 1) and a ‘Smartphone’ ( ...