Murach's MySQL 3. Write a script that creates and calls a stored procedure named test. This procedure should use a transaction that includes the statements necessary to combine two musicians. These statements should do the following: Select a row from the Musicians table for the musician with a musician_id value of 6. This statement should lock the row so other transactions can’t read or modify it until the transaction commits, and it should fail immediately if the row is locked from another session. Update the Orders table so any orders for the selected musician are assigned to the musician with a musician_id value of 3. Update the Addresses table so any addresses for the selected musician are assigned to the musician with a musician_id value of 3. Delete the selected musician from the Musicians table. If these statements execute successfully, commit the changes. Otherwise, rollback the changes
Murach's MySQL
3. Write a script that creates and calls a stored procedure named test. This procedure
should use a transaction that includes the statements necessary to combine two
musicians. These statements should do the following:
Select a row from the Musicians table for the musician with a musician_id value of 6.
This statement should lock the row so other transactions can’t read or modify it until
the transaction commits, and it should fail immediately if the row is locked from
another session.
Update the Orders table so any orders for the selected musician are assigned to the
musician with a musician_id value of 3.
Update the Addresses table so any addresses for the selected musician are assigned to
the musician with a musician_id value of 3.
Delete the selected musician from the Musicians table.
If these statements execute successfully, commit the changes. Otherwise, rollback the
changes.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps