What is ACID Property in Database? – Interview Question of the Week #066

Today I want to take you all back to the one of the very original database interview questions and answer which I see often discussed in the interview. I have previously written about this ACID properties as well. In my career, I have seen 1000s of the interview. One of my most popular services is to help people with interview questions and answers. I have often observed when interviewer runs out of questions to ask and thinking of the next question, they often ask this question about ACID Property of the database.

Question: What is the ACID Property in Database?

Answer: 

ACID (an acronym for Atomicity, Consistency, Isolation, Durability) is a concept that Database Professionals generally look for when evaluating databases and application architectures. For a reliable database all these four attributes should be achieved. (Reference)

Atomicity is an all-or-none proposition. This property assures that when a transaction involving two or more processes, either all the processes are committed or none of the processes are committed.

Consistency guarantees that a transaction never leaves your database in a half-finished state. This property, either creates an entire new situation or rollback the all the processes to the original situation, but never leaves database in the state which is middle of the two situations.

Isolation keeps transactions separated from each other until they’re finished. This property ensures that two or more transactions are never mixed up with each other, generating incorrect and inconsistent data.

Durability guarantees that the database will keep track of pending changes in such a way that the server can recover from an abnormal termination. This property makes sure that in the event of failure or services restart the data is available in the appropriate state available before the failure.

The ACID property of the database is described in ISO/IEC 10026-1:1992 section 4. Remember this number if you want to impress your interviewer with your knowledge. You know that he is going to ask this question, better be ready to answer this question correct and impress him/her.

Reference: Pinal Dave (https://blog.sqlauthority.com)

ACID, SQL Server
Previous Post
SQL SERVER – Who Changed the Password of SQL Login? – Interview Question of the Week #065
Next Post
SELECT One by Two – Why Does SELECT 1/2 Returns 0 – Interview Question of the Week #067

Related Posts

2 Comments. Leave new

  • Mrinal Kumar
    May 6, 2016 1:09 pm

    Sir, How can I optimize this code? Please help.

    if {condition1} = ‘0’
    begin
    if {condition2} = ‘Yes’
    Begin
    Set @SQLQuery = @SQLQuery + ‘ AND ‘
    end
    else
    begin
    Set @SQLQuery = @SQLQuery + ‘ AND ‘
    end
    end

    Reply
  • ==============================================
    Optimized Answer :-
    ===============================================
    if{condition1=0}
    begin
    Set @SQLQuery = @SQLQuery + ‘And’
    end

    In your if and else clause you are setting executing the same statement “Set @SQLQuery = @SQLQuery + ‘And’ ” so y should we check the the if(Condition = yes)
    ============================================

    Reply

Leave a Reply

Menu
Exit mobile version