DBMS Interview Questions & Answers for Freshers and Experienced
DBMS interview questions with answers covering normalization, indexing, transactions, SQL, and database design concepts.
Top DBMS Interview Questions for Freshers and Experienced Developers
Strengthen your database fundamentals with DBMS interview questions covering normalization, indexing, transactions, SQL queries, and real-world database design problems.
36 Questions2 PagesEasy · Medium · HardPage 2 of 2
1
What is Fully Functional dependency?
Answer
It is based on concept of full functional dependency. A functional dependency X Y is full functional dependency if removal of any attribute A from X means that the dependency does not hold any more.
Did you know it?
2
What is 2NF?
Answer
A relation schema R is in 2NF if it is in 1NF and every non-prime attribute A in R is fully functionally dependent on primary key.
Did you know it?
3
What is 3NF?
Answer
A relation schema R is in 3NF if it is in 2NF and for every FD X A either of the following is true
X is a Super-key of R.
A is a prime attribute of R.
In other words, if every non prime attribute is non-transitively dependent on primary key.
Did you know it?
4
What is BCNF (Boyce-Codd Normal Form)?
Answer
A relation schema R is in BCNF if it is in 3NF and satisfies an additional constraint that for every FD X A, X must be a candidate key.
Did you know it?
5
What is indexing and what are the different kinds of indexing?
Answer
Indexing is a way of sorting a number of records on multiple fields. Creating an index on a field in a table creates another data structure which holds the field value, and pointer to the record it relates to. This index structure is then sorted, allowing Binary Searches to be performed on it.
Types: 1. Binary search style indexing 2. B-Tree indexing 3. Inverted list indexing 4. Memory resident table 5. Table indexing
Did you know it?
6
What is meant by query optimization?
Answer
A query optimizer is a critical database management system (DBMS) component that analyzes Structured Query Language (SQL) queries and determines efficient execution mechanisms. A query optimizer generates one or more query plans for each query, each of which may be a mechanism used to run a query.
Did you know it?
7
What is durability in DBMS?
Answer
In database systems, durability is the ACID property which guarantees that transactions that have committed will survive permanently. For example, if a flight booking reports that a seat has successfully been booked, then the seat will remain booked even if the system crashes.
Did you know it?
8
What do you mean by atomicity and aggregation?
Answer
Atomicity: Either all actions are carried out or none are. Users should not have to worry about the effect of incomplete transactions. DBMS ensures this by undoing the actions of incomplete transactions. Aggregation: A concept which is used to model a relationship between a collection of entities and relationships. It is used when we need to express a relationship among relationships.
Did you know it?
9
What is a Phantom Deadlock?
Answer
In distributed deadlock detection, the delay in propagating local information might cause the deadlock detection algorithms to identify deadlocks that do not really exist. Such situations are called phantom deadlocks and they lead to unnecessary aborts.
Did you know it?
10
What are the different states of transaction?
Answer
A transaction in a database can be in one of the following states ? Active ? In this state, the transaction is being executed. This is the initial state of every transaction. Partially Committed ? When a transaction executes its final operation, it is said to be in a partially committed state. Failed ? A transaction is said to be in a failed state if any of the checks made by the database recovery system fails. A failed transaction can no longer proceed further. Aborted ? If any of the checks fails and the transaction has reached a failed state, then the recovery manager rolls back all its write operations on the database to bring the database back to its original state where it was prior to the execution of the transaction. Transactions in this state are called aborted. The database recovery module can select one of the two operations after a transaction aborts ?
Re-start the transaction
Kill the transaction Committed ? If a transaction executes all its operations successfully, it is said to be committed. All its effects are now permanently established on the database system.
Did you know it?
11
What is a query?
Answer
A query is a request for data or information from a database table or combination of tables. This data may be generated as results returned by Structured Query Language (SQL) or as pictorials, graphs or complex results, e.g., trend analyses from data-mining tools.
Did you know it?
12
What is the difference between having and where clause?
Answer
HAVING is used when you are using an aggregate such as GROUP BY . The difference between the two is in the relationship to the GROUP BY clause: WHERE comes before GROUP BY; SQL evaluates the WHERE clause before it groups records. HAVING comes after GROUP BY; SQL evaluates HAVING after it groups records.
Did you know it?
13
What is Join?
Answer
An SQL JOIN clause is used to combine rows from two or more tables, based on a common field between them. INNER JOIN: Returns all rows when there is at least one match in BOTH tables LEFT JOIN: Return all rows from the left table, and the matched rows from the right table RIGHT JOIN: Return all rows from the right table, and the matched rows from the left table FULL JOIN: Return all rows when there is a match in ONE of the tables
Did you know it?
14
What is database Trigger?
Answer
A database trigger is a PL/SQL block that can defined to automatically execute for insert, update, and delete statements against a table. The trigger can e defined to execute once for the entire statement or once for every row that is inserted, updated, or deleted. For any one table, there are twelve events for which you can define database triggers. A database trigger can call database procedures that are also written in PL/SQL.
Did you know it?
15
What is a stored procedure?
Answer
A stored procedure is like a function that contains a set of operations compiled together. It contains a set of operations that are commonly used in an application to do some common database tasks.
Did you know it?
16
What is the difference between Trigger and Stored Procedure?
Answer
A stored procedure is a user defined piece of code written in the local version of PL/SQL, which may return a value (making it a function) that is invoked by calling it explicitly.