Skip to main content

Posts

Database/DBMS Interview Questions And Answers - Part XIX.

77) What Is Meant By Deadlock In DBMS? Answer:  A deadlocks involves a chain of transactions that are cyclically waiting for each other to release a lock. The DBMS detects deadlock with a transaction dependency graph. It resolves the impasse by sacrificing one of the transactions in cycle. 78) What Are The Three Techniques For Handling Deadlocks? Answer: Three techniques used for handling deadlocks are: Timeouts   Wait for only a system-defined period of time. Deadlock Prevention Order transactions using transaction timestamps. Wait-Die Wound-Wait Deadlock Detection Wait-For Graph 79) How You Can Identify, Prevent & Resolve A Deadlock? Answer:  Detecting and resolving deadlocks as they arise has advantage over taking measures to prevent deadlock, because deadlocks tend to be rare. The lock manager maintains a Waits-For Graph to detect deadlock cycles. DBMS allows deadlock to occur but recognizes occurrences of deadlock and brea...

Database/DBMS Interview Questions And Answers - Part XVIII.

73) What Do You Mean By Serializability In Transaction Processing? Answer:  The objective of Serializability is to find non-serial schedules that allow transactions to execute concurrently without interfering with one another, and thereby produce a database state that could be produce by a serial execution. Example: Two transaction that read data only. Two transactions that read or update separate data item. 74) What Are The Two Methods That Guarantee Serializability? Answer: The two methods that guarantee Serializability are: Two Phase Locking. Timestamping. 75) What Is Locking? What Are The Types Of Locking? Answer: A procedure used to control concurrent access to data. W hen one transaction is accessing the database, a lock may deny access to other transactions to prevent incorrect results. The two types of locking are: Shared lock: If a transaction has a shared lock on a data item, it can read the item but not update it. Exclusive lock: If a transa...

Database/DBMS Interview Questions And Answers - Part XVII.

71) Describe The ACID Properties Of A Transaction? Answer: To ensure integrity of data, the database system must maintain the ACID Properties. Atomicity: A transaction is either performed in its entirety or is not performed at all. Either all operations of the transaction are reflected properly in the database, or none are. It is the responsibility of the recovery subsystem of the DBMS to ensure atomicity. Consistency: A transaction must transform the database from one consistent state to another consistent state. Execution of a transaction in isolation (that is, with no other transaction executing concurrently) preserves the consistency of the database. It is the responsibility of DBMS and the application developer to ensure consistency. Isolation: Transactions execute independently of one another. It is the responsibility of the concurrency control subsystem to ensure isolation. Even though multiple transactions may execute concurrently, the system guarantee...

Database/DBMS Interview Questions And Answers - Part XVI.

68) What Are The Lossless Inference Rules For Functional Dependencies (FD's) Or State The Armstrong's Axioms?  Answer:  Inference rules also known as Armstrong's Axioms are published by Armstrong . These properties are as given below: 1. Reflexivity Property: X -> Y is true if Y is subset of X. 2. Augmentation Property: If X -> Y is true, then  XZ -> YZ is also true. 3. Transitivity Property: If X -> Y and Y -> Z then X -> Z is implied. 4. Union Property: If X -> Y and X -> Z are true, then X -> YZ is also true. This property indicates that if right hand side of FD contains many attributes then FD exists for each of them. 5. Decomposition Property: If X -> Y is implied and Z is subset of Y, then X -> Z is implied. This property is the reverse of union property. 6. PseudoTransitivity Property:  If X -> Y and WY -> Z are given, then XW -> Z is true. 69) What Is Domain-Key...

Database/DBMS Interview Questions And Answers - Part XV.

66) What is Fourth (4th) Normal Form (4NF)? Answer: Fourth normal form eliminates independent many-to-one relationships between columns. To be in Fourth Normal Form: A relation must first be in Boyce-Codd Normal Form. A given relation may not contain more than one Multi-valued attribute. 4NF is defined as a relation that is in Boyce-Codd Normal Form and contains no nontrivial multi-valued dependencies. Example:  67) What is Fifth (5th) Normal Form (5NF)? Answer: A relation decomposes into two relations must have the lossless-join property, which ensures that no spurious tuples are generated when relations are reunited through a natural join operation. However, there are requirements to decompose a relation into more than two relations. Although rare, these cases are managed by join dependency and fifth normal form (5NF). ALSO CHECK THE BELOW FAQ's: 68)  What Are The Lossless Inference Rules For Functional Dependencies (FD's) Or Stat...

Database/DBMS Interview Questions And Answers - Part XIV.

63) What Is Second (2nd) Normal Form (2NF)? Answer: The purpose of second normal form (2NF) is to eliminate partial key dependencies. Each attribute in an entity must depend on the whole key, not just a part of it. Definition: A relation Schema R is in 2NF if every non-prime attribute A in R is fully functionally dependent on the primary key of R. 64) What Is Third (3rd) Normal Form (3NF)? Answer: Third Normal form also helps to eliminate redundant information by eliminating inter dependencies between non-key attributes. Before proceeding to 3NF, check that it is already in 2NF and there are no non-key attributes that depend on another non-key attribute. 65) What Is Boyce-Codd Normal Form (BCNF)? Also Define Multivalued Dependency? Answer: A relation schema R is in Boyce-Codd Normal Form (BCNF) if whenever an FD X -> A holds in R, then X is a superkey of R. Each normal form is strictly stronger than the previous one: Every 2NF relation...

Database/DBMS Interview Questions And Answers - Part XIII.

61)   What Are The Steps Of Normalization? Answer: 62)   What Is First (1st) Normal Form (1NF)? Answer: First normal form (1NF or Minimal Form) is a normal form used in database normalization. A relation R in which the intersection of each row and column contains one and only one value is said to be in 1NF. One has to make sure that the relation should have no non-atomic values. The purpose of first normal form (1NF) is to eliminate repeating groups of attributes in an entity which means disallow composite attributes, multivalued attributes, and nested relations. A table is in 1NF if and only if it satisfies the following conditions: There are no columns with similar or repeated data. Each row is unique i.e. it has a primary key. Each data item cannot be broken down any further. Each field has a unique name. Violation of any of these conditions would mean that the table is not strictly relational, and therefore that it is not in 1NF. The final t...