uiz 2 Six points- open slides 1. List and explain the different types of transac
ID: 3728444 • Letter: U
Question
uiz 2 Six points- open slides 1. List and explain the different types of transaction concurrency control 2. Write a SQL update statement to modify the attribute "birthdate" to "79254" in table “staff', with "lastName" of "smith" 3. Write the SQL statement needed to allow multiple inserts of a function name "PI" in into a data base “Math". 4. Write a python connect statement that assigns the data base context to a variable myDb. The database "m42" is located on host "paradiso" and can be accessed by secure user "orion". The password is betelgeuse 5. Correct the syntax and write the returned value of the function DELIMITER CREATE FUNC WAVG (nl INTERGER, n2 INT, n3 CHAR, n4 INTEGER) RETURNS INT DETER BEGIN DCL avg CHARACTER; avg = (n1 +n2*2+n3tn4*4)/8; RET avg; END/ Select WAVG 100, 95, 50, 66);Explanation / Answer
1)
Pessimistic (conservative) concurrency control.
The pessimistic concurrency control delays the transactions if they conflict with other transactions at some time in the future by locking or a time-stamping technique.
Optimistic concurrency control.
According to Kung and Robinson (1981), the optimistic concurrency control, that assumes that the conflict is rare, allows concurrent transactions to proceed without imposing delays to ensure serializability then check conflict only at the end, when a transaction commits. Notice that there is another mechanism, semi-optimistic technique, which uses lock operations in some situations (if they may violate some rules), and does not lock in other circumstances.
2)
UPDATE staff SET birtdate = '79254' WHERE lastname = 'smith';
Note: So many questions posted..answered first 2 . Thank you
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.