Photo by Caspar Camille Rubin on Unsplash
Transactions are intended primarily to improve data integrity, but they can also improve performance when used appropriately
The DATEDIFF function in SQL can be slow. Replacing it with CURDATE can often help performance on complex queries.