Self Studies

Databases Test 6

Result Self Studies

Databases Test 6
  • Score

    -

    out of -
  • Rank

    -

    out of -
TIME Taken - -
Self Studies

SHARING IS CARING

If our Website helped you a little, then kindly spread our voice using Social Networks. Spread our word to your readers, friends, teachers, students & all those close ones who deserve to know what you know now.

Self Studies Self Studies
Weekly Quiz Competition
  • Question 1
    1 / -0

    There are three transactions T1, T2. and T3 Transaction T1 has 6 transactions, T2 has 3 transactions and T3 has 4 transactions. Find the number of non-serial schedule?

    Solution

    Total number of schedule possible = \(\frac{{\left( {T_{1} + T_{2} + T_{3}} \right)!}}{{T_{1}!\times T_{2}!\times T_{3}!}} \)

    Total number of schedule possible = \(\frac{{\left( {6 + 3 + 4} \right)!}}{{6!\times 3! \times 4!}} = 60060\)

    Total number of serial schedule possible = \(n!\)

    where n is total number of transaction

    Total number of serial schedules = 3! = 6

    Total number of non-serial schedules = 60060 - 6 = 60054

  • Question 2
    1 / -0

    If wound and wait scheme is considered, which of the following will holds good?

    If T22 requests a data item held by T23

    If T24 requests a data item held by T23

    where '22', '23' and '24' are time stamps in seconds

    Solution

    Concept:

    Ti requests a data item that is held by Tj then

    If TS(Ti)<TS(Tj) abort Tj

    Otherwise, Ti will wait

    Explanation:

    Data item held by T23 and T22 request a data item

    Since T22 < T23, therefore, T23 will rollback

    Data item held by T23 and T24 request a data item

    Since T23 < T24, therefore, T24 will die

    Note:

    TS → Time Stamp

  • Question 3
    1 / -0
    Which property of database transaction create an allusion than only 1 transaction is executed in system in spite of more than one transaction is executed in parallel manner?
    Solution

    ACID Properties:

    A transaction in a database system must maintain Atomicity, Consistency, Isolation, and Durability − commonly known as ACID properties − in order to ensure accuracy, completeness, and data integrity.

    Atomicity − This property states that a transaction must be treated as an atomic unit, that is, either all its operations are executed or none.

    Consistency − The database must remain in a consistent state after any transaction. No transaction should have any adverse effect on the data residing in the database.

    Isolation − In a database system where more than one transaction is being executed simultaneously and in parallel, the property of isolation states that all the transactions will be carried out and executed as if it is the only transaction in the system.

    Durability − The database should be durable enough to hold all its latest updates even if the system fails or restarts.

    Therefore, Isolation is the correct answer.

  • Question 4
    1 / -0

    Consider the following transactions with data items P and Q initialized to zero:

    T1 : read(P)

    read(Q)

    if P = 0 then Q: = Q + 1;

    write (Q);

    T2: read (Q);

    read (P);

    if Q = 0 then P : = P + 1;

    write (P);

    Any non-seral interleaving of T1 and T2 for concurrent execution leads to

    Solution

    Concept:

    Two schedules are said to be conflict equivalent if the order of any two conflicting operations is the same in both the schedules. A schedule S is said to be conflict serializable if it is conflict equivalent to some serial schedule S’.

    Explanation:

    Schedule S:

    T1

    T2

    read(P)

     

     

    read (Q)

     

    read (P)

     

    write (P);

    read(Q)

     

    write (Q);

     

    T1(read(P)) →  T2(write (P)); T2(read (Q)) → T1(write(Q))

    For this, precedence graph contains cycle. So, the concurrent execution of T1 and T2 leads to a non-conflict serializable schedule.

  • Question 5
    1 / -0

    Which of the following statement is/are true?

    I. A transaction writes a data item after it is read by an uncommitted transaction leads to an irrecoverable error in a database system.

    II. Timestamp ordering protocol does not ensure freedom from deadlock

    III. In case of disk crash, Among the ACID property, the durability property fails to make changes successfully in the database
    Solution

    A transaction read a data item after it has been written by an uncommitted transaction leads to an irrecoverable error in a database system.

    ∴ statement I false

    Time stamp ordering protocol ensures freedom from deadlock

    ∴ statement II false

    In the ACID property, the durability property makes changes successfully in the database in case of:

    Power failure, dish crash or operating system crash

    ∴ statement III false

    None of the statements are true therefore answer is option 4
  • Question 6
    1 / -0

    Consider the following schedules:

    Schedule 1:

    T1T2T3
    read(A)  
    read(B)  
    write(A)  
     read(A) 
     write(A) 
      read(A)
    abort  

     

    Schedule 2:

    T1T2T3
    read(A)  
    read(B)  
    write(A)  
    commit  
     read(A) 
     write(A) 
     commit 
      read(A)
      commit

     

    Schedule 3:

    T1T2T3
    read(A)  
    read(B)  
    write(A)  
    commit  
     read(A) 
     write(A) 
      read(A)
     abort 
      commit

     

    Which of the above schedules are cascadeless schedules?

    Solution

    Cascadeless schedule is one where, for each pair of transactions Ti and Tj such that Tj reads a data item previously written by Ti, the commit operation of Ti appears before the read operation of Tj.

    Therefore, only Schedule 2 is the cascadeless schedule.

Self Studies
User
Question Analysis
  • Correct -

  • Wrong -

  • Skipped -

My Perfomance
  • Score

    -

    out of -
  • Rank

    -

    out of -
Re-Attempt Weekly Quiz Competition
Selfstudy
Selfstudy
Self Studies Get latest Exam Updates
& Study Material Alerts!
No, Thanks
Self Studies
Click on Allow to receive notifications
Allow Notification
Self Studies
Self Studies Self Studies
To enable notifications follow this 2 steps:
  • First Click on Secure Icon Self Studies
  • Second click on the toggle icon
Allow Notification
Get latest Exam Updates & FREE Study Material Alerts!
Self Studies ×
Open Now