CBSE Class 12 Informatics Practices Database Transactions PDF
CBSE Class 12 Informatics Practices Database Transactions PDF
com
(vii) SELECT DESIGNATION, SUM(SALARY) ROM DESIG GROUP BY DESIGNATION
HAVING COUNT (*) < 3;
(viii) SELECT SUM(BENIFTS) FROM DESIG HERE DESIGINATION =”salesman”;
CHAPTER -15
DATABASE TRANSACTIONS
Reliability is a quality, which we seek for in everything that we get. The same is applicable to software
and to database. A reliable database system is that which retains our database in a consistent state
despite occurrence of many failures. Database Transaction is the field which requires utmost
consistency. This chapter describes fundamentals of database transactions and its reliable
implementation. A database can be called consistent when it follows ACID properties. A transactions
can be called reliable when it either COMMITed i.e. successfully all its steps are carried out and
changes are permanently reflected in the database or be ROLLBACKed i.e. in case of failures, if
m
transaction cannot be successfully completed then any data changes made by the transaction are
brought back to the state that earlier was prior to the execution of this transaction.
co
KEY POINTS OF THE CHAPTER
TRANSACTION-A set of successive statements that succeed or fail as a group so that all effected
y.
statements of the group are retained or all are discarded are called transactions. When a transaction is
da
done on the database is called database transaction.
COMMIT-This statement is used to end a transaction and make all changes permanent. Until a
to
transaction is committed, other users cannot see the changes made to the database.
ROLLBACK- The ROLLBACK statement is used to end a transaction and undo the work done by
es
that transaction. After ROLLBACK, it looks like that transaction had never begun.
SAVEPOINT-It is point in a transaction, up till which all changes have been saved permanently.
di
! "
!
#
#
4. What to you understand by a database transaction?
Ans. - A database transaction is a logical unit of work that must succeed or fail in its entirely.
5. Why do understand by transaction COMMIT and ROLLBACK?
Ans-COMMITing a transaction means all the steps of a transaction are carried out successfully
and all data changes are made permanent in the database. Transaction ROLLBACK means
transaction has not been finished completely and hence all data changes made by the
transaction in the database if any, are undone and the database returns to the state as it was
before this transaction execution started.
m
8. What TCL commands are supported by SQL?
Ans. -SQL supports following TCL commands
co
BEGIN |START TRANSACTION-Marks the beginning of a transaction
COMMIT-Ends the current transaction by saving database changes and starts a new
transaction. y.
da
ROLLBACK-Ends the current transaction by discarding changes and starts a new
transaction.
to
A. DELETE employees;
tu
B. DESCRIBE employees;
C. ROLLBACK TO SAVEPOINT C;
.s
F. Select MAX(sal)
FROM employees
WHERE department_id=20;
Ans. - C, E
UNSOLVED QUESTIONS
1. What is the benefit of transaction?