Junior
From PDF
SQL
SQL & Databases
What is a transaction in SQL?
Short answer: Can you explain the transaction lifecycle? A transaction in SQL is a sequence of operations performed as a single unit of work. Transactions ensure that database operations are performed atomically. Lifecycle:
Real-world example (ShopNest)
Checkout wraps stock decrement + order insert in a transaction so you never sell stock you do not have.
Say this in the interview
- Define — one clear sentence (the short answer above).
- Example — relate it to a project like ShopNest or your real work.
- Trade-off — when you would not use it.
Share this Q&A
Share preview image: https://www.toolliyo.com/images/toolliyo-logo.png