Some examples ROLLBACK and COMIT of how to do transactions in a library database.
You can also practice using SQLFiddle. Here's an example I threw together for transaction rollback. http://sqlfiddle.com/#!18/6be17c/7
Find an open source library system on the net, that is better option coz you can also learn how such system works. School library system may differ one from the other, that makes it hard to actually provide an example, it depends on system design.