SlideShare a Scribd company logo
1 of 4
Justin Andrews
ACSG 552
Chapter 10 Questions

2. The three most common concurrent transaction execution problems are lost updates,
uncommitted data, and inconsistent retrievals.

Concurrency control can help avoid these problems through its ability to coordinate
simultaneous executions of transactions in a multiprocessing database system. This is
accomplished with various methods, including the use of a scheduler and locks.

3. The DBMS component responsible for concurrency control is a scheduler, which is a
process that establishes the order in which the many operations during each transaction
are executed.

5. Database recovery takes place through the use of data in a given transaction log to
recover a database from an inconsistent to a consistent state. A write-ahead-log protocol
ensures that transaction logs are always written before any database data are actually
updated, ensuring that the database can later be recovered to a consistent state. Redundant
transaction logs ensure a physical disk failure will not impair the DBMS’s ability to
recover data. Database buffers are used to store copies of data from physical disks, which
are themselves updated when a transaction updates data, to help speed up operations. The
updated copies of data in the buffers are eventually used to update the data on the
physical disks. Checkpoints are the process in which a DBMS writes updated buffers
onto a disk, with no other requests being executed during it.

Deferred-write techniques delay the update of a physical database, only allowing the
transaction log to update. The database itself will only update after a given transaction
reaches a commit point, which uses information from the transaction log. If the
transaction aborts, no changes will be made, preventing a need to undo the changes.

Write-through techniques differ from deferred-write techniques as they proceed to have
the database updated immediately. When a transaction aborts in this instance, the changes
need to be undone through a ROLLBACK operation.

6. a.   BEGIN TRANSACTION

        UPDATE CUSTOMER
        SET CUS_BALANCE = CUS_BALANCE + ((110 * 0.08) + 110)
         WHERE CUS_CODE = ‘10010’

        UPDATE CUSTOMER
        SET CUS_DATELSTPUR = ‘05/11/10’
         WHERE CUS_CODE = ‘10010’

        UPDATE INVOICE
SET INV_NUMBER = ‘10983’
        WHERE CUS_CODE = ‘10010’

        UPDATE INVOICE
        SET INV_TERMS = ‘30’
         WHERE CUS_CODE = ‘10010’

        UPDATE INVOICE
        SET INV_DATE = ‘05/11/10’
         WHERE CUS_CODE = ‘10010’

        UPDATE INVOICE
        SET INV_TOTAL = (110 * 0.08) + 110
         WHERE CUS_CODE = ‘10010’

        UPDATE INVOICE
        SET INV_STATUS = ‘OPEN’
         WHERE CUS_CODE = ‘10010’

        COMMIT;

6. b.   BEGIN TRANSACTION

        UPDATE CUSTOMER
        SET CUS_BALANCE = CUS_BALANCE – 100
         WHERE CUS_CODE = ‘10983’

        UPDATE CUSTOMER
        SET CUS_DATELSTPMT = ‘06/03/10’
         WHERE CUS_CODE = ‘10983’

        UPDATE PAYMENT
        SET PMT_ID = ‘3428’
         WHERE CUS_CODE = ‘10983’

        UPDATE PAYMENT
        SET PMT_DATE = ‘06/03/10’
         WHERE CUS_CODE = ‘10983’

        UPDATE PAYMENT
        SET PMT_AMT = 100
         WHERE CUS_CODE = ‘10983’

        UPDATE PAYMENT
        SET PMT_TYPE = ‘CASH’
         WHERE CUS_CODE = ‘10983’
COMMIT;

7.
TRANSACTION          TRANSACTION           WAIT/DIE               WOUND/WAIT
REQUESTING           OWNING LOCK           SCHEME                 SCHEME
LOCK
T1 (11194185)        T2 (13582019)         T1 waits until T2 is   T1 rolls back T2.
                                           completed and          T2 is rescheduled
                                           releases its locks.    while using the
                                                                  same time stamp.
T2 (13582019)        T1 (11194185)         T2 rolls back.         T2 waits until T1 is
                                           T2 is rescheduled      completed and
                                           using the same time    releases its locks.
                                           stamp.

8.    1. Table-level lock – Necessary as both the CUSTOMER and INVOICE tables
      are accessed.
      2. Data manipulation – Regarding two instances of editing in the CUSTOMER
      table.
      3. Data manipulation – Regarding five instances of editing in the INVOICE table.
      4. Table-level unlock – For when the data manipulation is finished.

9.    1. Row-level lock – Necessary for modifying information of a single customer in
      the CUSTOMER table.
      2. Row-level lock – Necessary for modifying information of a single invoice in
      the INVOICE table.
      3. Data manipulation – Regarding two instances of editing in the CUSTOMER
      table.
      4. Data manipulation – Regarding five instances of editing in the INVOICE table.
      5. Row-level unlock – For when one is finished modifying the information in the
      CUSTOMER table.
      6. Row-level unlock – For when one is finished modifying the information in the
      INVOICE table.

10.   1. Table-level lock – Necessary as both the CUSTOMER and PAYMENT tables
      are accessed.
      2. Data manipulation – Regarding two instances of editing in the CUSTOMER
      table.
      3. Data manipulation – Regarding four instances of editing in the PAYMENT
      table.
      4. Table-level unlock – For when the data manipulation is finished.

11.   1. Row-level lock – Necessary for modifying information of a single customer in
      the CUSTOMER table.
2. Row-level lock – Necessary for modifying information of a single invoice in
the PAYMENT table.
3. Data manipulation – Regarding two instances of editing in the CUSTOMER
table.
4. Data manipulation – Regarding four instances of editing in the PAYMENT
table.
5. Row-level unlock – For when one is finished modifying the information in the
CUSTOMER table.
6. Row-level unlock – For when one is finished modifying the information in the
PAYMENT table.

More Related Content

What's hot

Biomechanics of knee complex 6 tibiofemoral jt function
Biomechanics of knee complex 6 tibiofemoral jt functionBiomechanics of knee complex 6 tibiofemoral jt function
Biomechanics of knee complex 6 tibiofemoral jt function
Dibyendunarayan Bid
 

What's hot (20)

Why to docker
Why to dockerWhy to docker
Why to docker
 
Apache kafka
Apache kafkaApache kafka
Apache kafka
 
MongoDB Internals
MongoDB InternalsMongoDB Internals
MongoDB Internals
 
Mysql-MHA
Mysql-MHAMysql-MHA
Mysql-MHA
 
Developing Scylla Applications: Practical Tips
Developing Scylla Applications: Practical TipsDeveloping Scylla Applications: Practical Tips
Developing Scylla Applications: Practical Tips
 
Kafka tutorial
Kafka tutorialKafka tutorial
Kafka tutorial
 
Biomechanics of knee complex 6 tibiofemoral jt function
Biomechanics of knee complex 6 tibiofemoral jt functionBiomechanics of knee complex 6 tibiofemoral jt function
Biomechanics of knee complex 6 tibiofemoral jt function
 
Istio service mesh introduction
Istio service mesh introductionIstio service mesh introduction
Istio service mesh introduction
 
Kafka Overview
Kafka OverviewKafka Overview
Kafka Overview
 
Room 3 - 2 - Trần Tuấn Anh - Defending Software Supply Chain Security in Bank...
Room 3 - 2 - Trần Tuấn Anh - Defending Software Supply Chain Security in Bank...Room 3 - 2 - Trần Tuấn Anh - Defending Software Supply Chain Security in Bank...
Room 3 - 2 - Trần Tuấn Anh - Defending Software Supply Chain Security in Bank...
 
Gravity And BOS.pptx
Gravity And BOS.pptxGravity And BOS.pptx
Gravity And BOS.pptx
 
Awesome Traefik - Ingress Controller for Kubernetes - Swapnasagar Pradhan
Awesome Traefik - Ingress Controller for Kubernetes - Swapnasagar PradhanAwesome Traefik - Ingress Controller for Kubernetes - Swapnasagar Pradhan
Awesome Traefik - Ingress Controller for Kubernetes - Swapnasagar Pradhan
 
Istio Service Mesh
Istio Service MeshIstio Service Mesh
Istio Service Mesh
 
Apache Kafka - Overview
Apache Kafka - OverviewApache Kafka - Overview
Apache Kafka - Overview
 
MMUG18 - MySQL Failover and Orchestrator
MMUG18 - MySQL Failover and OrchestratorMMUG18 - MySQL Failover and Orchestrator
MMUG18 - MySQL Failover and Orchestrator
 
Apache Kafka
Apache KafkaApache Kafka
Apache Kafka
 
Apache Kafka Fundamentals for Architects, Admins and Developers
Apache Kafka Fundamentals for Architects, Admins and DevelopersApache Kafka Fundamentals for Architects, Admins and Developers
Apache Kafka Fundamentals for Architects, Admins and Developers
 
Redis vs Memcached
Redis vs MemcachedRedis vs Memcached
Redis vs Memcached
 
6 Nines: How Stripe keeps Kafka highly-available across the globe with Donny ...
6 Nines: How Stripe keeps Kafka highly-available across the globe with Donny ...6 Nines: How Stripe keeps Kafka highly-available across the globe with Donny ...
6 Nines: How Stripe keeps Kafka highly-available across the globe with Donny ...
 
RabbitMQ vs Apache Kafka Part II Webinar
RabbitMQ vs Apache Kafka Part II WebinarRabbitMQ vs Apache Kafka Part II Webinar
RabbitMQ vs Apache Kafka Part II Webinar
 

Similar to Database chapter 10 questions

database management system Chapter 5
database management system Chapter 5database management system Chapter 5
database management system Chapter 5
Mohamad Syazwan
 
E4800 ej501 topic_5_designing_plc_application
E4800 ej501 topic_5_designing_plc_applicationE4800 ej501 topic_5_designing_plc_application
E4800 ej501 topic_5_designing_plc_application
Mohd Sedik
 
PROCEDURE FOR MONTH END DAY 1 INCLUDING SCREEN SHOT & SCRIPTS (Final rev 090211)
PROCEDURE FOR MONTH END DAY 1 INCLUDING SCREEN SHOT & SCRIPTS (Final rev 090211)PROCEDURE FOR MONTH END DAY 1 INCLUDING SCREEN SHOT & SCRIPTS (Final rev 090211)
PROCEDURE FOR MONTH END DAY 1 INCLUDING SCREEN SHOT & SCRIPTS (Final rev 090211)
Shakil Zaman
 

Similar to Database chapter 10 questions (15)

Pl sql-ch2
Pl sql-ch2Pl sql-ch2
Pl sql-ch2
 
1_Transaction.pdf
1_Transaction.pdf1_Transaction.pdf
1_Transaction.pdf
 
Transaction Processing
Transaction ProcessingTransaction Processing
Transaction Processing
 
Transaction
TransactionTransaction
Transaction
 
CH09.ppt
CH09.pptCH09.ppt
CH09.ppt
 
transaction management, concept & State
transaction management, concept & Statetransaction management, concept & State
transaction management, concept & State
 
Sql transacation
Sql transacationSql transacation
Sql transacation
 
DBMS UNIT IV.pptx
DBMS UNIT IV.pptxDBMS UNIT IV.pptx
DBMS UNIT IV.pptx
 
database management system Chapter 5
database management system Chapter 5database management system Chapter 5
database management system Chapter 5
 
Introduction to transaction processing
Introduction to transaction processingIntroduction to transaction processing
Introduction to transaction processing
 
Less09 Data
Less09 DataLess09 Data
Less09 Data
 
Les 10 fl1
Les 10 fl1Les 10 fl1
Les 10 fl1
 
E4800 ej501 topic_5_designing_plc_application
E4800 ej501 topic_5_designing_plc_applicationE4800 ej501 topic_5_designing_plc_application
E4800 ej501 topic_5_designing_plc_application
 
[Altibase] 6 what is the mvcc
[Altibase] 6 what is the mvcc[Altibase] 6 what is the mvcc
[Altibase] 6 what is the mvcc
 
PROCEDURE FOR MONTH END DAY 1 INCLUDING SCREEN SHOT & SCRIPTS (Final rev 090211)
PROCEDURE FOR MONTH END DAY 1 INCLUDING SCREEN SHOT & SCRIPTS (Final rev 090211)PROCEDURE FOR MONTH END DAY 1 INCLUDING SCREEN SHOT & SCRIPTS (Final rev 090211)
PROCEDURE FOR MONTH END DAY 1 INCLUDING SCREEN SHOT & SCRIPTS (Final rev 090211)
 

More from jandrewsxu

Chapter #11 lab
Chapter #11 labChapter #11 lab
Chapter #11 lab
jandrewsxu
 
Chapter #8 lab
Chapter #8 labChapter #8 lab
Chapter #8 lab
jandrewsxu
 
Chapter #4 lab
Chapter #4 labChapter #4 lab
Chapter #4 lab
jandrewsxu
 
Modulation schemes 8
Modulation schemes 8Modulation schemes 8
Modulation schemes 8
jandrewsxu
 
Modulation techniques 7
Modulation techniques 7Modulation techniques 7
Modulation techniques 7
jandrewsxu
 
Bluetooth wi fi wi max 2, 3
Bluetooth wi fi wi max 2, 3Bluetooth wi fi wi max 2, 3
Bluetooth wi fi wi max 2, 3
jandrewsxu
 
Acsg 520 assignment #6 ---
Acsg 520   assignment #6 ---Acsg 520   assignment #6 ---
Acsg 520 assignment #6 ---
jandrewsxu
 
Acsg 520 assignment #4 --
Acsg 520 assignment #4  --Acsg 520 assignment #4  --
Acsg 520 assignment #4 --
jandrewsxu
 
First hw assignment #1 --
First hw assignment #1  --First hw assignment #1  --
First hw assignment #1 --
jandrewsxu
 
Assumptions, applicable measures, er diagram
Assumptions, applicable measures, er diagramAssumptions, applicable measures, er diagram
Assumptions, applicable measures, er diagram
jandrewsxu
 
Data dictionary
Data dictionaryData dictionary
Data dictionary
jandrewsxu
 
Assumptions, and applicable measures
Assumptions, and applicable measuresAssumptions, and applicable measures
Assumptions, and applicable measures
jandrewsxu
 
Final presentation(v5)
Final presentation(v5)Final presentation(v5)
Final presentation(v5)
jandrewsxu
 
Database chapter 11 homework
Database chapter 11 homeworkDatabase chapter 11 homework
Database chapter 11 homework
jandrewsxu
 
Essay #2 ethical considerations
Essay #2   ethical considerationsEssay #2   ethical considerations
Essay #2 ethical considerations
jandrewsxu
 
Midterm paper medical records
Midterm paper   medical recordsMidterm paper   medical records
Midterm paper medical records
jandrewsxu
 
Essay #2 ethical considerations
Essay #2   ethical considerationsEssay #2   ethical considerations
Essay #2 ethical considerations
jandrewsxu
 

More from jandrewsxu (20)

Resume
ResumeResume
Resume
 
Resume
ResumeResume
Resume
 
Chapter #11 lab
Chapter #11 labChapter #11 lab
Chapter #11 lab
 
Chapter #8 lab
Chapter #8 labChapter #8 lab
Chapter #8 lab
 
Chapter #4 lab
Chapter #4 labChapter #4 lab
Chapter #4 lab
 
Modulation schemes 8
Modulation schemes 8Modulation schemes 8
Modulation schemes 8
 
Modulation techniques 7
Modulation techniques 7Modulation techniques 7
Modulation techniques 7
 
Bluetooth wi fi wi max 2, 3
Bluetooth wi fi wi max 2, 3Bluetooth wi fi wi max 2, 3
Bluetooth wi fi wi max 2, 3
 
Acsg 520 assignment #6 ---
Acsg 520   assignment #6 ---Acsg 520   assignment #6 ---
Acsg 520 assignment #6 ---
 
Acsg 520 assignment #4 --
Acsg 520 assignment #4  --Acsg 520 assignment #4  --
Acsg 520 assignment #4 --
 
First hw assignment #1 --
First hw assignment #1  --First hw assignment #1  --
First hw assignment #1 --
 
Journal
JournalJournal
Journal
 
Assumptions, applicable measures, er diagram
Assumptions, applicable measures, er diagramAssumptions, applicable measures, er diagram
Assumptions, applicable measures, er diagram
 
Data dictionary
Data dictionaryData dictionary
Data dictionary
 
Assumptions, and applicable measures
Assumptions, and applicable measuresAssumptions, and applicable measures
Assumptions, and applicable measures
 
Final presentation(v5)
Final presentation(v5)Final presentation(v5)
Final presentation(v5)
 
Database chapter 11 homework
Database chapter 11 homeworkDatabase chapter 11 homework
Database chapter 11 homework
 
Essay #2 ethical considerations
Essay #2   ethical considerationsEssay #2   ethical considerations
Essay #2 ethical considerations
 
Midterm paper medical records
Midterm paper   medical recordsMidterm paper   medical records
Midterm paper medical records
 
Essay #2 ethical considerations
Essay #2   ethical considerationsEssay #2   ethical considerations
Essay #2 ethical considerations
 

Database chapter 10 questions

  • 1. Justin Andrews ACSG 552 Chapter 10 Questions 2. The three most common concurrent transaction execution problems are lost updates, uncommitted data, and inconsistent retrievals. Concurrency control can help avoid these problems through its ability to coordinate simultaneous executions of transactions in a multiprocessing database system. This is accomplished with various methods, including the use of a scheduler and locks. 3. The DBMS component responsible for concurrency control is a scheduler, which is a process that establishes the order in which the many operations during each transaction are executed. 5. Database recovery takes place through the use of data in a given transaction log to recover a database from an inconsistent to a consistent state. A write-ahead-log protocol ensures that transaction logs are always written before any database data are actually updated, ensuring that the database can later be recovered to a consistent state. Redundant transaction logs ensure a physical disk failure will not impair the DBMS’s ability to recover data. Database buffers are used to store copies of data from physical disks, which are themselves updated when a transaction updates data, to help speed up operations. The updated copies of data in the buffers are eventually used to update the data on the physical disks. Checkpoints are the process in which a DBMS writes updated buffers onto a disk, with no other requests being executed during it. Deferred-write techniques delay the update of a physical database, only allowing the transaction log to update. The database itself will only update after a given transaction reaches a commit point, which uses information from the transaction log. If the transaction aborts, no changes will be made, preventing a need to undo the changes. Write-through techniques differ from deferred-write techniques as they proceed to have the database updated immediately. When a transaction aborts in this instance, the changes need to be undone through a ROLLBACK operation. 6. a. BEGIN TRANSACTION UPDATE CUSTOMER SET CUS_BALANCE = CUS_BALANCE + ((110 * 0.08) + 110) WHERE CUS_CODE = ‘10010’ UPDATE CUSTOMER SET CUS_DATELSTPUR = ‘05/11/10’ WHERE CUS_CODE = ‘10010’ UPDATE INVOICE
  • 2. SET INV_NUMBER = ‘10983’ WHERE CUS_CODE = ‘10010’ UPDATE INVOICE SET INV_TERMS = ‘30’ WHERE CUS_CODE = ‘10010’ UPDATE INVOICE SET INV_DATE = ‘05/11/10’ WHERE CUS_CODE = ‘10010’ UPDATE INVOICE SET INV_TOTAL = (110 * 0.08) + 110 WHERE CUS_CODE = ‘10010’ UPDATE INVOICE SET INV_STATUS = ‘OPEN’ WHERE CUS_CODE = ‘10010’ COMMIT; 6. b. BEGIN TRANSACTION UPDATE CUSTOMER SET CUS_BALANCE = CUS_BALANCE – 100 WHERE CUS_CODE = ‘10983’ UPDATE CUSTOMER SET CUS_DATELSTPMT = ‘06/03/10’ WHERE CUS_CODE = ‘10983’ UPDATE PAYMENT SET PMT_ID = ‘3428’ WHERE CUS_CODE = ‘10983’ UPDATE PAYMENT SET PMT_DATE = ‘06/03/10’ WHERE CUS_CODE = ‘10983’ UPDATE PAYMENT SET PMT_AMT = 100 WHERE CUS_CODE = ‘10983’ UPDATE PAYMENT SET PMT_TYPE = ‘CASH’ WHERE CUS_CODE = ‘10983’
  • 3. COMMIT; 7. TRANSACTION TRANSACTION WAIT/DIE WOUND/WAIT REQUESTING OWNING LOCK SCHEME SCHEME LOCK T1 (11194185) T2 (13582019) T1 waits until T2 is T1 rolls back T2. completed and T2 is rescheduled releases its locks. while using the same time stamp. T2 (13582019) T1 (11194185) T2 rolls back. T2 waits until T1 is T2 is rescheduled completed and using the same time releases its locks. stamp. 8. 1. Table-level lock – Necessary as both the CUSTOMER and INVOICE tables are accessed. 2. Data manipulation – Regarding two instances of editing in the CUSTOMER table. 3. Data manipulation – Regarding five instances of editing in the INVOICE table. 4. Table-level unlock – For when the data manipulation is finished. 9. 1. Row-level lock – Necessary for modifying information of a single customer in the CUSTOMER table. 2. Row-level lock – Necessary for modifying information of a single invoice in the INVOICE table. 3. Data manipulation – Regarding two instances of editing in the CUSTOMER table. 4. Data manipulation – Regarding five instances of editing in the INVOICE table. 5. Row-level unlock – For when one is finished modifying the information in the CUSTOMER table. 6. Row-level unlock – For when one is finished modifying the information in the INVOICE table. 10. 1. Table-level lock – Necessary as both the CUSTOMER and PAYMENT tables are accessed. 2. Data manipulation – Regarding two instances of editing in the CUSTOMER table. 3. Data manipulation – Regarding four instances of editing in the PAYMENT table. 4. Table-level unlock – For when the data manipulation is finished. 11. 1. Row-level lock – Necessary for modifying information of a single customer in the CUSTOMER table.
  • 4. 2. Row-level lock – Necessary for modifying information of a single invoice in the PAYMENT table. 3. Data manipulation – Regarding two instances of editing in the CUSTOMER table. 4. Data manipulation – Regarding four instances of editing in the PAYMENT table. 5. Row-level unlock – For when one is finished modifying the information in the CUSTOMER table. 6. Row-level unlock – For when one is finished modifying the information in the PAYMENT table.