0% found this document useful (0 votes)
125 views2 pages

CBSE Class 12 Informatics Practices Database Transactions PDF

This document discusses database transactions and their properties. It defines a transaction as a set of statements that succeed or fail together, to keep the database consistent. Transactions can commit to make all changes permanent, or rollback to undo all changes. The ACID properties ensure transactions are atomic, consistent, isolated, and durable. Key points covered are the use of commit, rollback, savepoints and redo/undo logs to maintain reliability. Unsolved questions ask about the benefits of transactions and their various states.

Uploaded by

Prit Ballar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
125 views2 pages

CBSE Class 12 Informatics Practices Database Transactions PDF

This document discusses database transactions and their properties. It defines a transaction as a set of statements that succeed or fail together, to keep the database consistent. Transactions can commit to make all changes permanent, or rollback to undo all changes. The ACID properties ensure transactions are atomic, consistent, isolated, and durable. Key points covered are the use of commit, rollback, savepoints and redo/undo logs to maintain reliability. Unsolved questions ask about the benefits of transactions and their various states.

Uploaded by

Prit Ballar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Downloaded from www.studiestoday.

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

Brief Summary of the Chapter:

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

ACID- It is an acronym of ATOMOCITY, CONSISTENCY, ISOLATION, DURABILITY


tu

(For Details see SOLVED QUESTIONS.)


SOLVED QUESTIONS
.s
w
w
w

! "

!
#
#
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.

Downloaded from www.studiestoday.com


Downloaded from www.studiestoday.com
6. What do you understand by ACID properties of database transaction?
Ans. -To ensure the data-integrity, the database system maintains the following properties of
transaction. The properties given below are termed as ACID properties-an acronym derived
from the first letter of each of the properties.
(i) Atomicity-This property ensures that either all operations of the transactions are
reflected properly in the database, none are. Atomicity ensures either al-or-none
operations of a transaction are carried out.
(ii) Consistency-This property ensures that database remains in a consistent state before the
start of transaction and after the transaction is over.
(iii) Isolation-Isolation ensures that executing transaction execution in isolation i.e. is
unaware of other transactions executing concurrently in the system.
(iv) Durability-This property ensures that after the successful completion of a transaction i.
e when a transaction COMMITs, the changes made by it to the database persist i. e
remain in the database irrespective of other failures.
7. What the function is of redo and undo logs?
Ans. -Every database has a set of redo log files. It records all change in data including both
committed and uncommitted changes. Undo logs stored roll backed data.

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

SAVEPOINT-Defines breakpoints for the transactions to allow partial rollbacks.


es

SET AUTOCOMMIT-Enables or disable the default autocommit mode.


9. Which two statements complete a transaction?
di

A. DELETE employees;
tu

B. DESCRIBE employees;
C. ROLLBACK TO SAVEPOINT C;
.s

D. GRANT SELECT ON employees TO SCOTT;


w

E. ALTER TABLE employees


w

MODIFY COLUMN sal;


w

F. Select MAX(sal)
FROM employees
WHERE department_id=20;
Ans. - C, E
UNSOLVED QUESTIONS
1. What is the benefit of transaction?

2. What are the five states of the transactions?

3. What will happen when COMMIT statement is issued?

4. What will happen when ROLLBACK statement is issued?

5. How can you start a new transaction?

Downloaded from www.studiestoday.com

You might also like