What is Deadlock?
A situation in which multiple transactions are waiting for one another to give up locks. Transaction may acquire locks when it's accessing a resource, if one transaction accesses resource A and then B, another transaction accesses resource B and then A, they may hold lock on A and B respectively while waiting for each other to release another lock, thus a deadlock occurs. Database has a deadlock detection algorithm to find such situation and would abort one of the transactions to resolve the deadlock.