A query is a single SQL statement that does Select, Update, Insert or Delete of rows.
A transaction is a consecutive sequence of SQL statements (from the application viewpoint) that have the "ACID" properties:
- Atomicity: All statements or none are executed.
- Consistency: Data integrity is always maintained.
- Isolation: Transaction A can never affect Transaction B.
- Durability: Changes that are committed by a transaction persist, even in event of system failure.