SlideShare a Scribd company logo
1 of 37
Download to read offline
Transaction Processing
Transaction Concept
• Collections of operations that form a single
logical unit of work are called transactions.
• A transaction is a unit of program execution
that accesses and possibly updated various
data items.
• Normally, a transaction is initiated by a user
program written in a programming language.
• The transaction consists of all operations
executed between the begin transaction and
end transaction.
To ensure integrity of the data, we require that the
database system maintain the following properties of
the transaction:
These properties are often called the ACID properties.
Transaction State
Serializability
• Conflict Serializabilty (Conflict Equivalence S S’(after Swapping))
• View Serializability ( 3 Conditions R,(R/W (Same output) (W (Final
Value)))
Conflict Serializabilty
Schedule – 3 (A Concurrent schedule equivalent to schedule 1 )
T1
T2
Read(A)
A:=A-50
Write(A)
Read(A)
Temp:=A*0.1;
A:=A-temp
Write(A)
Read(B)
B:=B+50
Write(B)
Read(B)
B:=B+temp
Write(B)
T1
T2
Read(A)
A:=A-50
Write(A)
Read(A)
Temp:=A*0.1;
A:=A-temp
Write(A)
Read(B)
B:=B+50
Write(B)
Read(B)
B:=B+temp
Write(B)
Schedule 5 – Schedule 3 after swapping of a pair of instructions
Deadlock Handling
1. Deadlock Prevention
. Wait-Die Scheme.
. Wound-Wait Scheme.
. Timeout-Based Schemes.
2. Deadlock Detection
3. Deadlock Recovery
Deadlock Prevention
Timeout-Based Schemes
Deadlock Detection And Recovery
Deadlock Detection
Recovery From Deadlock
• Selection of a Victim.
• Rollback.
• Starvation.
Selection of a Victim
Rollback
Starvation
VIEW IN SQL
• SQL CREATE VIEW Statement
• In SQL, a view is a virtual table based on the
result-set of an SQL statement.
• A view contains rows and columns, just like a real
table. The fields in a view are fields from one or
more real tables in the database
• SQL CREATE VIEW Syntax
CREATE VIEW view_name AS
SELECT column_name(s)
FROM table_name
WHERE condition
SQL CREATE VIEW Examples
• The view "Current Product List" lists all active
products (products that are not discontinued)
from the "Products" table. The view is created
with the following SQL:
• CREATE VIEW [Current Product List] AS
SELECT ProductID, ProductName
FROM Products
WHERE Discontinued=No
• We can query the view above as follows:
• SELECT * FROM [Current Product List]
SQL Updating a View
• You can update a view by using the following syntax:
• SQL CREATE OR REPLACE VIEW Syntax
• CREATE OR REPLACE VIEW view_name AS
SELECT column_name(s)
FROM table_name
WHERE condition
• Now we want to add the "Category" column to the
"Current Product List" view. We will update the view
with the following SQL:
• CREATE OR REPLACE VIEW [Current Product List] AS
SELECT ProductID,ProductName,Category
FROM Products
WHERE Discontinued=No
SQL Dropping a View
• You can delete a view with the DROP VIEW
command.
• SQL DROP VIEW Syntax
• DROP VIEW view_name

More Related Content

Similar to DBMS_Chap_09_Transaction.pptx (1).pdf

Ms sql server ii
Ms sql server  iiMs sql server  ii
Ms sql server ii
Iblesoft
 
ms-sql-server-150223140402-conversion-gate02.pptx
ms-sql-server-150223140402-conversion-gate02.pptxms-sql-server-150223140402-conversion-gate02.pptx
ms-sql-server-150223140402-conversion-gate02.pptx
YashaswiniSrinivasan1
 

Similar to DBMS_Chap_09_Transaction.pptx (1).pdf (20)

Getting Started with MySQL II
Getting Started with MySQL IIGetting Started with MySQL II
Getting Started with MySQL II
 
chap 7.ppt(sql).ppt
chap 7.ppt(sql).pptchap 7.ppt(sql).ppt
chap 7.ppt(sql).ppt
 
Introduction to SQLite in Adobe AIR
Introduction to SQLite in Adobe AIRIntroduction to SQLite in Adobe AIR
Introduction to SQLite in Adobe AIR
 
Introduction to Oracle Database.pptx
Introduction to Oracle Database.pptxIntroduction to Oracle Database.pptx
Introduction to Oracle Database.pptx
 
Views
ViewsViews
Views
 
Views
ViewsViews
Views
 
Views
ViewsViews
Views
 
Manipulating data
Manipulating dataManipulating data
Manipulating data
 
Adbms
AdbmsAdbms
Adbms
 
Check Constraints in MySQL 8.0. Presented at pre-FOSDEM MySQL Day 2020
Check Constraints in MySQL 8.0. Presented at pre-FOSDEM MySQL Day 2020Check Constraints in MySQL 8.0. Presented at pre-FOSDEM MySQL Day 2020
Check Constraints in MySQL 8.0. Presented at pre-FOSDEM MySQL Day 2020
 
2° Ciclo Microsoft CRUI 3° Sessione: l'evoluzione delle piattaforme tecnologi...
2° Ciclo Microsoft CRUI 3° Sessione: l'evoluzione delle piattaforme tecnologi...2° Ciclo Microsoft CRUI 3° Sessione: l'evoluzione delle piattaforme tecnologi...
2° Ciclo Microsoft CRUI 3° Sessione: l'evoluzione delle piattaforme tecnologi...
 
Ms sql server ii
Ms sql server  iiMs sql server  ii
Ms sql server ii
 
Android L01 - Warm Up
Android L01 - Warm UpAndroid L01 - Warm Up
Android L01 - Warm Up
 
SQL Views
SQL ViewsSQL Views
SQL Views
 
Views, Triggers, Functions, Stored Procedures, Indexing and Joins
Views, Triggers, Functions, Stored Procedures,  Indexing and JoinsViews, Triggers, Functions, Stored Procedures,  Indexing and Joins
Views, Triggers, Functions, Stored Procedures, Indexing and Joins
 
SQL Tunning
SQL TunningSQL Tunning
SQL Tunning
 
Change tracking
Change trackingChange tracking
Change tracking
 
Sql lite android
Sql lite androidSql lite android
Sql lite android
 
Overview of Oracle database12c for developers
Overview of Oracle database12c for developersOverview of Oracle database12c for developers
Overview of Oracle database12c for developers
 
ms-sql-server-150223140402-conversion-gate02.pptx
ms-sql-server-150223140402-conversion-gate02.pptxms-sql-server-150223140402-conversion-gate02.pptx
ms-sql-server-150223140402-conversion-gate02.pptx
 

Recently uploaded

Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
panagenda
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
FIDO Alliance
 
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
FIDO Alliance
 

Recently uploaded (20)

Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform Engineering
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate Guide
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
 
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
 
Generative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfGenerative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdf
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM Performance
 
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
 
Top 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTop 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development Companies
 
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptxCyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptx
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoft
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
 
الأمن السيبراني - ما لا يسع للمستخدم جهله
الأمن السيبراني - ما لا يسع للمستخدم جهلهالأمن السيبراني - ما لا يسع للمستخدم جهله
الأمن السيبراني - ما لا يسع للمستخدم جهله
 
ChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps Productivity
 
ADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptx
 

DBMS_Chap_09_Transaction.pptx (1).pdf

  • 2. Transaction Concept • Collections of operations that form a single logical unit of work are called transactions. • A transaction is a unit of program execution that accesses and possibly updated various data items. • Normally, a transaction is initiated by a user program written in a programming language. • The transaction consists of all operations executed between the begin transaction and end transaction.
  • 3. To ensure integrity of the data, we require that the database system maintain the following properties of the transaction: These properties are often called the ACID properties.
  • 4.
  • 6.
  • 7.
  • 8. Serializability • Conflict Serializabilty (Conflict Equivalence S S’(after Swapping)) • View Serializability ( 3 Conditions R,(R/W (Same output) (W (Final Value)))
  • 10. Schedule – 3 (A Concurrent schedule equivalent to schedule 1 ) T1 T2 Read(A) A:=A-50 Write(A) Read(A) Temp:=A*0.1; A:=A-temp Write(A) Read(B) B:=B+50 Write(B) Read(B) B:=B+temp Write(B)
  • 11.
  • 12.
  • 14.
  • 15.
  • 16.
  • 17. Deadlock Handling 1. Deadlock Prevention . Wait-Die Scheme. . Wound-Wait Scheme. . Timeout-Based Schemes. 2. Deadlock Detection 3. Deadlock Recovery
  • 19.
  • 20.
  • 24.
  • 25.
  • 26. Recovery From Deadlock • Selection of a Victim. • Rollback. • Starvation.
  • 27. Selection of a Victim
  • 30.
  • 31.
  • 32.
  • 33.
  • 34. VIEW IN SQL • SQL CREATE VIEW Statement • In SQL, a view is a virtual table based on the result-set of an SQL statement. • A view contains rows and columns, just like a real table. The fields in a view are fields from one or more real tables in the database • SQL CREATE VIEW Syntax CREATE VIEW view_name AS SELECT column_name(s) FROM table_name WHERE condition
  • 35. SQL CREATE VIEW Examples • The view "Current Product List" lists all active products (products that are not discontinued) from the "Products" table. The view is created with the following SQL: • CREATE VIEW [Current Product List] AS SELECT ProductID, ProductName FROM Products WHERE Discontinued=No • We can query the view above as follows: • SELECT * FROM [Current Product List]
  • 36. SQL Updating a View • You can update a view by using the following syntax: • SQL CREATE OR REPLACE VIEW Syntax • CREATE OR REPLACE VIEW view_name AS SELECT column_name(s) FROM table_name WHERE condition • Now we want to add the "Category" column to the "Current Product List" view. We will update the view with the following SQL: • CREATE OR REPLACE VIEW [Current Product List] AS SELECT ProductID,ProductName,Category FROM Products WHERE Discontinued=No
  • 37. SQL Dropping a View • You can delete a view with the DROP VIEW command. • SQL DROP VIEW Syntax • DROP VIEW view_name