preloader
DBMS Interview Questions

Top 50+ DBMS Interview Questions and Answers 2022 for Better Preparation

author image

DBMS is a very popular management system and candidates who are going to appear in the job interview can prepare from these DBMS interview questions. Here we have provided questions for all levels DBMS interview questions and answers which have freshers, intermediate, experienced. Prepare from these DBMS interview questions and answers and crack the job interview.

About DBMS: Database Management Systems (DBMS) is a software system used to store, recover, and perform queries on data. A DBMS functions as an interface between an end-user and a database, permitting users to make, read, delete, and update data in the database.

DBMS Interview Questions

1. Explain DBMS?

2. Explain a database?

3. Explain a database system?

4. Tell some advantages of DBMS?

5. Explain checkpoint in DBMS?

6. What does checkpoint do in DBMS?

7. Explain transparent DBMS?

8. Explain unary operations in Relational Algebra?

9. Explain RDBMS?

10. Explain different types of database languages?

11. Explain Data Model?

12. Explain a Relation and a Relation Schema.

13. Explain a degree of Relation?

14. Explain three degrees of relation?

15. Tell some disadvantages of file processing systems?

16. Explain data abstraction in DBMS?

17. Explain the three levels of data abstraction?

18. Explain DDL (Data Definition Language)?

19. Explain DML (Data Manipulation Language)?

20. Tell the functionality of the DML Compiler.

21. Explain Relational Algebra?

22. Explain Relational Calculus?

23. Explain query optimization?

24. Explain durability in DBMS?

25. Explain normalization?

26. Explain Denormalization?

27. Explain functional Dependency?

28. Explain the E-R model?

29. Explain an entity?

30. Explain an Entity type?

31. Explain the Entity set?

32. Explain the Extension of entity type?

33. Explain the Weak Entity set?

34. Explain an attribute?

35. Explain integrity rules in DBMS?

36. Explain extension and intension?

37. Explain System R and name its two major subsystems.

38. Explain the Join operation?

39. Differentiate shared lock and exclusive lock?

40. Explain types of keys?

41. Explain 1NF?

42. Explain 2NF?

43. Explain 3NF?

44. Explain BCNF?

45. Describe ACID properties?

46. Explain stored procedure?

47. Differentiate a DELETE command and TRUNCATE command?

48. Explain 2-Tier architecture?

49. Explain 3-Tier architecture?

50. How do you communicate with an RDBMS?


Learn More Interview Questions Here:


DBMS Interview Questions and Answers

1. Explain DBMS?

DBMS is a Group of programs that allows users to make and maintain a database. In simple words, DBMS gives us an interface or tool for running different operations like creating the database, inserting data into the database, deleting data from the database, updating the data, etc. Generally, DBMS is software in which data is reserved in a safer way than a file-based system. By using DBMS, we can overcome many issues like data inconsistency, data redundancy, easy access, understanding and more organized, and so on. Some famous Database Management Systems are MySQL, SQL Server, Oracle, Amazon simple DB (Cloud-based), etc.

2. Explain a database?

A Database is a logical, regular, and organized group of data that can be managed, accessed, and updated. Databases are also described as electronic data that are formed to provide the facility of insertion, creation, and updating of the data efficiently and are stored in the structure of a file or set of files, tapes, on the magnetic disk, and other devices. Database mostly includes the objects (tables), and tables include the records and areas. Fields are the basic divisions of data storage that include details about a specific aspect or attribute of the entity described by the database. DBMS is used for the extraction of data from the database in the form of queries.

3. Explain a database system?

The group of database and DBMS software combined is called a database system. Using a database system we can perform many activities like, We can store data in the database with ease without any issues of data inconsistency and data redundancy. Whenever required, you can also extract data from the database using DBMS software. So, the mixture of database and DBMS software allows one to store, recover and access data with considerate accurateness and security.

4. Tell some advantages of DBMS?

  • Restriction for unauthorized access
  • Redundancy control
  • it provides backup and recovery
  • It delivers multiple user interfaces
  • It ensures data consistency
  • It enforces integrity constraints
  • Easy data extraction and data processing due to the use of queries
  • Easy accessibility

5. Explain checkpoint in DBMS?

It is a mechanism where all the earlier logs are deleted from the system and permanently reserved in the storage disk. Two ways can help DBMS in maintaining and recovering the ACID properties, and they are sustaining the log of each operation and maintaining shadow pages. So while using a log-based recovery system, checkpoints come into use. Checkpoints are those points from where a database engine can recover after a crash as a fixed minimal point from where the operation log record can be used to retrieve all the committed data till the point of the crash.

6. What does checkpoint do in DBMS?

A checkpoint is like a screenshot of the DBMS state. They decrease the amount of work to be done during a restart after subsequent crashes. Checkpoints can be used to recover the database after the system crash. They are also work in log-based recovery systems. Whenever we need to restart the system after a system crash at that point checkpoints are used. So, we need not perform the operations from the very starting.

7. Explain transparent DBMS?

It is a type of DBMS that keeps its physical form hidden from users. Physical storage structure indicates to the memory manager of the DBMS, and it defines how the data is reserved on disk.

8. Explain unary operations in Relational Algebra?

Those operations that use single operands are called unary operations like SELECTION and PROJECTION, RENAME, etc. For example, - =,<=,>=, etc. are used in SELECTION relational operators.

9. Explain RDBMS?

RDBMS means Relational Database Management Systems. It preserves the data records and indices in tables. RDBMS is similar to DBMS that uses the structure to recognize and access data about the other piece of data in the database. RDBMS is the method that allows you to run various operations like, updating, manipulating, deleting, inserting, and administering a relational database with minimal problems. Mostly RDBMS uses SQL language as it is often used and easily understandable.

10. Explain different types of database languages?

  • Data Definition Language (DDL) e.g., CREATE, DROP, ALTER, RENAME, TRUNCATE, etc. All these controlling commands are used to update the data so they are called Data Definition Language.
  • Data Manipulation Language (DML) e.g., SELECT, INSERT, UPDATE, DELETE, etc. These commands are used to manipulate already updated data so it is called Data Manipulation Language.
  • DATA Control Language (DCL) e.g., REVOKE and GRANT. These commands help in providing and withdrawing the user access to the database.
  • Transaction Control Language (TCL) e.g., COMMIT, SAVEPOINT, and ROLLBACK. These commands are used to manage transactions in the database. They also manage the modifications made by DML.

11. Explain Data Model?

The Data model is defined as a group of conceptual tools for defining data, data semantics, data relationships, and constraints. These data models are used to define the relationship between the attributes and their entities. Some of the data models are:

  • Hierarchical data model
  • network model
  • relational model
  • Entity-Relationship model and so on.

12. Explain a Relation and a Relation Schema.

A Relation Schema is described as a set of attributes which is also known as table schema. It describes the name of the table. A relation schema is called the blueprint through which we can describe, how the data is organized into tables. A relation is described as a set of tuples and a set of related attributes with identifying key attributes

See this example:

Assume, r be the relation that includes set tuples (t1, t2, t3, …, tn). Each tuple is in ordered list of n-values t=(v1,v2, …., vn).

13. Explain a degree of Relation?

A degree of relation which is also called Cardinality can be described as the number of occurrences of one entity that is bonded to the number of occurrences of another entity. Three degrees of relation are one-to-one (1:1), one-to-many (1:M), many-to-many (M:M).

14. Explain three degrees of relation?

  • One-To-One: In this relationship, one record of any object can be associated with one record of another object.
  • One-To-Many (many-to-one): In this relationship, one record of any object can be associated with many records of other objects and vice versa.
  • Many-to-many: In this relationship, two or more records of an object can be associated with n number of records of another object.

15. Tell some disadvantages of file processing systems?

  • Inconsistent
  • Data redundancy
  • Not secure
  • Data isolation
  • Difficult in accessing data
  • Concurrent access is not possible
  • Data integrity
  • Atomicity problem
  • Limited data sharing

16. Explain data abstraction in DBMS?

Data abstraction in DBMS is a method of suppressing irrelevant details from users. As database systems are constructed of complicated data structures so, it makes convenient user interaction with the database.

For example, We know that most of the users choose those systems which have an easy GUI that means no complicated processing. So, to keep the user connected and for creating access to the data easily, it is essential to do data abstraction. In addition to it, data abstraction separates the system into various layers to make the work determined and well defined.

17. Explain the three levels of data abstraction?

  • Physical level: It is the lowliest level of abstraction. It defines how data are reserved.
  • Logical level: It is the next level of abstraction. It defines what data are reserved in the database and what the connection between those data is.
  • View level: It is the highest level of data abstraction. It defines only part of the whole database.

18. Explain DDL (Data Definition Language)?

Data Definition Language (DDL) is a criterion for commands which describes the various structures in a database. The most common DDL statements are CREATE, DROP, ALTER, RENAME, etc. These commands update data into the database.

19. Explain DML (Data Manipulation Language)?

Data Manipulation Language (DML) allows the user to manipulate or access data as systematized by the suitable data model. For example- SELECT, INSERT, UPDATE, DELETE.

Types of DML are:

Procedural DML or Low-level DML: It needs a user to tell what data is required and how to get that data.

Non-Procedural DML or High-level DML: It needs a user to tell what data are required without telling how to get those data.

20. Tell the functionality of the DML Compiler.

The DML Compiler decodes DML codes in a query language that is understandable to the query evaluation machine. DML Compiler is needed because the DML is the home of syntax elements which is very alike to the different programming language which needs compilation. So, it is necessary to collect the code in the programming language which the query evaluation machine can comprehend, and then operate on those queries with proper output.

21. Explain Relational Algebra?

It is a Procedural Query Language that includes a bunch of operations that accept one or two relations as information and deliver a new relationship. Relational algebra is the primary group of processes for the relational model. The strong point of relational algebra is that it is the same as algebra which works on numbers.

Some of the fundamental operations of relational algebra:

  • project
  • select
  • union
  • set difference
  • rename, etc.

22. Explain Relational Calculus?

It is a Non-procedural Query Language that utilizes mathematical-based calculus rather than algebra is also known as predicate calculus. It won’t work on mathematics concepts such as algebra, integration, differential, etc. Types of relational calculus are:

  • Tuple relational calculus
  • Domain relational calculus

23. Explain query optimization?

It identifies an efficient implementation plan for assessing a query that has the lowest estimated cost. The idea of query optimization came into the existence when there were several methods, and algorithms existed for a similar task then the query occurred that which one is more efficient, and the method of defining the efficient way is called query optimization.

Benefits of query optimization:

  • It decreases the time and space complexness.
  • More queries can be served as due to optimization every query comparatively bears less time.
  • User fulfillment as it will provide fast output.

24. Explain durability in DBMS?

Once the DBMS tells the user that a transaction has been finished successfully, its outcome should continue even if the system collides before all its modifications are reflected on the disk then this is known as durability. It assures that once the transaction is dedicated to the database, it will be reserved in the non-volatile memory and after that system failure can’t influence that data anymore.

25. Explain normalization?

It is a process of analyzing the provided relation schemas as per their functional dependencies. It is operated to lower the redundancy and is also used to reduce insertion, deletion, and update distractions. Normalization is viewed as an important process as it is used to bypass data redundancy, updation anomaly, insertion anomaly, deletion anomaly.

Some normal forms are:

  • First Normal Form(1NF)
  • Second Normal Form(2NF)
  • Third Normal Form(3NF)
  • Boyce & Codd Normal Form(BCNF)

26. Explain Denormalization?

It is a procedure of elevating up database performance and adding redundant data which allows getting rid of complicated data. Denormalization is an element of the database optimization process. This method is used to avoid the use of complicated and expensive joins. Denormalization doesn’t direct to the idea of not normalizing rather than denormalization comes after normalization. In this procedure, firstly the redundancy of the data will be extracted using the normalization procedure then via the denormalization method we will add redundant data according to the requirement so that we can efficiently avoid the expensive joins.

27. Explain functional Dependency?

It is the initial point of normalization. It exists when a connection between two attributes permits you to decide the related attribute’s value uniquely. It is also called database dependency and describes the relationship which happens when one attribute in a relation uniquely defines another attribute. It is denoted as A->B which indicates B is functionally dependent on A.

28. Explain the E-R model?

E-R model is a short form of Entity-Relationship model. It includes essential objects (also called entities) and the connection among these objects. Here the main objects are the entity, relationship set, attribute of that entity, an attribute of that connection set can be mapped in the formation of an E-R diagram.

In the E-R diagram, entities are described by rectangles, relationships are displayed by diamonds, attributes are the features of entities and expressed by ellipses, and data flow is defined via a straight line.

29. Explain an entity?

The Entity is a collection of attributes in a database. Every entity has its attribute which in the real world are viewed as the features of the object.

30. Explain an Entity type?

It is defined as a set of entities that have similar attributes. The entity type generally coordinates to one or more related tables in the database. A feature or trait which describes or uniquely specifies the entity is called entity type.

31. Explain the Entity set?

The entity set defines the set of all entities of an individual entity type in the database. An entity set is also called the set of all the entities which share similar properties.

32. Explain the Extension of entity type?

An extension of an entity type is defined as a set of entities of a respective entity type that is gathered into an entity set.

33. Explain the Weak Entity set?

An entity set that doesn’t hold enough attributes to construct the preliminary key is called a weak entity set. The component of a weak entity set is called a subordinate entity. A weak entity set doesn’t have a preliminary key, but we require a means to distinguish between those entries in the entity set that rely on one specified strong entity set.

34. Explain an attribute?

It refers to a database element. It is used to define the property of an entity. An attribute can be described as the features of the entity. Entities can be exclusively determined using the attributes. Attributes describe the representatives in the row of the database.

35. Explain integrity rules in DBMS?

Data integrity is implemented in the database system by levying a series of rules. Those set of integrity is called the integrity rules.

The two integrity rules in DBMS are:

Entity Integrity: It tells that the “Primary key can’t have a NULL value.”

Referential Integrity: It tells that “Foreign Key can be either a NULL value or the Primary Key value of other relation.

36. Explain extension and intension?

Extension: It is the number of tuples available in a table at any instance. It transforms as the tuples are updated, created, and destroyed. The existing data in the database transforms quite often. So, the data present in the database at a certain moment in time is called an extension or database state, or snapshot. It depends on time.

Intension: It is also called Data Schema and is represented as the depiction of the database, which is determined during database design and is predicted to remain unaffected. The Intension is a stable value that provides the name, structure of tables, and the constraints laid on it.

37. Explain System R and name its two major subsystems.

System R was invented and developed from 1974 to 1979 at IBM San Jose Research Centre. It is the first enforcement of SQL, which is the classic relational data query language, and also the foremost to demonstrate that RDBMS could deliver better transaction processing performance. It is a model that is created to show that it is feasible to build a Relational System that is used in a real-life environment to decode real-life problems.

Two major subsystems of System R:

  • Research Storage
  • System Relational Data System

38. Explain the Join operation?

It is one of the most valuable exercises in relational algebra. It is the most typically used way to integrate data from two or more relations. A Join is consistently performed based on a similar or related column. Most complicated queries of SQL involve the JOIN command.

There are the following types of join:

Inner joins: Inner join is of 3 categories. They are:

  • Theta join
  • Natural join
  • Equi join

Outer joins: Outer join has three types. They are:

  • Left outer join
  • Right outer join
  • Full outer join

39. Differentiate shared lock and exclusive lock?

Shared lock: Shared lock is needed for reading a data item. Considerable transactions keep a lock on the exact data item. When more than one transaction is authorized to read the data items it is called shared lock.

Exclusive lock: When any transaction is close to executing the write operation, then the lock on the data item is an entire lock. Because, if we permit more than one transaction then that will guide to the inconsistency in the database.

40. Explain types of keys?

  • Primary key: The Primary key is an attribute in a table that can exclusively recognize each record in a table. It is mandatory for every table.
  • Candidate key: The Candidate key is an attribute or group of attributes that can exclusively recognize a tuple. The Primary key can be chosen from these attributes.
  • Super key: A Super key is a group of attributes that can exclusively recognize a tuple. It is a superset of the candidate key.
  • Foreign key: The Foreign key is a primary key from one table, which has a connection with another table. It works as a cross-reference between tables.

41. Explain 1NF?

1NF is known as the First Normal Form. It is the easiest type of normalization that can be enforced in a database. The main objectives of 1NF are to:

  • Each column must have an atomic/single value
  • To eliminate identical columns from the same table
  • Make separate tables for each set of related data and recognize each row with a unique column

42. Explain 2NF?

2NF is known as the Second Normal Form. A table is called 2NF when it tracks the following conditions:

  • If the table is in 1NF, then the table must follow the rules of 1NF.
  • Every non-prime attribute is entirely functionally dependent on the main key, i.e., every non-key attribute must be dependent on the main key in a way that if any key component is deleted, then also the non_key element will be saved in the database.

43. Explain 3NF?

3NF means Third Normal Form. A database is known as 3NF when it fulfills the following conditions:

  • It is in third normal form.
  • There is no transitive functional dependency.

For example X->Z

Where:

X->Y

Y does not -> X

Y->Z so, X->Z

44. Explain BCNF?

BCMF means Boyce-Codd Normal Form. It is an evolved version of 3NF, so it is also known as 3.5NF. BCNF is more rigid than 3NF.

A table complies with BCNF if it fulfills the following conditions:

  • It is in 3NF.
  • For every functional dependency X->Y, X should be the super key of the table. It simply means that X cannot be a non-prime feature if Y is a prime characteristic.

45. Describe ACID properties?

ACID properties are fundamental rules that have to be fulfilled by every transaction to maintain integrity. These rules and properties are:

ATOMICITY: Atomicity is more commonly called the “all or nothing rule”. This implies all are viewed as one unit, and they either run to completion or are not implemented at all.

CONSISTENCY: This property guides the uniformity of the data. Consistency indicates that the database is consistent before and after the transaction.

ISOLATION: This property declares that the number of transactions can be performed together without showing the inconsistency of the database state.

DURABILITY: This property assures that once the transaction is achieved it will be reserved in the non-volatile memory and a system collision can also not affect it anymore.

46. Explain stored procedure?

A stored procedure is a collection of SQL statements that have been made and stored in the database. The stored procedure improves the reusability as here the code or the procedure is reserved into the system and utilized again and again that constructs the work easy, consumes less time in processing, and reduces the complexity of the system. So, if you have a code that you can reuse then save that code and call that code whenever it is needed.

47. Differentiate a DELETE command and TRUNCATE command?

DELETE command: It is used to delete rows from a table depending on the condition that we furnish in a WHERE clause.

  • DELETE command delete only those rows which are defined with the WHERE clause.
  • DELETE command can be called back.
  • DELETE command upholds a log, that’s why it is slow.
  • DELETE uses row lock while executing the DELETE function.

TRUNCATE command: TRUNCATE command is used to terminate all rows (complete data) from a table. It is equal to the DELETE command with no where clause.

  • The TRUNCATE command terminates all the rows from the table.
  • The TRUNCATE command cannot be called back.
  • The TRUNCATE command doesn’t hold a log. That’s why it is fast.
  • TRUNCATE uses a table log while executing the TRUNCATE function.

48. Explain 2-Tier architecture?

The 2-Tier architecture is similar to the basic client-server. In the 2-Tier architecture, applications on the client-end can instantly transmit with the database at the server-side.

49. Explain 3-Tier architecture?

The 3-Tier architecture includes another layer between the client and server. The introduction of 3-tier architecture is for the comfort of the users as it gives the GUI, which makes the system safe and much more convenient. In this architecture, the application on the client-end interrelates with an application on the server which additionally communicates with the database system.

50. How do you communicate with an RDBMS?

You have to utilize Structured Query Language (SQL) to intercommunicate with the RDBMS. Using SQL queries, we can provide the input to the database, and then after processing the queries database will give us the needed output.

Want to prepare for these languages:

Recent Articles