Top Database Interview Questions & Answers

5.00 avg. rating (97% score) - 2 votes
database-interview-questions

 

Database is a structured set of data held in a computer, especially one that is accessible in various ways. Organisation of data is an important activity of any company which wants to secure their data or process it to get valuable information out of it. Databases have evolved throughout the ages and with the advances in technology, database management helps organisations to efficiently manage their data while performing multiple tasks with ease.

There are a lot of opportunities for database professionals in the industry. If you want to become an expert in the field, there are various database certification courses that will help you.

Following are some of the commonly-asked Database interview questions to help you crack a job interview:

 

Q1. What is DBMS?

 

Ans. Database Management System (DBMS) is a collection of programs that enables user to store, retrieve, update, and delete information from a database.

 

Q2. What is RDBMS?

 

Ans. Relational Database Management system (RDBMS) is a type of DBMS that is based on the relational model. Data from relational database can be accessed or reassembled in many different ways without having to reorganize the database tables.

 

Q3. What is a ‘record’ in a database?

 

Ans. A ‘record’ is the collection of values/fields of a specific entity.

 

Q4. What is a ‘field’ in a database?

 

Ans. A ‘field’ is an area within a record reserved for a specific piece of data.

 

Q5. What are database languages? What are the types?

 

Ans. Database languages are used to write or create database management system. There are three types: data definition language, data manipulation language and query language.

 

Q6. Name the various relationships of database. Describe briefly.

 

Ans.

One-to-one: Single table having drawn relationship with another table having similar kind of columns.

One-to-many: Two tables having primary and foreign key relation.

Many-to-many: Junction table having many tables related to many tables.

 

Q7. What is ‘normalization’?

 

Ans. Organized data void of inconsistent dependency and redundancy within a database is called ‘normalization.

 

Q8. What are the different type of normalization?

 

Ans. The different types of normalization are – First Formal Form (1NF), Second Normal Form (2NF), and Third Normal Form (2NF).

 

Q9. What is a ‘primary key’?

 

Ans. A ‘primary key’ is a column whose values uniquely identify every row in a table. Primary key values can never be reused.

 

Q10. What is ‘denormalization’?

 

Ans. Boosting up database performance, adding of redundant data which in turn helps rid of complex data is called ‘denormalization’.

 

Q11. What are the conditions to be met for a field to be defined as primary key?

 

Ans.

  1. No two rows can have the same primary key value.
  2. Every row must have a primary key value.
  3. The primary key field cannot be null.
  4. Value in a primary key column can never be modified or updated, if any foreign key refers to that primary key.

 

Q12. What is a ‘composite key’?

 

Ans. A ‘composite key’ is a combination of two or more columns in a table that can be used to uniquely identify each row in the table.

 

Q13. What is a ‘foreign key’?

 

Ans. A ‘foreign key’ is a field (or collection of fields) in one table that uniquely identifies a row of another table or the same table.

 

Q14. What is a ‘unique key’?

 

Ans. Unique key is same as primary with the difference being the existence of null. Unique key field allows one value as NULL value.

 

Q15. What is a ‘cursor’?

 

Ans. A database object which helps in manipulating data row by row representing a result set is called cursor.

 

Q16. What are the different types of cursors? Define

 

Ans.

Dynamic: it reflects changes while scrolling.

Static: doesn’t reflect changes while scrolling and works on recording of snapshot.

Keyset: data modification without reflection of new data is seen.

 

Q17. What is a ‘sub-query’?

 

Ans. A query contained by a query is called sub-query.

 

Q18. What is a ‘view’?

 

Ans. The views are virtual tables. Unlike tables that contain data, views simply contain queries that dynamically retrieve data when used.

 

Q19. What is a materialized view?

 

Ans. Materialized views are also a view but are disk based. Materialized views get updates on specific duration, based upon the interval specified in the query definition. It can be indexed.

 

Q20. Define ‘join’

 

Ans. Joins help in explaining the relation between different tables.

These are some of the popular questions asked in a Database interview. Always be prepared to answer all types of questions — technical skills, interpersonal, leadership or methodology. If you are someone who has recently started your career in database management, you can enrol in a database certification course to get the techniques and skills required to be an expert in the field.

 

About the Author

Hasibuddin Ahmed

Hasibuddin Ahmed

Hasib is a professional writer associated with learning.naukri.com. He has written a number of articles related to technology, marketing, and career on various blogs and websites. As an amateur career guru, he often imparts nuggets of knowledge related to leadership and motivation. He is also an avid reader and passionate about the beautiful game of football.