Database Interview Questions and Answers
Question - 51 : - How to improve query performance using Index hunting?
Answer - 51 : -
Index hunting help in improving query performance by:
- Using a query optimizer to coordinate queries with the workload.
- Observing the performance and effect of index and query distribution.
Question - 52 : - Explain the Primary Key and Composite Key.
Answer - 52 : -
Primary Key is that column of the table whose every row data is uniquely identified. Every row in the table must have a primary key and no two rows can have the same primary key. Primary key value can never be null nor can it be modified or updated.
Composite Key is a form of the candidate key where a set of columns will uniquely identify every row in the table.
Question - 53 : - What do you understand by the Unique key?
Answer - 53 : - A Unique key is the same as the primary key whose every row data is uniquely identified with a difference of null value i.e. Unique key allows one value as a NULL value.
Question - 54 : - What do you understand by Database Triggers?
Answer - 54 : - A set of commands that automatically get executed when an event like Before Insert, After Insert, On Update, On Delete of row occurs in a table is called as Database trigger.
Question - 55 : - Define Stored procedures.
Answer - 55 : - A Stored procedure is a collection of pre-compiled SQL Queries, which when executed denotes a program taking input, process and gives the output.
Question - 56 : - What do you understand by B-Trees?
Answer - 56 : - B-Tree represents the data structure in the form of a tree for external memory that reads and writes large blocks of data. It is commonly used in databases and file systems where all the insertions, deletions, sorting, etc., are done in logarithmic time.
Question - 57 : - Name the different data models that are available for database systems.
Answer - 57 : -
Different data models are:
- Relational model
- Network model
- Hierarchical model
Question - 58 : - Differentiate between ‘DELETE’, ‘TRUNCATE’ and ‘DROP’ commands.
Answer - 58 : -
After the execution of ‘DELETE’ operation, COMMIT and ROLLBACK statements can be performed to retrieve the lost data.
After the execution of ‘TRUNCATE’ operation, COMMIT, and ROLLBACK statements cannot be performed to retrieve the lost data.
‘DROP’ command is used to drop the table or key like the primary key/foreign key.
Question - 59 : - What do you understand about BCNF?
Answer - 59 : -
BCNF refers to the Boyce Codd Normal Form, an advanced version of the third normal form that does not feature overlapping candidate keys.
Question - 60 : - What do you understand about normalization and denormalization?
Answer - 60 : -
A process of eliminating redundant information from the database is known as normalization. Software developers split the table to maintain data integrity and save storage space.