Search⌘ K
AI Features

Question: Using SAVEPOINT

Understand how to use SAVEPOINT in MySQL transactions to manage partial rollbacks effectively. This lesson guides you through simulating multiple updates on order and product data, marking progress with named savepoints, and selectively undoing changes before a full rollback. You will gain practical skills in controlling transaction execution and ensuring data consistency under concurrent access.

Question

Given the following structure of the Products table:

Field

Type

ProductID

INT

ProductName

VARCHAR(50)

CategoryID

INT

Price

DECIMAL(10,2)

Stock

INT

LastRestockDate

DATE

Where, ProductID is the primary key and CategoryID is the foreign key referencing the Categories table. The table contains information about products available in the store. ...