Check out example codes for "savepoint mysql script". It will help you in understanding the concepts better.

Code Example 1

Press CTRL+C to copy SAVEPOINT identifier
ROLLBACK [WORK] TO [SAVEPOINT] identifier
RELEASE SAVEPOINT identifier

Learn ReactJs, React Native from akashmittal.com