SELECT places_libres, tarif INTO @nb_libres, @tarif FROM Spectacle WHERE id_spectacle = 1 ;
-- Vérifier si “SELECT @nb_libres - 2 ;” < 0 alors ROLLBACK ;
UPDATE Spectacle SET places_libres = @nb_libres - 2 WHERE id_spectacle = 1 ;
INSERT INTO Reservation VALUES (1, 1, 2) ;
SELECT Solde INTO @solde FROM Client WHERE id_client = 1 ;
-- Vérifier si “SELECT @solde - 2 * @tarif ;” < 0 alors ROLLBACK ;
UPDATE Client SET Solde = @solde - 2 * @tarif WHERE id_client = 1 ;
COMMIT ;
