DBMS Interview Questions

Describe the types of keys?

Post Views: 49,677 There are following types of keys: Primary key: The Primary key is an attribute in a table that can uniquely identify each record in a table. It is compulsory for every table. Candidate key: The Candidate key is an attribute or set of an attribute which can uniquely identify a tuple. The Primary key can be selected from these attributes. Super key: The Super key is a set of attributes which can uniquely identify a tuple. Super…

Read More

What is the difference between a shared lock and exclusive lock?

Post Views: 49,614 Shared lock: Shared lock is required for reading a data item. In the shared lock, many transactions may hold a lock on the same data item. When more than one transaction is allowed to read the data items then that is known as the shared lock. Exclusive lock: When any transaction is about to perform the write operation, then the lock on the data item is an exclusive lock. Because, if we allow more than one transaction…

Read More

What is the 3-Tier architecture?

Post Views: 49,579 The 3-Tier architecture contains another layer between the client and server. Introduction of 3-tier architecture is for the ease of the users as it provides the GUI, which, make the system secure and much more accessible. In this architecture, the application on the client-end interacts with an application on the server which further communicates with the database system.

Read More

What is the difference between a DELETE command and TRUNCATE command?

Post Views: 49,556 DELETE command: DELETE command is used to delete rows from a table based on the condition that we provide in a WHERE clause. DELETE command delete only those rows which are specified with the WHERE clause. DELETE command can be rolled back. DELETE command maintain a log, that’s why it is slow. DELETE use row lock while performing DELETE function. TRUNCATE command: TRUNCATE command is used to remove all rows (complete data) from a table. It is…

Read More

What is stored procedure?

Post Views: 49,554 A stored procedure is a group of SQL statements that have been created and stored in the database. The stored procedure increases the reusability as here the code or the procedure is stored into the system and used again and again that makes the work easy, takes less time in processing and decreases the complexity of the system. So, if you have a code which you need to use again and again then save that code and…

Read More

Explain ACID properties

Post Views: 49,550 ACID properties are some basic rules, which has to be satisfied by every transaction to preserve the integrity. These properties and rules are: ATOMICITY: Atomicity is more generally known as ?all or nothing rule.’ Which implies all are considered as one unit, and they either run to completion or not executed at all. CONSISTENCY: This property refers to the uniformity of the data. Consistency implies that the database is consistent before and after the transaction. ISOLATION: This…

Read More

What is BCNF?

Post Views: 49,554 BCNF stands for Boyce-Codd Normal Form. It is an advanced version of 3NF, so it is also referred to as 3.5NF. BCNF is stricter than 3NF. A table complies with BCNF if it satisfies the following conditions: It is in 3NF. For every functional dependency X->Y, X should be the super key of the table. It merely means that X cannot be a non-prime attribute if Y is a prime attribute.

Read More

What is 3NF?

Post Views: 49,549 3NF stands for Third Normal Form. A database is called in 3NF if it satisfies the following conditions: It is in second normal form. There is no transitive functional dependency. For example: X->Z Where: X->Y Y does not -> X Y->Z so, X->Z

Read More