Database Interview Questions and Answers

Prepare Database interview questions for freshers and experienced candidates. This page includes important questions, answer previews, preparation guidance, related interview topics and cached content for faster page loading.

🗄️
53+ Database questions available

About Database Interview Preparation

database is an organized collection of data typically used to model certain situations. Use this tag if you have questions about designing a database. If it is about a particular database management system, (e.g., MySQL), please use that tag instead

For better preparation, read each question carefully, understand the concept, prepare one real example, and connect your answer with your project or work experience.

Database Questions List

Quick list of important Database interview questions. Detailed answer previews are available below.

  1. What is database?
  2. What is a Database system?
  3. What are the advantages of DBMS?
  4. What are the disadvantage in File Processing System?
  5. Describe the three levels of data abstraction?
  6. Define the "integrity rules"?
  7. What is extension and intension?
  8. What is System R? What are its two major subsystems?
  9. How is the data structure of System R different from the relational structure?
  10. What is Data Independence?
  11. What is a view? How it is related to data independence?
  12. What is Data Model?
  13. What is E-R model?
  14. What is Object Oriented model?
  15. What is an Entity?
  16. What is Data Storage - Definition Language?
  17. What is DML (Data Manipulation Language)?
  18. What is DML Compiler?
  19. What is DDL Interpreter?
  20. What is Record-at-a-time?
  21. What is Set-at-a-time or Set-oriented?
  22. What is Relational Algebra?
  23. What is Relational Calculus?
  24. How does Tuple-oriented relational calculus differ from domain-oriented relational calculus?
  25. What is Fully Functional dependency?
  26. What is 2NF
  27. What is 3NF?
  28. What is BCNF (Boyce-Codd Normal Form)?
  29. What is meant by query optimization?
  30. What is durability in DBMS?

Question 1: What is database?

Answer: A database is a logically coherent collection of data with some inherent meaning, representing some aspect of real world and which is designed, built and populated with data for a specific purpose

View detailed answer →

Question 2: What is a Database system?

Answer: The database and DBMS software together is called as Database system.

View detailed answer →

Question 3: What are the advantages of DBMS?

Answer: Redundancy is controlled. Unauthorised access is restricted. Providing multiple user interfaces. Enforcing integrity constraints. Providing backup and recovery.

View detailed answer →

Question 4: What are the disadvantage in File Processing System?

Answer: Data redundancy and inconsistency. Difficult in accessing data. Data isolation. Data integrity. Concurrent access is not possible. Security Problems.

View detailed answer →

Question 5: Describe the three levels of data abstraction?

Answer: The are three levels of abstraction: Physical level: The lowest level of abstraction describes how data are stored. Logical level: The next higher level of abstraction, describes what data are stored in database and what relationship among those data. View level: The highest level of abstraction describes only part of entire database.

View detailed answer →

Question 6: Define the "integrity rules"?

Answer: There are two Integrity rules. Entity Integrity: States that "Primary key cannot have NULL value" Referential Integrity: States that "Foreign Key can be either a NULL value or should be Primary Key value of other relation.

View detailed answer →

Question 7: What is extension and intension?

Answer: Extension: It is the number of tuples present in a table at any instance. This is time dependent. Intension: It is a constant value that gives the name, structure of table and the constraints laid on it.

View detailed answer →

Question 8: What is System R? What are its two major subsystems?

Answer: System R was designed and developed over a period of 1974-79 at IBM San Jose Research Center. It is a prototype and its purpose was to demonstrate that it is possible to build a Relational System that can be used in a real life environment to solve real life problems, with performance at least comparable to that of existing system.Its two subsystems are Research Storage System Relational Data System.

View detailed answer →

Question 9: How is the data structure of System R different from the relational structure?

Answer: Unlike Relational systems in System R Domains are not supported Enforcement of candidate key uniqueness is optional Enforcement of entity integrity is optional Referential integrity is not enforced

View detailed answer →

Question 10: What is Data Independence?

Answer: Data independence means that "the application is independent of the storage structure and access strategy of data". In other words, The ability to modify the schema definition in one level should not affect the schema definition in the next higher level. Two types of Data Independence: Physical Data Independence: Modification in physical level should not affect the logical level. Logical Data Independence: Modification in logical level should affect the view level.

View detailed answer →

Question 11: What is a view? How it is related to data independence?

Answer: A view may be thought of as a virtual table, that is, a table that does not really exist in its own right but is instead derived from one or more underlying base table. In other words, there is no stored file that direct represents the view instead a definition of view is stored in data dictionary. Growth and restructuring of base tables is not reflected in views. Thus the view can insulate users from the effects of restructuring and growth in the database. Hence accounts for logical data independence.

View detailed answer →

Question 12: What is Data Model?

Answer: A collection of conceptual tools for describing data, data relationships data semantics and constraints.

View detailed answer →

Question 13: What is E-R model?

Answer: This data model is based on real world that consists of basic objects called entities and of relationship among these objects. Entities are described in a database by a set of attributes.

View detailed answer →

Question 14: What is Object Oriented model?

Answer: This model is based on collection of objects. An object contains values stored in instance variables with in the object. An object also contains bodies of code that operate on the object. These bodies of code are called methods. Objects that contain same types of values and the same methods are grouped together into classes.

View detailed answer →

Question 15: What is an Entity?

Answer: It is a 'thing' in the real world with an independent existence.

View detailed answer →

Question 16: What is Data Storage - Definition Language?

Answer: The storage structures and access methods used by database system are specified by a set of definition in a special type of DDL called data storage-definition language.

View detailed answer →

Question 17: What is DML (Data Manipulation Language)?

Answer: This language that enable user to access or manipulate data as organised by appropriate data model. Procedural DML or Low level: DML requires a user to specify what data are needed and how to get those data. Non-Procedural DML or High level: DML requires a user to specify what data are needed without specifying how to get those data.

View detailed answer →

Question 18: What is DML Compiler?

Answer: It translates DML statements in a query language into low-level instruction that the query evaluation engine can understand.

View detailed answer →

Question 19: What is DDL Interpreter?

Answer: It interprets DDL statements and record them in tables containing metadata.

View detailed answer →

Question 20: What is Record-at-a-time?

Answer: The Low level or Procedural DML can specify and retrieve each record from a set of records. This retrieve of a record is said to be Record-at-a-time.

View detailed answer →

Question 21: What is Set-at-a-time or Set-oriented?

Answer: The High level or Non-procedural DML can specify and retrieve many records in a single DML statement. This retrieve of a record is said to be Set-at-a-time or Set-oriented.

View detailed answer →

Question 22: What is Relational Algebra?

Answer: It is procedural query language. It consists of a set of operations that take one or two relations as input and produce a new relation.

View detailed answer →

Question 23: What is Relational Calculus?

Answer: It is an applied predicate calculus specifically tailored for relational databases proposed by E.F. Codd. E.g. of languages based on it are DSL ALPHA, QUEL.

View detailed answer →

Question 24: How does Tuple-oriented relational calculus differ from domain-oriented relational calculus?

Answer: The tuple-oriented calculus uses a tuple variables i.e., variable whose only permitted values are tuples of that relation. E.g. QUEL The domain-oriented calculus has domain variables i.e., variables that range over the underlying domains instead of over relation. E.g. ILL, DEDUCE.

View detailed answer →

Question 25: 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.

View detailed answer →

Question 26: 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.

View detailed answer →

Question 27: 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.

View detailed answer →

Question 28: 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.

View detailed answer →

Question 29: What is meant by query optimization?

Answer: The phase that identifies an efficient execution plan for evaluating a query that has the least estimated cost is referred to as query optimization.

View detailed answer →

Question 30: What is durability in DBMS?

Answer: Once the DBMS informs the user that a transaction has successfully completed, its effects should persist even if the system crashes before all its changes are reflected on disk. This property is called durability.

View detailed answer →

Question 31: 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.

View detailed answer →

Question 32: What do you mean by flat file database?

Answer: It is a database in which there are no programs or user access languages. It has no cross-file capabilities but is user-friendly and provides user-interface management.

View detailed answer →

Question 33: What is "transparent DBMS"?

Answer: It is one, which keeps its Physical Structure hidden from user.

View detailed answer →

Question 34: What is a query?

Answer: A query with respect to DBMS relates to user commands that are used to interact with a data base. The query language can be classified into data definition language and data manipulation language.

View detailed answer →

Question 35: What do you mean by Correlated subquery?

Answer: Subqueries, or nested queries, are used to bring back a set of rows to be used by the parent query. Depending on how the subquery is written, it can be executed once for the parent query or it can be executed once for each row returned by the parent query. If the subquery is executed for each row of the parent, this is called a correlated subquery. A correlated subquery can be easily identified if it contains any references to the parent subquery columns in its WHERE clause. Columns from the subquery cannot be referenced anywhere else in the parent query. The following example demonstrates a non-correlated subquery. Example: Select * Fro...

View detailed answer →

Question 36: What is RDBMS KERNEL?

Answer: Two important pieces of RDBMS architecture are the kernel, which is the software, and the data dictionary, which consists of the system-level data structures used by the kernel to manage the database You might think of an RDBMS as an operating system (or set of subsystems), designed specifically for controlling data access; its primary functions are storing, retrieving, and securing data. An RDBMS maintains its own list of authorized users and their associated privileges; manages memory caches and paging; controls locking for concurrent resource usage; dispatches and schedules user requests; and manages space usage within its table-space stru...

View detailed answer →

Question 37: Which part of the RDBMS takes care of the data dictionary? How?

Answer: Data dictionary is a set of tables and database objects that is stored in a special area of the database and maintained exclusively by the kernel.

View detailed answer →

Question 38: What is the job of the information stored in data-dictionary?

Answer: The information in the data dictionary validates the existence of the objects, provides access to them, and maps the actual physical storage location.

View detailed answer →

Question 39: How do you communicate with an RDBMS?

Answer: You communicate with an RDBMS using Structured Query Language (SQL).

View detailed answer →

Question 40: Define SQL and state the differences between SQL and other conventional programming Languages.

Answer: SQL is a nonprocedural language that is designed specifically for data access operations on normalized relational database structures. The primary difference between SQL and other conventional programming languages is that SQL statements specify what data operations should be performed rather than how to perform them.

View detailed answer →

Question 41: Name the three major set of files on disk that compose a database in Oracle.

Answer: There are three major sets of files on disk that compose a database. All the files are binary. These are 1.) Database files 2.) Control files3.) Redo logs The most important of these are the database files where the actual data resides. The control files and the redo logs support the functioning of the architecture itself. All three sets of files must be present, open, and available to Oracle for any data on the database to be useable. Without these files, you cannot access the database, and the database administrator might have to recover some or all of the database using a backup, if there is one.

View detailed answer →

Question 42: 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.

View detailed answer →

Question 43: What are stored-procedures? And what are the advantages of using them?

Answer: Stored procedures are database objects that perform a user defined operation. A stored procedure can have a set of compound SQL statements. A stored procedure executes the SQL commands and returns the result to the client. Stored procedures are used to reduce network traffic.

View detailed answer →

Question 44: What is Buffer Manager?

Answer: It is a program module, which is responsible for fetching data from disk storage into main memory and deciding what data to be cache in memory.

View detailed answer →

Question 45: What is Transaction Manager?

Answer: It is a program module, which ensures that database, remains in a consistent state despite system failures and concurrent transaction execution proceeds without conflicting.

View detailed answer →

Question 46: What is File Manager?

Answer: It is a program module, which manages the allocation of space on disk storage and data structure used to represent information stored on a disk.

View detailed answer →

Question 47: What is Authorization and Integrity manager?

Answer: It is the program module, which tests for the satisfaction of integrity constraint and checks the authority of user to access data.

View detailed answer →

Question 48: What are stand-alone procedures?

Answer: Procedures that are not part of a package are known as stand-alone because they independently defined. A good example of a stand-alone procedure is one written in a SQL*Forms application. These types of procedures are not available for reference from other Oracle tools. Another limitation of stand-alone procedures is that they are compiled at run time, which slows execution.

View detailed answer →

Question 49: What are cursors give different types of cursors?

Answer: PL/SQL uses cursors for all database information accesses statements. The language supports the use two types of cursors1.) Implicit2.) Explicit

View detailed answer →

Question 50: What is Storage Manager?

Answer: It is a program module that provides the interface between the low-level data stored in database, application programs and queries submitted to the system.

View detailed answer →

Question 51: What is cold backup and hot backup (in case of Oracle)?

Answer: Cold Backup: It is copying the three sets of files (database files, redo logs, and control file) when the instance is shut down. This is a straight file copy, usually from the disk directly to tape. You must shut down the instance to guarantee a consistent copy. If a cold backup is performed, the only option available in the event of data file loss is restoring all the files from the latest backup. All work performed on the database since the last backup is lost. Hot Backup: Some sites (such as worldwide airline reservations systems) cannot shut down the database while making a backup copy of the files. The cold backup is not an ava...

View detailed answer →

Question 52: QUESTIONS ON DATABASE

Answer: Enlist the advantages of normalizing database. What restrictions can you apply when you are creating views?

View detailed answer →

Question 53: What is a relation in DBMS?

Answer: A relation in a database management system is a table or a collection of tables. These tables are used to define the attributes of an entity or data item that satisfies the relation and also exists in the database. A relation is defined by a table, which consists of rows and columns. Rows may be one, two or multiple since a relation can be held by many entities. Rows can also be termed as tuple or record as they are sufficient enough. Columns are the fields or attributes that are the properties of the data items or entities. Columns can be used to make queries to result particular records, that satisfy the query. 

View detailed answer →
Database interview preparation tip: Start with basic definitions, then prepare practical examples, common mistakes, project usage, scenario-based questions and HR discussion points.