Transactional database

Ahsan Abbasi
Ahsan AbbasiSenior Engineer
Transactional database


Database transaction is collection of SQL queries
which forms a logical one task. For transaction to
be completed successfully all SQL queries has to
run successfully



Database should always remain consistent whether
transaction succeeded or failed.



Transaction is implemented in database using SQL
keyword transaction, commit and rollback.
Database is used to store data required by
real life application e.g. Banking,
Healthcare, Finance etc. In order to protect
data and keep it consistent any changes in
this data needs to be done in transaction
so that even in case of failure data remain
in previous state before start of transaction.
There are four important properties of database transactions,
represented by acronym ACID.


A stands for Atomicity, either all steps of transaction
completes or none of them.



C stands for Consistency, transaction must leave database in
consistent state even if it succeed or rollback.



I is for Isolation. Two database transactions happening at
same time should not affect each other.



D stands for Durability, means saving the data related to
transaction.
To understand database transaction better let's see a
real life example of transaction in database. For
this example we will assume we have an Account
table which represent a Bank Account and we will
transfer money from one account to another
account.
start transaction
select balance from Account where Account Number='9001';
select balance from Account where Account Number='9002';
update Account set balance=balance-900 here Account
Number='9001' ;
update Account set balance=balance+900 here Account
Number='9002' ;
commit; //if all SQL queries succeed
rollback; //if any of SQL queries failed or error
Thank you !!
Any

Question?
1 de 7

Recomendados

Jazmine Kane Portfolio por
Jazmine Kane PortfolioJazmine Kane Portfolio
Jazmine Kane PortfolioJazmine Kane
152 vistas23 diapositivas
Effective data-virtualization-in-the-cloud por
Effective data-virtualization-in-the-cloudEffective data-virtualization-in-the-cloud
Effective data-virtualization-in-the-cloudMenSagam Technologies
410 vistas5 diapositivas
Introduction to Data Modeling por
Introduction to Data ModelingIntroduction to Data Modeling
Introduction to Data Modelingguest02ff4b5
3.5K vistas4 diapositivas
Data Modeling Basics por
Data Modeling BasicsData Modeling Basics
Data Modeling Basicsrenuindia
6.8K vistas23 diapositivas
multi dimensional data model por
multi dimensional data modelmulti dimensional data model
multi dimensional data modelmoni sindhu
6.4K vistas26 diapositivas
Multidimensional data models por
Multidimensional data  modelsMultidimensional data  models
Multidimensional data models774474
10.2K vistas13 diapositivas

Más contenido relacionado

Destacado

Data Modeling Presentations I por
Data Modeling Presentations IData Modeling Presentations I
Data Modeling Presentations Icd_crisci
10.2K vistas88 diapositivas
Data modelling 101 por
Data modelling 101Data modelling 101
Data modelling 101Christopher Bradley
22.4K vistas126 diapositivas
Data models por
Data modelsData models
Data modelsAnuj Modi
18.8K vistas10 diapositivas
Database : Relational Data Model por
Database : Relational Data ModelDatabase : Relational Data Model
Database : Relational Data ModelSmriti Jain
15.3K vistas25 diapositivas
Data base management system por
Data base management systemData base management system
Data base management systemNavneet Jingar
32K vistas37 diapositivas
Data Modeling PPT por
Data Modeling PPTData Modeling PPT
Data Modeling PPTTrinath Raavi
81.2K vistas16 diapositivas

Destacado(10)

Data Modeling Presentations I por cd_crisci
Data Modeling Presentations IData Modeling Presentations I
Data Modeling Presentations I
cd_crisci10.2K vistas
Data models por Anuj Modi
Data modelsData models
Data models
Anuj Modi18.8K vistas
Database : Relational Data Model por Smriti Jain
Database : Relational Data ModelDatabase : Relational Data Model
Database : Relational Data Model
Smriti Jain15.3K vistas
Data base management system por Navneet Jingar
Data base management systemData base management system
Data base management system
Navneet Jingar32K vistas
Data Modeling PPT por Trinath Raavi
Data Modeling PPTData Modeling PPT
Data Modeling PPT
Trinath Raavi81.2K vistas
DATA WAREHOUSING por King Julian
DATA WAREHOUSINGDATA WAREHOUSING
DATA WAREHOUSING
King Julian232.8K vistas
Data mining slides por smj
Data mining slidesData mining slides
Data mining slides
smj130.9K vistas
Data Warehousing and Data Mining por idnats
Data Warehousing and Data MiningData Warehousing and Data Mining
Data Warehousing and Data Mining
idnats112.7K vistas

Similar a Transactional database

Sistem manajemen basis data 8 por
Sistem manajemen basis data   8Sistem manajemen basis data   8
Sistem manajemen basis data 8Universitas Putera Batam
1.3K vistas16 diapositivas
ACID Properties in DBMS.docx por
ACID Properties in DBMS.docxACID Properties in DBMS.docx
ACID Properties in DBMS.docxantonymwangi31
10 vistas4 diapositivas
Acid properties por
Acid propertiesAcid properties
Acid propertiesNomitaKumawat
463 vistas6 diapositivas
Transaction Properties in database | ACID Properties por
Transaction Properties in database | ACID PropertiesTransaction Properties in database | ACID Properties
Transaction Properties in database | ACID Propertiesnomanbarki
3.4K vistas10 diapositivas
dokumen.tips_silberschatz-korth-and-sudarshan1-transactions-transaction-conce... por
dokumen.tips_silberschatz-korth-and-sudarshan1-transactions-transaction-conce...dokumen.tips_silberschatz-korth-and-sudarshan1-transactions-transaction-conce...
dokumen.tips_silberschatz-korth-and-sudarshan1-transactions-transaction-conce...DrCViji
14 vistas48 diapositivas
Restoration and-concurrency-database por
Restoration and-concurrency-databaseRestoration and-concurrency-database
Restoration and-concurrency-databaseraima sen
98 vistas7 diapositivas

Similar a Transactional database (20)

Transaction Properties in database | ACID Properties por nomanbarki
Transaction Properties in database | ACID PropertiesTransaction Properties in database | ACID Properties
Transaction Properties in database | ACID Properties
nomanbarki3.4K vistas
dokumen.tips_silberschatz-korth-and-sudarshan1-transactions-transaction-conce... por DrCViji
dokumen.tips_silberschatz-korth-and-sudarshan1-transactions-transaction-conce...dokumen.tips_silberschatz-korth-and-sudarshan1-transactions-transaction-conce...
dokumen.tips_silberschatz-korth-and-sudarshan1-transactions-transaction-conce...
DrCViji14 vistas
Restoration and-concurrency-database por raima sen
Restoration and-concurrency-databaseRestoration and-concurrency-database
Restoration and-concurrency-database
raima sen98 vistas
Spring Transaction por patinijava
Spring TransactionSpring Transaction
Spring Transaction
patinijava2.8K vistas
Dbms sixth chapter_part-1_2011 por sumit_study
Dbms sixth chapter_part-1_2011Dbms sixth chapter_part-1_2011
Dbms sixth chapter_part-1_2011
sumit_study5.3K vistas
Transaction Processing Concept por Nishant Munjal
Transaction Processing ConceptTransaction Processing Concept
Transaction Processing Concept
Nishant Munjal5.4K vistas
DBMS-chap 2-Concurrency Control por Mukesh Tekwani
DBMS-chap 2-Concurrency ControlDBMS-chap 2-Concurrency Control
DBMS-chap 2-Concurrency Control
Mukesh Tekwani28.4K vistas
Job Opportunity por Sunny Saini
Job OpportunityJob Opportunity
Job Opportunity
Sunny Saini198 vistas
transactionprocessingsystem-161006153930.pdf por DipakRathod48
transactionprocessingsystem-161006153930.pdftransactionprocessingsystem-161006153930.pdf
transactionprocessingsystem-161006153930.pdf
DipakRathod4811 vistas

Último

IRL - Screenplay por
IRL - ScreenplayIRL - Screenplay
IRL - Screenplaymediastudiesf1n34rts
18 vistas9 diapositivas
Retail Store Scavenger Hunt.pdf por
Retail Store Scavenger Hunt.pdfRetail Store Scavenger Hunt.pdf
Retail Store Scavenger Hunt.pdfRoxanneReed
43 vistas10 diapositivas
WATCH THIS YOUTUBE VIDEO por
WATCH THIS YOUTUBE VIDEOWATCH THIS YOUTUBE VIDEO
WATCH THIS YOUTUBE VIDEOolakanmijoel24
11 vistas1 diapositiva
https://pin.it/1TgD6Uq por
https://pin.it/1TgD6Uqhttps://pin.it/1TgD6Uq
https://pin.it/1TgD6Uqbestoto
5 vistas1 diapositiva
What Makes an Excellent Short Film por
What Makes an Excellent Short FilmWhat Makes an Excellent Short Film
What Makes an Excellent Short FilmHampton Luzak
5 vistas5 diapositivas
Free eBook ~ 200 GREAT PUNS.pdf por
Free eBook ~ 200 GREAT PUNS.pdfFree eBook ~ 200 GREAT PUNS.pdf
Free eBook ~ 200 GREAT PUNS.pdfOH TEIK BIN
19 vistas33 diapositivas

Último(13)

Retail Store Scavenger Hunt.pdf por RoxanneReed
Retail Store Scavenger Hunt.pdfRetail Store Scavenger Hunt.pdf
Retail Store Scavenger Hunt.pdf
RoxanneReed43 vistas
https://pin.it/1TgD6Uq por bestoto
https://pin.it/1TgD6Uqhttps://pin.it/1TgD6Uq
https://pin.it/1TgD6Uq
bestoto5 vistas
What Makes an Excellent Short Film por Hampton Luzak
What Makes an Excellent Short FilmWhat Makes an Excellent Short Film
What Makes an Excellent Short Film
Hampton Luzak5 vistas
Free eBook ~ 200 GREAT PUNS.pdf por OH TEIK BIN
Free eBook ~ 200 GREAT PUNS.pdfFree eBook ~ 200 GREAT PUNS.pdf
Free eBook ~ 200 GREAT PUNS.pdf
OH TEIK BIN19 vistas
Scratches in the Attic - Script.pdf por ColbyHoltman
Scratches in the Attic - Script.pdfScratches in the Attic - Script.pdf
Scratches in the Attic - Script.pdf
ColbyHoltman5 vistas
LETTERS TO SANTA CLAUS por Judy 1028
LETTERS TO SANTA CLAUSLETTERS TO SANTA CLAUS
LETTERS TO SANTA CLAUS
Judy 102811 vistas
BOOTS PUT FOR SANTA por Judy 1028
BOOTS PUT FOR SANTABOOTS PUT FOR SANTA
BOOTS PUT FOR SANTA
Judy 102810 vistas
JADOO FLIX by Sagar.pptx por getseokey
JADOO FLIX by Sagar.pptxJADOO FLIX by Sagar.pptx
JADOO FLIX by Sagar.pptx
getseokey6 vistas
Perfect Wedding Hub Magazine Nov Edition por rakhiraajan
Perfect Wedding Hub Magazine Nov EditionPerfect Wedding Hub Magazine Nov Edition
Perfect Wedding Hub Magazine Nov Edition
rakhiraajan10 vistas
Lyric Presentation.pdf por ally508153
Lyric Presentation.pdfLyric Presentation.pdf
Lyric Presentation.pdf
ally5081539 vistas

Transactional database

  • 2.  Database transaction is collection of SQL queries which forms a logical one task. For transaction to be completed successfully all SQL queries has to run successfully  Database should always remain consistent whether transaction succeeded or failed.  Transaction is implemented in database using SQL keyword transaction, commit and rollback.
  • 3. Database is used to store data required by real life application e.g. Banking, Healthcare, Finance etc. In order to protect data and keep it consistent any changes in this data needs to be done in transaction so that even in case of failure data remain in previous state before start of transaction.
  • 4. There are four important properties of database transactions, represented by acronym ACID.  A stands for Atomicity, either all steps of transaction completes or none of them.  C stands for Consistency, transaction must leave database in consistent state even if it succeed or rollback.  I is for Isolation. Two database transactions happening at same time should not affect each other.  D stands for Durability, means saving the data related to transaction.
  • 5. To understand database transaction better let's see a real life example of transaction in database. For this example we will assume we have an Account table which represent a Bank Account and we will transfer money from one account to another account. start transaction select balance from Account where Account Number='9001'; select balance from Account where Account Number='9002'; update Account set balance=balance-900 here Account Number='9001' ; update Account set balance=balance+900 here Account Number='9002' ; commit; //if all SQL queries succeed rollback; //if any of SQL queries failed or error