0% found this document useful (0 votes)
77 views

DBMS Interview Questions and Answers: Sindhuja Hari

Uploaded by

Deepak Singh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
77 views

DBMS Interview Questions and Answers: Sindhuja Hari

Uploaded by

Deepak Singh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 71

26/01/2021 50+ Best DBMS Interview Questions & Answers in 2021 [Updated]

DBMS Interview Questions and Answers


Posted in database (https://hackr.io/blog/category/database), SQL (https://hackr.io/blog/category/sql),
Interview Questions (https://hackr.io/blog/category/interview-questions)

Sindhuja Hari
(https://hackr.io/blog/author/sindhuja-hari)
Last Updated 05 Jan, 2021

Share:
(https://twitter.com/intent/tweet?
text=DBMS+Interview+Questions+and+Answers+https%3A%2F%2Fround-lake.dustinice.workers.dev%3A443%2Fhttps%2Fhackr.io%2Fblog%2Fdbms-interview-
questions) ( https://www.linkedin.com/shareArticle?mini=true&url=https://hackr.io/blog/dbms-interview-

questions) (http://www.reddit.com/submit?url=https://hackr.io/blog/dbms-interview-questions)

(https://news.ycombinator.com/submitlink?u=https://hackr.io/blog/dbms-interview-questions)

(https://api.whatsapp.com/send?text=https%3A%2F%2Fround-lake.dustinice.workers.dev%3A443%2Fhttps%2Fhackr.io%2Fblog%2Fdbms-interview-questions)

8 Comments

Table of Contents 

https://hackr.io/blog/dbms-interview-questions 1/21
26/01/2021 50+ Best DBMS Interview Questions & Answers in 2021 [Updated]

A database is the backbone of any IT system. As a Database Developer, I am sure you would
want to prove your expertise and knowledge in your next job interview and win a role. Here is the
list of top 50 DBMS Interview questions that will help you sail through. In addition, to enhance
your skills you could go through SQL Tutorials (https://hackr.io/tutorials/learn-sql?ref=blog-post)
and Top SQL Interview Questions (https://hackr.io/blog/top-sql-interview-questions) as SQL is an
integrated and a vital feature in a DBMS (Database Management System).

DBMS Interview Questions and Answers


Question: De ne a DBMS (Database Management System) and what is it used for?
Answer: DBMS are software applications that help you build and maintain logically related data
also known as the database. Here are a few advantages of using a DBMS:

Data Redundancy is controlled.


Unauthorized access is restricted.
Enforces integrity constraints.
Data availability and sharing
Data protection and storage

Question: What is a Database?


Answer: The database is a collection of ordered data, ordered and stored electronically. Such
organized data can be easily accessed, aggregated and managed. The database is managed and
monitored through a Database Management System or DBMS.

Question: How would you de ne a DBMS checkpoint?


Answer: A checkpoint is a point before which all the transactions in the DBMS were committed,
and the database was in a consistent state. It is a point when a backup is taken, and all the dirty
pages (in-memory modi ed pages) and old transaction logs are cleared from the system to
release memory space and stored permanently into a storage disk. For example, a manual
checkpoint can be added as follows:

CHECKPOINT 10

https://hackr.io/blog/dbms-interview-questions 2/21
26/01/2021 50+ Best DBMS Interview Questions & Answers in 2021 [Updated]

where 10 is the duration in seconds.

Read more (https://docs.microsoft.com/en-us/sql/relational-databases/logs/database-checkpoints-


sql-server?view=sql-server-ver15).

Question: Explain the di erent database languages types.


Answer: There are four types:

DDL (Data De nition Language): is used to de ne the database structure or skeleton, for
example, creating the schema, tables, indexes, constraints etc. Some DDL statements are
created, alter, drop, rename, truncate, comment.
DCL (Data Control Language): used to retrieve the saved data. Permissions and access control
come under DCL and are done using the grant and revoke commands.
DML (Data Manipulation Language): Used for accessing and manipulating data. Some DML
statements are select, insert, delete, update, lock table, explain plan etc. Basically, DML
statements handle user requests.
TCL (Transaction Control Language): used to save or rollback changes done by DML. The
commands used for TCL are commit and rollback.

Question: Do you think there are any drawbacks of le processing systems?


Answer: There are several disadvantages of le processing systems:

Data redundancy and inconsistency.


Accessing data is not e cient or easy.
Data could be stored in di erent formats and hence challenging to share.
Issues with concurrent access.

Question: What is meant by DBMS data abstraction?


Answer: Data abstraction is the hiding of irrelevant information from the user so that the
interactions with users can be smooth. There are three levels of abstraction:

Physical Level: It is the lowest level of abstraction and tells how data is physically stored in
memory. Data can be accessed through sequential or random access. Files are organized using
B+ trees and hashing methods.
Logical Level: This level stores information in the form of tables. The relationships between
various entities are also stored as simple structures.
View Level: ‘View level’ is the top-most extent of abstraction. Users can view only a part of the
actual database, in the form of rows and columns. It is possible to have multiple views of the
same database. Storage and implementation details are hidden from the users.

Question: Explain what you know about Functional Dependency?


https://hackr.io/blog/dbms-interview-questions 3/21
26/01/2021 50+ Best DBMS Interview Questions & Answers in 2021 [Updated]

A functional dependency expresses relationship between the non-key attributes and the primary
key of a table. A functional dependency is of two types – trivial and non-trivial. The relationship
can be described as A -> B where A is the determinant, and B is the dependent column.

Question: What is Denormalization?


Answer: It is a technique for database optimization where redundant data is added to one or
more tables to avoid joins. This makes retrieval of data faster and more e cient and simpler
queries.

Question: Explain the di erence between extension and intension?


Answer: Intention is the constant value, i.e. the description of the database or the schema, which
is unlikely to change frequently and is speci ed during the database design phase. The
extension is the actual data at a particular time, also referred to as the database snapshot. It is
likely to change frequently.

Question: What is System R?


Answer: System R is a database management system that provides a high level of data
independence and abstraction of the database from the users. It has data control features like
triggered transactions, authorization, integrity assertions and provisions for data consistency.

Question: Explain about the normal forms BCNF, 1NF, 2NF and 3NF.

Answer: All the above are normal forms of data, i.e. organizing data in such a way as to avoid
data redundancy and insert, delete & update anomalies.

1NF: also known as the First Normal Form. This rule states that a column of a table can hold
only atomic (single) value.
2NF: is short for second normal form. To apply the rule of 2NF, a table should be in 1NF. The
rule states that any non-prime attribute (i.e. attribute that is not part of any candidate key)
should not be dependent on the proper subset of the table’s candidate key.
3NF: or third normal form, the table should already be in 2NF. The rule states that any transitive
dependency (functional) of a “non-prime” feature on a super key should be removed.

https://hackr.io/blog/dbms-interview-questions 4/21
26/01/2021 50+ Best DBMS Interview Questions & Answers in 2021 [Updated]

BCNF: is an advanced and stricter version of 3NF. It is also more popularly known as 3.5NF. For
BCNF, a table should be in 3NF and follow the rule that for any functional dependency A->B, A
should be the super key of the table.

Question: What are ACID properties?


Answer: ACID properties are for transactions:

A => Atomicity: the entire transaction happens in one go


C => Consistency: database must be consistent before and after the transaction
I => Isolation: transactions do not interfere with each other; multiple
transactions can happen simultaneously
D => Durability: A successful transaction is re ected even if a system failure happens.

Question: Explain the Di erence between a DELETE command and TRUNCATE


command?
Answer:

DELETE TRUNCATE

DML type DDL type

Supports WHERE Condition Doesn’t support WHERE condition

Can acquire a row lock Locks the entire table and page

Speed of execution is less It is faster than delete

A single log that indicates deallocation of


There is a log for each row
a page

Example: DELETE FROM employee WHERE Example: TRUNCATE TABLE


emp_id = 2012; employee_temp

Question: Explain 2-Tier architecture?


Answer: In DBMS, 2-Tier architecture is a type of database architecture where the UI or view
layer (also called the presentation) runs on a client machine (desktop, laptop, tablet, phone, etc.)
and the data is stored on a server. To call the database, clients use the ODBC connectivity APIs.
This architecture enhances the security of the database, as the client can’t access the database
directly.

Question: Explain the di erent types of database keys?


Answer: There are several types of DBMS keys:

Primary Key: column or set of columns that identify a particular row in a table.

https://hackr.io/blog/dbms-interview-questions 5/21
26/01/2021 50+ Best DBMS Interview Questions & Answers in 2021 [Updated]

Super Key: single key or set of multiple keys that identi es rows of a table.
Candidate Key: A set of attributes which identify tuples of a table uniquely. It is essentially a
super key without repeated attributes.
Alternate Key: One or more columns of a table that collectively identify each of a table
uniquely.
Foreign Key: A common column that de nes the relationship between two tables. maintains
data integrity.
Compound Key: Consists of two more attributes that uniquely identify a record, even when the
column is not unique by itself
Composite Key: Primary key that has two or more attributes like {customer_id +
mobile_number}
Surrogate Key: Created when there is no naturally available primary key for a table. provides a
unique identity to a row in the table.

Question: Explain the purpose of normalization in DBMS?


Answer: Normalization is an important process that removes redundancy from a set of relations. It
can reduce the irregularities in the insert, delete and update by dividing huge tables into smaller
tables and use keys to link them.

Question: How is the Entity, Entity Type, and Entity Set di erent from each other in
DBMS?
Answer:

Entity: An entity is an object with physical existence that is independent and can be
di erentiated with other objects: example, an employee, student, course, job etc.
Entity type: can be said as the collection of similar entities.
Entity set: Entity set is a combination of entities of one type at any point in time.

Question: What is a CLAUSE in terms of SQL?


Answer: CLAUSE is an optional statement in SQL that de nes a condition to present data. For
example,

select * from employee WHERE emp_id = 2012;

here, WHERE is the clause that identi es the row to be obtained. Some other clauses in SQL are
– GROUP BY, HAVING, ORDER BY

https://hackr.io/blog/dbms-interview-questions 6/21
26/01/2021 50+ Best DBMS Interview Questions & Answers in 2021 [Updated]

Get a website custome


trust.
An SSL ce i cate tells site visitors yo
care about their data and they're
protected.

GoDaddy.com Shop No

Question: Di erentiate between aggregation and atomicity?


Answer: Atomicity means that all the actions are carried out at once, or none is carried out. This
means that if a transaction is incomplete or fails in between everything will be rolled back to a
previous stable state. We use aggregation to express relationships between various entities.

Question: What are the di erent types of relationships in the DBMS


Answer: There are three types of relationships in DBMS:

One-to-One: Each table record is related to only one record in another table. Example,
employee_id, and unique_ssn_id
One-to-many or vice-versa (many-to-one): A record in one table can be related to more than
one record in another table. Example, employee_id and phone_number
Many-to-Many: A record in the rst table can be related to more than one records in the
second table, and vice-versa: example, customer_id and product_id.

Question: Explain correlated subqueries in DBMS?


Answer: Correlated subqueries are subqueries that are executed once for each row processed
by its main statement. For example,

select student_id, student_name, marks from students outer where salary > (select avg(mar
ks) from students where subject = outer.students);

Question: Di erence between two and three-tier architectures?


Answer: The two-tier architecture follows a client-server architecture. There is a straight
communication link between client and server. Two-tier architecture gives high performance as
there is no middle layer. The client can be any device like mobile, desktop, laptop etc. while all
the data sits in a database.

https://hackr.io/blog/dbms-interview-questions 7/21
26/01/2021 50+ Best DBMS Interview Questions & Answers in 2021 [Updated]

Three-tier architecture consists of:

Presentation layer: A web browser, java applet, WAP phone etc.,


A business layer: Business logic like data validation, insertions, calculations, and
A data access layer: This is a data source like database, mainframe system or ERP system. The
business layer acts as a middle tier that separates the business logic from the presentation and
data layer for better reusability, data integrity, scalability and performance.

Question: Di erentiate between Trigger and Stored Procedures


Answer: Stored procedures can be invoked explicitly by the user. It can take certain input
parameters and can return output values. It is just like any other program. Triggers are called
spontaneously (on its own) when a speci c event occurs. Triggers can’t take any input values nor
return any output values.

Question: What is the di erence between Hash join, Merge join and Nested loops?
Answer:

Hash-join: In this type of join, the database does full scanning of the main table, builds a RAM
hash table, and then searches for matching tables in the other table. Hash join is faster than the
nested loop join but consumes more RAM resources.
Merge join: This join uses simple concatenation followed by sorting (removing duplicates) and
is the most e ective technique out of all the joins.
Nested loop join: In this type of scan, the driving table (main) accesses rows through index
range scan, and the result set of the driving table is nested with the probe of the other
(secondary) table using the index scan method itself.

Question: Give the distinction between Proactive, Retroactive and Simultaneous


Update?
Answer:

Proactive updates are those that eventuate in the database before they become useful in the
real-world.
Retroactive updates come about after they become e ective in the real-world.
Simultaneous updates occur at the same time as they become e ective in the real-world.

Question: Di erences between the clustered and non-clustered index.


Answer:

Clustered Index Non-clustered Index

https://hackr.io/blog/dbms-interview-questions 8/21
26/01/2021 50+ Best DBMS Interview Questions & Answers in 2021 [Updated]

Does not sort the physical data.


De nes the order of physical data storage even if they are
Indexes are stored in a di erent
inserted in random order.
place than the actual data

Only one clustered index per table as data can be sorted More than one non-clustered
in a single way only index in a table is possible

A non-clustered index can be


created as: CREATE NON-
In many databases, primary key constraint creates a
CLUSTERED INDEX
clustered index on the same column.
IX_tblStudent_deptt ON
student(deptt ASC)

Example, if there is a table student that has a primary key An index is stored in a separate
student_id, the data will be stored in ascending order of table along with its address (a
student_id like 1,2,3,4. The clustered index will be reference to the row), dept row
automatically created on student_id. address ECE <address>

No extra space required for these indexes. Consumes storage space.

Question: Di erence between specialization and generalization?


Answer:

Generalization Specialization

Creating groupings from various entity sets is Creating subgrouping within an entity set
called generalization is called specialization

The process starts with several entity sets and Starts with a single entity set and then
creates a high-level entity with some common creates a di erent set using di erent
features features.

Applied to a group of entities Applied to a single entity

Follows bottom-up approach Follows top-down approach

Question: Explain the di erences between network and hierarchical database


model?
Answer:

https://hackr.io/blog/dbms-interview-questions 9/21
26/01/2021 50+ Best DBMS Interview Questions & Answers in 2021 [Updated]

Hierarchical model Network model

Relationship between records is


The relationship is in the form of pointers or links
parent-child

During update and delete


operations, inconsistencies in data No data inconsistencies
may happen

Doesn’t support many to many


Supports many to many relationships
relationships

Creates graph structure where data traversal is easy as a


Creates a tree structure and data
node can be accessed both ways, i.e. parent-child or vice-
traversal is a bit complex
versa

Question: What is deadlock?


Answer: Deadlock happens when a set of processes are blocked. Each process is holding up a
resource that the other process requires. The other process is waiting for a resource to be
released by the same or another process. Deadlock can be depicted as:

Question: What is a Hierarchical database Model?


Answer: In a hierarchical database model, data is organized into nodes in a tree-like structure. A
node is connected to only one parent node above it. Hence data in this model has a one-to-many
relationship. An example of this model is the Document Object Model (DOM) often used in web
browsers.

Question: What is a Network Model?


Answer: The network database model is a re ned version of a hierarchical model. Here too, data
is organized in a tree-like structure. However, one child node can be connected to multiple parent
nodes. This gives rise to a many-to-many relationship between data nodes. IDMS
(https://en.wikipedia.org/wiki/IDMS) (Integrated Database Management System), Integrated Data
Store (IDS) are examples of Network Databases.

Question: What is an RDBMS?


https://hackr.io/blog/dbms-interview-questions 10/21
26/01/2021 50+ Best DBMS Interview Questions & Answers in 2021 [Updated]

Answer: A relational database is organized into tables, records, and column and there is a well-
de ned relationship between database tables. A relational database management system
(RDBMS) is an application that allows you to create, update, and administer a relational database.
Tables communicate and share the information which enables data search, data organization, and
reporting. An RDBMS is a subset of a DBMS.

Question: What is an Object-Oriented Database Model?


Answer: In an object-oriented database model, data is represented by objects. For example, a
multimedia le or record in a relational database is stored as a data object as opposed to an
alphanumeric value.

Question: What is SQL?


Answer: SQL (Structured Query Language) is a programming language used to communicate with
data stored in databases. SQL language is relatively easy to write, read, and interpret.

Question: What are DDL, DML and DCL statements in SQL?


Answer:

DDL: The Data De nition Language is used to de ne the database and schema structure by
using a set of SQL Queries like CREATE, ALTER, TRUNCATE, DROP and RENAME.
DCL: The Data Control Language is used to control the access of the users to the database by
using a set of commands like GRANT and REVOKE in the SQL Query.
DML: The Data Manipulation Language is used for maintaining the data by using SQL queries
like SELECT, INSERT, DELETE and UPDATE.

Click here to know more about SQL Command (https://hackr.io/blog/sql-commands).

Question: What do you mean by Index hunting?


Answer: A database index (http://en.wikipedia.org/wiki/Database_index) is a data structure that
improves the speed of data retrieval operations on a database. The procedure of boosting the
collection of indexes is named as Index hunting. It is done by using methods like query
optimization and query distribution.

Question: What is a distributed database?


Answer: A distributed database is a collection of multiple interconnected databases that are
spread physically across various locations. The databases can be on the same network or on
multiple networks. A DDBMS (Distributed – DBMS) integrates data logically so to the user it
appears as one single database.

Question: What is a database partitioning?

https://hackr.io/blog/dbms-interview-questions 11/21
26/01/2021 50+ Best DBMS Interview Questions & Answers in 2021 [Updated]

Answer: Database partitioning is a process where a logical database is divided into distinct
independent parts. The database objects like tables, indexes are subdivided and managed and
accessed at the granular level.

Question: Explain the importance of database partitioning?


Answer: Partitioning is a powerful functionality that increases performance with decreased cost. It
enhances manageability and improves the availability of data.

Question: What is a static SQL?


Answer: In a static SQL, the SQL statements are embedded or hard-coded in the application and
they do not change at runtime. How data is to be accessed is predetermined hence it is more
swift and e cient. The SQL statements are compiled at compile time

Question: What is dynamic SQL?


Answer: In a dynamic SQL, SQL statements are constructed at runtime, for example, the
application can allow the user to create the queries. Basically, you can build your query at
runtime. It is comparatively slower than the static SQL as the query is compiled at runtime.

Question: De ne Data Warehousing.


Answer: Data Warehousing is a technique that aggregates a large amount of data from one or
more sources. Data analysis is performed on the data to make strategic business decisions for
organizations.

Question: Name one open-source RDBMS.


Answer: MySQL is an open-source relational database management system, which stores data in
tables and maintains a relationship between the data. It uses the most powerful query language
SQL (Structured Query Language) for database access and has a very powerful syntax to create
simple and complex queries to retrieve and structure data. Data in MySQL is organized and
conforms to a certain format, and hence it is the most popular structured database today. Its ‘free’
source code is available for study, modi cation, and distribution.

Question: What is MongoDB?

https://hackr.io/blog/dbms-interview-questions 12/21
26/01/2021 50+ Best DBMS Interview Questions & Answers in 2021 [Updated]

Answer: MongoDB is a non-relational unstructured open-source database. This document-


oriented database stores your data in collections made out of individual documents. In MongoDB,
a document is a big JSON object with no particular format or schema. MongoDB represents JSON
documents in a binary-encoded format named as BSON

Read the di erence between MongoDB vs MySQL (https://hackr.io/blog/mongodb-vs-mysql)

Question: What is BI (Business Intelligence)?


Answer: Business intelligence (BI) is a technology-driven process for analyzing data and
presenting information to help executives, managers, and other corporate end-users make
business decisions. There are many tools available like SAP Business Intelligence, MicroStrategy,
Sisense and so on. The tools are user-friendly that helps you gather data from varied sources for
analysis.

Question: What is the role of a DBA in DBMS?


Answer: The Database Administrator (DBA) plays some important roles in an organization. They
are as follows:

Installing and con guring databases


Performance Monitoring
Security planning and implementation
Data backup and recovery
Troubleshooting
Data migration

Question: What is an ER diagram in DBMS?


Answer: An entity-relationship model or an entity-relationship diagram is a visual representation
of data which is represented as entities, attributes and relationships are set between entities.

Question: What is an Entity in an ER diagram?


Answer: An entity can be a real-world object, which can be easily identi able. For example, in a
library database, books, publishers and members can be considered entities. All these entities
have some attributes or properties that give them their identity. In an ER model, the entities are
related to each other.

Question: What is Data Mining?


Answer: Data mining is a process of sorting through a large amount of data to identify patterns
and trends. It uses complex mathematical and statistical algorithms to segment data for the
prediction of likely outcomes. There are many tools for Data Mining like RapidMiner, Orange,
Weka and so on.

https://hackr.io/blog/dbms-interview-questions 13/21
26/01/2021 50+ Best DBMS Interview Questions & Answers in 2021 [Updated]

Get a website custome


trust.
An SSL ce i cate tells site visitors y
care about their data and they're
protected.

GoDaddy.com Shop N

Question: What is meant by query optimization?


Answer: Query optimization is an important feature when it comes to the performance of a
database. Identifying an e cient execution plan for evaluating and executing a query that has the
least estimated cost and time is referred to as query optimization.

Question: What is a Catalog?


Answer: A catalog is a table that contains the information such as the structure of each le, the
type, and storage format of each data item and various constraints on the data. The information
stored in the catalog is called Metadata.

Question: How many types of relationship exist in database designing?


Answer: There are three major relationship models in database design:-

One-to-one – A row in one table (A) is related to only one row in another table (B)
One-to-many – A row in a table (A) is linked to many rows in another table (B). But a row in table
(B) is linked to only one row in table (A).
Many-to-many – A row in the table (A) is linked to many rows in the table (B) and vice-versa

Question: What are the primitive operations common to all database management
systems?
Answer: Addition, deletion, and modi cation are the most important primitive operations common
to all DBMS.

Question: What is cardinality in context to a database?


Answer: In SQL (Structured Query Language), the term cardinality refers to the uniqueness of
data values contained in a particular column (attribute) of a database table. The lower the
cardinality, the more are the duplicated values in a column.

Question: What is SQL SERVER?

https://hackr.io/blog/dbms-interview-questions 14/21
26/01/2021 50+ Best DBMS Interview Questions & Answers in 2021 [Updated]

Answer: SQL Server is an RDBMS developed by Microsoft. It is very stable and robust hence
popular. The latest version of SQL Server is SQL Server 2017.

Question: Under what conditions should we use indexes?


Answer: Indexes can be created to enforce uniqueness, to facilitate sorting, and to enable fast
retrieval by column values. When a column is frequently used it is a good candidate for an index
to be used with suitable conditions in WHERE clauses.

Question: What is a hashing technique in a database?


Answer: Hashing is the transformation of a string of characters into a usually shorter xed-length
value or key that represents the original string. Hashing is used to index and retrieve items in a
database because it is faster to nd the item using the shorter hashed key than to nd it using the
original value.

Question: Describe concurrency control?


Answer: Concurrency control is the process of managing simultaneous operations on a database
so that database integrity is not compromised. There are two approaches to concurrency control.

They are Locking (controlling access to data items using locks) and Versioning (using Multi-
Version Concurrency Control) respectively.

Conclusion
So, all the very best! Do let us know the DBMS questions you faced in the interview that are not
covered here in this article so that we can add those here for the bene t of the DBMS community.

So this sums up the best interview questions, which will help you crack a DBMS Interview. If you
wish to cover more DBMS interview questions, give this great course a shot. 200+ SQL interview
Questions (https://click.linksynergy.com/deeplink?
id=jU79Zysihs4&mid=39197&murl=https://www.udemy.com/course/sql-interview-questions/).

Also, you can purchase this great book for top Database programming Interview Questions: SQL
in 10 Minutes, Sams Teach Yourself: Sams Teach Your SQL 10 Minu _4 4th Edition
(https://geni.us/xqyw).

People are also reading:

Best SQL Courses (https://hackr.io/blog/best-sql-courses)


Best SQL Server Certi cations (https://hackr.io/blog/sql-server-certi cations)
Best SQL Books (https://hackr.io/blog/best-sql-books)
Best DBMS Interview Questions (https://hackr.io/blog/dbms-interview-questions)
MySQL Create Database (https://hackr.io/blog/mysql-create-database)
Best SQL Interview Questions (https://hackr.io/blog/top-sql-interview-questions)

https://hackr.io/blog/dbms-interview-questions 15/21
26/01/2021 50+ Best DBMS Interview Questions & Answers in 2021 [Updated]

Stored Procedures (https://hackr.io/blog/stored-procedures)


SQL Cheat Sheet (https://hackr.io/blog/sql-cheat-sheet)
Normalization in DBMS (https://hackr.io/blog/dbms-normalization)
Di erence between NoSQL vs MySQL (https://hackr.io/blog/nosql-vs-sql)
What is MongoDB? (https://hackr.io/blog/what-is-mongodb-applications-advantages-examples)

Interview Questions (https://hackr.io/blog/tag/interview-questions)

DBMS Interview Questions (https://hackr.io/blog/tag/dbms-interview-questions)

DBMS (https://hackr.io/blog/tag/dbms)

Share:
(https://twitter.com/intent/tweet?
text=DBMS+Interview+Questions+and+Answers+https%3A%2F%2Fround-lake.dustinice.workers.dev%3A443%2Fhttps%2Fhackr.io%2Fblog%2Fdbms-interview-
questions) ( https://www.linkedin.com/shareArticle?mini=true&url=https://hackr.io/blog/dbms-interview-

questions) (http://www.reddit.com/submit?url=https://hackr.io/blog/dbms-interview-questions)

(https://news.ycombinator.com/submitlink?u=https://hackr.io/blog/dbms-interview-questions)
(https://api.whatsapp.com/send?text=https%3A%2F%2Fround-lake.dustinice.workers.dev%3A443%2Fhttps%2Fhackr.io%2Fblog%2Fdbms-interview-questions)

Sindhuja Hari
(https://hackr.io/blog/author/sindhuja-hari)
Sindhuja Hari, a technology geek, content producer & writer brings over 20 years of experience.
She builds and delivers best in class content for global audiences. Her favorite domains/ genres
are IT, Manufacturing, Logistics & Supply Chain, and Travel & Leisure. View all posts by the Author
(https://hackr.io/blog/author/sindhuja-hari)

Related Posts

https://hackr.io/blog/dbms-interview-questions 16/21
26/01/2021 50+ Best DBMS Interview Questions & Answers in 2021 [Updated]

(https://hackr.io/blog/sql-server-interview-questions)

50 Best SQL Server Interview Questions and Answers

(https://hackr.io/blog/sql-server-interview-questions)
Read More (https://hackr.io/blog/sql-server-interview-questions)

(https://hackr.io/blog/sql-certi cations)

9 Best SQL Certi cations to boost your Career in 2021

(https://hackr.io/blog/sql-certi cations) Read More (https://hackr.io/blog/sql-certi cations)

(https://hackr.io/blog/software-testing-interview-questions)

Software Testing Interview Questions and Answers

(https://hackr.io/blog/software-testing-interview-questions)
Read More (https://hackr.io/blog/software-testing-interview-questions)

https://hackr.io/blog/dbms-interview-questions 17/21
26/01/2021 50+ Best DBMS Interview Questions & Answers in 2021 [Updated]

Leave a comment
Email address*

Enter email

Your email will not be published

Name*

Name

Comment*

SUBMIT

Irma Fisher
What is a tuple in DBMS?
Reply

Mercedes Fowler
In DBMS, a tuple is the one single row of any table.
Reply

Ernest Berry
What is join in DBMS?
Reply

Kerry Greene
It’s a binary operation. It makes combining join product and selection in a single statement a
possibility. To combine the data from multiple join tables, the most preferred method is - Join.
Reply

Miriam Hill
What are the 3 types of databases?
https://hackr.io/blog/dbms-interview-questions 18/21
26/01/2021 50+ Best DBMS Interview Questions & Answers in 2021 [Updated]

Reply

Kenneth Washington
Now that we know there are seven types of databases, it’s di cult to know which database is
asked about. Still, the three types of databases are:
Hierarchical databases
Network databases, and
Graph databases
Reply

Randall Cobb
What is normalization in DBMS?
Reply

Mitchell Beck
It’s the process of organizing the data in any database management system. It is important for
eliminating unnecessary updates, insertion, and deletions.
Reply

Dana Turner
What is the schema in DBMS?
Reply

Mitchell Beck
Schema is a basic structural or skeletal view of the entire database. It represents the database’s
logical views. It displays the data organization in a management system. Also, it decides about
the constraints that will act upon the selected data.
Reply

Ruben Thompson
What are the types of database management system?
Reply

Daryl Chambers
Essentially, there are seven types of database management systems (DBMS), they are listed
below:
Hierarchical Databases
ER (Entity Relational) model Databases
Network Databases
Graph Databases
Relational Databases
Object oriented Databases
Documents Databases
https://hackr.io/blog/dbms-interview-questions 19/21
26/01/2021 50+ Best DBMS Interview Questions & Answers in 2021 [Updated]

Reply

technvrial
Good information about DBMS . thanks for sharing this knowledge ....
Reply

janaki. M
Dataspace management system
Reply

Related Tutorials
MongoDB

(https://hackr.io/tutorials/learn-mongodb)

MySQL

(https://hackr.io/tutorials/learn-mysql)

SQL

(https://hackr.io/tutorials/learn-sql)

SQLite

(https://hackr.io/tutorials/learn-sqlite)

SQL Server

(https://hackr.io/tutorials/learn-sql-server)

Recommended Learning
SQLBolt (sqlbolt.com)

(https://hackr.io/tutorial/sqlbolt)

The Complete SQL Bootcamp (www.udemy.com)

(https://hackr.io/tutorial/the-complete-sql-bootcamp)

A beginners guide to thinking in SQL (www.sohamkamani.com)

(https://hackr.io/tutorial/a-beginners-guide-to-thinking-in-sql)

https://hackr.io/blog/dbms-interview-questions 20/21
26/01/2021 50+ Best DBMS Interview Questions & Answers in 2021 [Updated]

VIEW MORE (https://hackr.io/tutorials/learn-sql)

Blog (https://hackr.io/blog) Roadmaps (https://hackr.io/roadmaps) About Us (https://hackr.io/about)

Programming Tips (https://chrome.google.com/webstore/detail/programming-


tips/ooaiehbfngcjjeaiedpffeajkeleikpl)

Help & FAQ (https://hackr.io/help) We Feedback

(https://play.google.com/store/apps/details?id=io.hackr.hackr&hl=en)

(https://apps.apple.com/in/app/hackr-io/id1188958684)

Disclosure: This page may contain affliate links, meaning when you click the links and make a purchase, we receive a commission.

https://hackr.io/blog/dbms-interview-questions 21/21
26/01/2021 Commonly asked DBMS interview questions|Set 1

Sign in to geeksforgeeks.org with


Google
Related Articles
deepak singh
[email protected]

Commonly asked DBMS interview questions | Set 1


Continue as deepak

To create your account, Google will share your name,


Difficulty Level : Easy ● Last Updated : 07 Nov,email
2019address and profile picture with
geeksforgeeks.org. See geeksforgeeks.org's privacy
policy and Terms of Service.
What are advantages of DBMS over traditional file based systems?

Ans : Database management systems were developed to handle the following

difficulties of typical Fille-processing systems suppor ted by conventional operating

systems.

1. Data redundancy and inconsistency

2. Difficulty in accessing data

3. Data isolation – multiple files and formats

4. Integrity problems

5. Atomicity of updates

6. Concurrent access by multiple users

7. Security problems

Source: http://c s.nyu.edu/courses/spring01/G22.2433-001/mod1.2.pdf

We use cookies to ensure you have the best browsing experience on our website. By using
our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Got It !
Policy

https://www.geeksforgeeks.org/commonly-asked-dbms-interview-questions/ 1/10
26/01/2021 Commonly asked DBMS interview questions|Set 1

What are super, primar y, candidate and foreign keys?

Sign in to geeksforgeeks.org with


Ans : A super key is a set of attributes of a relation schema upon which all attributes of

Google
the schema are functionally dependent. No two rows can have the same value of super

key attributes.

deepak singh
A Candidate key is minimal superkey, i.e., no proper subset of Candidate key attributes
[email protected]
can be a superkey.

Continue as deepak
A Primar y Key is one of the candidate keys. One of the candidate keys is selected as

To create your account, Google will share your name,


most impor tant and becomes the primar y key. There cannot be more that one primar y

keys in a table.
email address and profile picture with
geeksforgeeks.org. See geeksforgeeks.org's privacy
policy and Terms of Service.
A Foreign key is a field (or collection of fields) in one table that uniquely identifies a row

of another table. See this for an example.

What is the difference between primar y key and unique constraints?

Ans : Primar y key cannot have NULL value, the unique constraints can have NULL

values. There is only one primar y key in a table, but there can be multiple unique

constrains.

What is database normalization?

Ans : It is a process of analyzing the given relation schemas based on their functional

dependencies and primar y keys to achieve the following desirable proper ties:

1) Minimizing Redundancy

2) Minimizing the Inser tion, Deletion, And Update Anomalies

Relation schemas that do not meet the proper ties are decomposed into smaller relation

schemas that could meet desirable proper ties.

Source: http://c s.tsu.edu/ghemri/CS346/ClassNotes/Normalization.pdf

What is SQL?

SQL is Structured Quer y L anguage designed for inser ting and modif ying in a relational

database system.
We use cookies to ensure you have the best browsing experience on our website. By using
our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Got It !
Policy

https://www.geeksforgeeks.org/commonly-asked-dbms-interview-questions/ 2/10
26/01/2021 Commonly asked DBMS interview questions|Set 1

Sign in to geeksforgeeks.org with


Google
What are the differences between DDL, DML and DCL in SQL?

Ans : Following are some details of three.

deepak singh
DDL stands for Data Definition L anguage. SQL queries like CRE ATE, ALTER, DROP and
[email protected]
REN AME come under this.

DML stands for Data Manipulation L anguage. SQL queries like SELECT, INSERT and
Continue as deepak

UPDATE come under this. To create your account, Google will share your name,
email address and profile picture with
DCL stands for Data Control L anguage. SQL queries like GR ANT and RE VOKE come
geeksforgeeks.org. See geeksforgeeks.org's privacy
under this.
policy and Terms of Service.

What is the difference between having and where clause?

Ans : H AVING is used to specif y a condition for a group or an aggregate function used in

select statement. The WHERE clause selects before grouping. The H AVING clause

selects rows af ter grouping. Unlike H AVING clause, the WHERE clause cannot contain

aggregate functions. (See this for examples).

See Having vs Where Clause? for more details

How to print duplicate rows in a table?

Ans :  See http://quiz.geeksforgeeks.org/how-to-print-duplicate-rows-in-a-table/

What is Join?

Ans : An SQL Join is used to combine data from two or more tables, based on a common

field between them. For example, consider the following two tables.

Table – Student Table

EnrollNo StudentName Address

1000 geek1 geeksquiz1

1001 geek2 geeksquiz2

We use cookies to ensure you have the best browsing experience on our website. By using
our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Got It !
1002 Policy
geek3 geeksquiz3

https://www.geeksforgeeks.org/commonly-asked-dbms-interview-questions/ 3/10
26/01/2021 Commonly asked DBMS interview questions|Set 1

Sign in to geeksforgeeks.org with


Table – StudentCourse Table

Google

CourseIDEnrollNo

deepak singh
1 1000
[email protected]

Continue as deepak
2 1000

To create your account, Google will share your name,


email address and profile picture with
3 1000geeksforgeeks.org. See geeksforgeeks.org's privacy

policy and Terms of Service.

1 1002

2 1003

Following is join quer y that shows names of students enrolled in different courseIDs.

SELECT StudentCourse.CourseID, Student.StudentName


FROM StudentCourse
INNER JOIN Student
ON StudentCourse.EnrollNo = Student.EnrollNo
ORDER BY StudentCourse.CourseID;

The above quer y would produce following result.

CourseIDStudentName

1 geek1

1 geek3

2 geek1

3 geek1

We use cookies to ensure you have the best browsing experience on our website. By using
our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Got It !
Policy

https://www.geeksforgeeks.org/commonly-asked-dbms-interview-questions/ 4/10
26/01/2021 Commonly asked DBMS interview questions|Set 1

Sign in to geeksforgeeks.org with


Google

deepak singh
[email protected]

Continue as deepak

To create your account, Google will share your name,


email address and profile picture with
geeksforgeeks.org. See geeksforgeeks.org's privacy
policy and Terms of Service.

What is Identity?

Ans : Identity (or AutoNumber) is a column that automatically generates numeric

values. A star t and increment value can be set, but most DB A leave these at 1. A GUID

column also generates numbers; the value of this cannot be controlled. Identity/GUID

columns do not need to be indexed.

What is a view in SQL? How to create one

Ans : A view is a vir tual table based on the result-set of an SQL statement. We can create

using create view syntax.

CREATE VIEW view_name AS


SELECT column_name(s)
FROM table_name
WHERE condition

What are the uses of view?

1. Views can represent a subset of the data contained in a table; consequently, a view

can limit the degree of exposure of the underlying tables to the outer world: a given user

may have permission to quer y the view, while denied access to the rest of the base

We use cookies to ensure you have the best browsing experience on our website. By using
table.

our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Got It !
2. Views can join and simplif y multiple tables into a single vir tual table
Policy

https://www.geeksforgeeks.org/commonly-asked-dbms-interview-questions/ 5/10
26/01/2021 Commonly asked DBMS interview questions|Set 1

3. Views can act as aggregated tables, where the database engine aggregates data

Sign in to geeksforgeeks.org with


(sum, average etc.) and presents the calculated results as par t of the data

Google
4. Views can hide the complexity of data; for example a view could appear as Sales2000

or Sales2001, transparently par titioning the actual underlying table

deepak singh
5. Views take ver y little space to store; the database contains only the definition of a
[email protected]
view, not a copy of all the data which it presents.

6. Depending on the SQL engine used, views can provide extra security
Continue as deepak

Source: Wiki Page To create your account, Google will share your name,
email address and profile picture with
geeksforgeeks.org. See geeksforgeeks.org's privacy
policy and Terms of Service.

What is a Trigger?

Ans : A Trigger is a code that associated with inser t, update or delete operations. The

code is executed automatically whenever the associated quer y is executed on a table.

Triggers can be useful to maintain integrity in database.

What is a stored procedure?

Ans : 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.

What is the difference between Trigger and Stored Procedure?

Ans : Unlike Stored Procedures, Triggers cannot be called directly. They can only be

associated with queries.

What is a transaction? What are ACID proper ties?

Ans : A Database Transaction is a set of database operations that must be treated as

whole, means either all operations are executed or none of them.

An example can be bank transaction from one account to another account. Either both

We use cookies to ensure you have the best browsing experience on our website. By using
debit and credit operations must be executed or none of them.

our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Got It !
Policy

https://www.geeksforgeeks.org/commonly-asked-dbms-interview-questions/ 6/10
26/01/2021 Commonly asked DBMS interview questions|Set 1

ACID (Atomicity, Consistency, Isolation, Durability) is a set of proper ties that guarantee

that database transactions are processed reliably.


Sign in to geeksforgeeks.org with
Google

deepak singh
What are indexes?
[email protected]

Ans : A database index is a data structure that improves the speed of data retrieval
Continue as deepak
operations on a database table at the cost of additional writes and the use of more

To create your account, Google will share your name,


storage space to maintain the extra copy of data.
email address and profile picture with
geeksforgeeks.org. See geeksforgeeks.org's privacy
Data can be stored only in one order on disk. To suppor t faster access according to

policy and Terms of Service.


different values, faster search like binar y search for different values is desired, For this

purpose, indexes are created on tables. These indexes need extra space on disk, but

they allow faster search according to different frequently searched values.

What are clustered and non-clustered Indexes?

Ans : Clustered indexes is the index according to which data is physically stored on disk.

Therefore, only one clustered index can be created on a given database table.

Non-clustered indexes don’t define physical ordering of data, but logical ordering.

Typically, a tree is created whose leaf point to disk records. B-Tree or B+ tree are used

for this purpos

Commonly asked DBMS inter view questions | Set 2

Practice Quizzes on DBMS

L ast Minute Notes – DBMS

DBMS Ar ticles

Please write comments if you find anything incorrect, or you want to share more

information about the topic discussed above.

Attention reader! Don’t stop learning now. Get hold of all the impor tant CS Theor y

concepts for SDE inter views with the CS Theor y Course at a student-friendly price and

become industr y ready.

We use cookies to ensure you have the best browsing experience on our website. By using
our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Got It !
Policy

https://www.geeksforgeeks.org/commonly-asked-dbms-interview-questions/ 7/10
26/01/2021 Commonly asked DBMS interview questions|Set 1

RECOMMENDED ARTICLES Page : 1 2 3


Sign in to geeksforgeeks.org with
Google
Commonly asked DBMS interview Introduction of DBMS (Database
01 05
questions | Set 2 Management
deepak singh System) | Set 1
07, Dec 15
[email protected]
19, Oct 16

Most asked Computer Science Continue as deepak


Introduction of 3-Tier Architecture
02
Subjects Interview Questions in 06
in DBMS
To create your account,| Set 2 will share your name,
Google
Amazon, Microsoft, Flipkart email address and profile picture with
19, Oct 16

03, Oct 19
geeksforgeeks.org. See geeksforgeeks.org's privacy
policy and Terms of Service.
SQL Interview Questions | Set 2 File Organization in DBMS | Set 2
07
03 24, May 18
15, Dec 17

SQL Interview Questions | Set 1 File Organization in DBMS | Set 1


04 07, Aug 18
08 26, Dec 17

 Like 0

 Previous Next 

Ar ticle Contributed By :

GeeksforGeeks

We use cookies to ensure you have the best browsing experience on our website. By using
our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Got It !
Vote for di culty
Policy

https://www.geeksforgeeks.org/commonly-asked-dbms-interview-questions/ 8/10
26/01/2021 Commonly asked DBMS interview questions|Set 1

Current di culty : Easy

Sign in to geeksforgeeks.org with


Easy Normal Medium Hard Expert Google

deepak singh
[email protected]
Improved By : AnupamJain, piyushav94
Continue as deepak
Article Tags : DBMS
To create your account, Google will share your name,
Practice Tags : DBMS email address and profile picture with
geeksforgeeks.org. See geeksforgeeks.org's privacy
policy and Terms of Service.

Improve Article Report Issue

Writing code in comment? Please use ide.geeksforgeeks.org, generate link and share the link here.

Load Comments

5th Floor, A-118,


Sector-136, Noida, Uttar Pradesh - 201305
[email protected]

Company Learn
About Us Algorithms
Careers Data Structures
Privacy Policy
We use cookies to ensure you have the best browsing experience on our website. By using
Languages
Contact
our site, you acknowledge that youUs CS
have read and understood our Cookie Policy & Privacy Subjects Got It !
Policy
Video Tutorials
https://www.geeksforgeeks.org/commonly-asked-dbms-interview-questions/ 9/10
26/01/2021 Commonly asked DBMS interview questions|Set 1

Practice Contribute
Sign in to geeksforgeeks.org with
Google
Courses Write an Article
Company-wise Write Interview Experience
deepak singh
[email protected]
Topic-wise Internships
How to begin? Continue Videos
as deepak

To create your account, Google will share your name,


@geeksforgeeks ,email
Someaddress and profile picture with
rights reserved
geeksforgeeks.org. See geeksforgeeks.org's privacy
policy and Terms of Service.

We use cookies to ensure you have the best browsing experience on our website. By using
our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Got It !
Policy

https://www.geeksforgeeks.org/commonly-asked-dbms-interview-questions/ 10/10
26/01/2021 Top 30 DBMS Interview Questions and Answers

SEARCH

Software Testing Help


Home Resources FREE EBooks QA Testing  Courses  Automation 

Types Of Testing  Tutorials 

Top 30 DBMS Interview Questions And Answers


Last Updated: January 18, 2021

Most Frequently asked DBMS Interview Questions


and answers to help you Prepare for the Interview:

In this article, we will discuss the most important


DBMS Interview Questions in order to make you
familiar with the type of questions that can be asked
during a job interview related to the Database
Management System (DBMS).

Basically, out of my personal experience, there is not


any speci c way or formula to get through an
Interview Process and it totally depends on you and
the type of Interviewer. But still, it’s good to be
prepared on your pro le for your own con dence
and knowledge so that you don’t feel hesitant to answer the questions asked during an
interview.

This article includes almost all the important DBMS interview questions, covering the basic
concepts in simple terms along with examples for your easy understanding.

https://www.softwaretestinghelp.com/top-dbms-interview-questions/ 1/12
26/01/2021 Top 30 DBMS Interview Questions and Answers

FEATURED VIDEOS

What is System Testing


NOW
PLAYING

DBMS Interview Questions And Answers


Here we go!!

Q #1) What is DBMS used for?

Answer: DBMS, commonly known as Database Management System, is an application system


whose main purpose revolves around the data. This is a system that allows its user to store
the data, de ne it, retrieve it and update the information about the data inside the database.

https://www.softwaretestinghelp.com/top-dbms-interview-questions/ 2/12
26/01/2021 Top 30 DBMS Interview Questions and Answers

Q #2) What is meant by a Database?

Answer: In simple terms, Database is a collection of data in some organized way to facilitate
its user’s to easily access, manage and upload the data.

Q #3) Why is the use of DBMS recommended? Explain by listing some of its major advantages.

Answer: Some of the major advantages of DBMS are as follows:

Controlled Redundancy: DBMS supports a mechanism to control the redundancy of data


inside the database by integrating all the data into a single database and as data is stored
at only one place, the duplicity of data does not happen.
Data Sharing: Sharing of data among multiple users simultaneously can also be done in
DBMS as the same database will be shared among all the users and by di erent
application programs.
Backup and Recovery Facility: DBMS minimizes the pain of creating the backup of data
again and again by providing a feature of ‘backup and recovery’ which automatically
creates the data backup and restores the data whenever required.
Enforcement of Integrity Constraints: Integrity Constraints are very important to be
enforced on the data so that the re ned data after putting some constraints are stored in
the database and this is followed by DBMS.
Independence of data: It simply means that you can change the structure of the data
without a ecting the structure of any of the application programs.

Q #4) What is the purpose of normalization in DBMS?

Answer: Normalization is the process of analyzing the relational schemas which are based on
their respective functional dependencies and the primary keys in order to ful ll certain
properties.

The properties include:

To minimize the redundancy of the data.


To minimize the Insert, Delete and Update Anomalies.

Q #5) What are the di erent types of languages that are available in the DBMS?

Answer: Basically, there are 3 types of languages in the DBMS as mentioned below:

DDL: DDL is Data De nition Language which is used to de ne the database and schema
structure by using some set of SQL Queries like CREATE, ALTER, TRUNCATE, DROP and
RENAME.
DCL: DCL is Data Control Language which is used to control the access of the users
inside the database by using some set of SQL Queries like GRANT and REVOKE.

https://www.softwaretestinghelp.com/top-dbms-interview-questions/ 3/12
26/01/2021 Top 30 DBMS Interview Questions and Answers

DML: DML is Data Manipulation Language which is used to do some manipulations in


the database like Insertion, Deletion, etc. by using some set of SQL Queries like SELECT,
INSERT, DELETE and UPDATE.

Q #6) What is the purpose of SQL?

Answer: SQL stands for Structured Query Language whose main purpose is to interact with
the relational databases in the form of inserting and updating/modifying the data in the
database.

Q #7) Explain the concepts of a Primary key and Foreign Key.

Answer: Primary Key is used to uniquely identify the records in a database table while Foreign
Key is mainly used to link two or more tables together, as this is a particular eld(s) in one of
the database tables which are the primary key of some other table.

Example: There are 2 tables – Employee and Department. Both have one common
eld/column as ‘ID’ where ID is the primary key of the Employee table while this is the foreign
key for the Department table.

Q #8) What are the main di erences between Primary key and Unique Key?

Answer: Given below are few di erences:

The main di erence between the Primary key and Unique key is that the Primary key can
never have a null value while the Unique key may consist of null value.
In each table, there can be only one primary key while there can be more than one
unique key in a table.

Q #9) What is the concept of sub-query in terms of SQL?

Answer: Sub-query is basically the query which is included inside some other query and can
also be called as an inner query which is found inside the outer query.

Q #10) What is the use of DROP command and what are the di erences between DROP,
TRUNCATE and DELETE commands?

Answer: DROP command is a DDL command which is used to drop/delete the existing table,
database, index or view from the database.

The major di erence between DROP, TRUNCATE and DELETE commands are:

DROP and TRUNCATE commands are the DDL commands which are used to delete tables from
the database and once the table gets deleted, all the privileges and indexes that are related to

https://www.softwaretestinghelp.com/top-dbms-interview-questions/ 4/12
26/01/2021 Top 30 DBMS Interview Questions and Answers

the table also get deleted. These 2 operations cannot be rolled back and so should be used
only when necessary.

DELETE command, on the other hand, is a DML Command which is also used to delete rows
from the table and this can be rolled back.

Note: It is recommended to use the ‘WHERE’ clause along with the DELETE command else the
complete table will get deleted from the database.

Q #11) What is the main di erence between UNION and UNION ALL?

Answer: UNION and UNION ALL are used to join the data from 2 or more tables but UNION
removes duplicate rows and picks the rows which are distinct after combining the data from
the tables whereas UNION ALL does not remove the duplicate rows, it just picks all the data
from the tables.

Q #12) Explain the concept of ACID properties in DBMS?

Answer: ACID properties is the combination of Atomicity, Consistency, Isolation, and Durability
properties. These properties are very helpful in allowing a safe and secure way of sharing the
data among multiple users.

Atomicity: This is based on the concept of “either all or nothing” which basically means
that if any update occurs inside the database then that update should either be available
to all the others beyond user and application program or it should not be available to
anyone beyond the user and application program.
Consistency: This ensures that the consistency is maintained in the database before or
after any transaction that takes place inside the database.
Isolation: As the name itself suggests, this property states that each transaction that
occurs is in isolation with others i.e. a transaction which has started but not yet
completed should be in isolation with others so that the other transaction does not get
impacted with this transaction.
Durability: This property states that the data should always be in a durable state i.e. any
data which is in the committed state should be available in the same state even if any
failure or restart occurs in the system.

Q #13) What is Correlated Subquery in DBMS?

Answer: A Subquery is also known as a nested query i.e. a query written inside some query.
When a Subquery is executed for each of the rows of the outer query then it is termed as a
Correlated Subquery.

Example of Non-Correlated Subquery is:

https://www.softwaretestinghelp.com/top-dbms-interview-questions/ 5/12
26/01/2021 Top 30 DBMS Interview Questions and Answers

SELECT * from EMP WHERE ‘RIYA’ IN (SELECT Name from DEPT WHERE EMP.EMPID=DEPT.EM

Here, the inner query is not executed for each of the rows of the outer query.

Q #14) Explain Entity, Entity Type, and Entity Set in DBMS?

Answer:

Entity is an object, place or thing which has its independent existence in the real world and
about which data can be stored in a database. For Example, any person, book, etc.

Entity Type is a collection of entities that have the same attributes. For Example, the STUDENT
table contains rows in which each row is an entity holding the attributes like name, age, and id
of the students, hence STUDENT is an Entity Type which holds the entities having the same
attributes.

Entity Set is a collection of entities of the same type. For Example, A collection of the
employees of a rm.

Q #15) What are the di erent levels of abstraction in the DBMS?

Answer: There are 3 levels of data abstraction in the DBMS.

They include:

Physical Level: This is the lowest level of the data abstraction which states how the data
is stored in the database.
Logical Level: This is the next level of the data abstraction which states the type of the
data and the relationship among the data that is stored in the database.
View Level: This is the highest level in the data abstraction which shows/states only a
part of the database.

Q #16) What integrity rules exist in the DBMS?

Answer: There are 2 major integrity rules that exist in the DBMS.

They are:

Entity Integrity: This states a very important rule that value of a Primary key can never
have a NULL value.
Referential Integrity: This rule is related to the Foreign key which states that either the
value of a Foreign key is a NULL value or it should be the primary key of any other
relation.
https://www.softwaretestinghelp.com/top-dbms-interview-questions/ 6/12
26/01/2021 Top 30 DBMS Interview Questions and Answers

Q #17) What is E-R model in the DBMS?

Answer: E-R model is known as an Entity-Relationship model in the DBMS which is based on
the concept of the Entities and the relationship that exists among these entities.

Q #18) What is a functional dependency in the DBMS?

Answer: This is basically a constraint which is useful in describing the relationship among the
di erent attributes in a relation.

Example: If there is some relation ‘R1’ which has 2 attributes as Y and Z then the functional
dependency among these 2 attributes can be shown as Y->Z which states that Z is functionally
dependent on Y.

Q #19) What is 1NF in the DBMS?

Answer: 1NF is known as the First Normal Form.

This is the easiest form of the normalization process which states that the domain of an
attribute should have only atomic values. The objective of this is to remove the duplicate
columns that are present in the table.

Q #20) What is 2NF in the DBMS?

Answer: 2NF is the Second Normal Form.

Any table is said to have in the 2NF if it satis es the following 2 conditions:

A table is in the 1NF.


Each non-prime attribute of a table is said to be functionally dependent in totality on the
primary key.

Q #21) What is 3NF in the DBMS?

Answer: 3NF is the Third Normal Form.

Any table is said to have in the 3NF if it satis es the following 2 conditions:

A table is in the 2NF.


Each non-prime attribute of a table is said to be non-transitively dependent on every key
of the table.

Q #22) What is BCNF in the DBMS?

Answer: BCNF is the Boyce Codd Normal Form which is stricter than the 3NF.
https://www.softwaretestinghelp.com/top-dbms-interview-questions/ 7/12
26/01/2021 Top 30 DBMS Interview Questions and Answers

Any table is said to have in the BCNF if it satis es the following 2 conditions:

A table is in the 3NF.


For each of the functional dependency X->Y that exists, X is the super key of a table.

Q #23) What is a CLAUSE in terms of SQL?

Answer: This is used with the SQL queries to fetch speci c data as per the requirements on
the basis of the conditions that are put in the SQL. This is very helpful in picking the selective
records from the complete set of the records.

For Example, There is a query which has WHERE condition or the query with the HAVING
clause.

Q #24) How can you get the alternate records from the table in the SQL?

Answer: If you want to fetch the odd numbers then the following query can be used:

SELECT EmpId from (SELECT rowno,EmpId from Emp) WHERE mod(rowno,2)=1;

If you want to fetch the even numbers, then the following query can be used:

SELECT EmpId from (SELECT rowno,EmpId from Emp) WHERE mod(rowno,2)=0;

Q #25) How is the pattern matching done in the SQL?

Answer: With the help of the LIKE operator, pattern matching is possible in the SQL.’%’ is used
with the LIKE operator when it matches with the 0 or more characters and ‘_’ is used to match
the one particular character.

Example:

SELECT * from Emp WHERE name like ‘b%’;

SELECT * from Emp WHERE name like ‘hans_’;

Q #26) What is a join in the SQL?

https://www.softwaretestinghelp.com/top-dbms-interview-questions/ 8/12
26/01/2021 Top 30 DBMS Interview Questions and Answers

Answer: A Join is one of the SQL statements which is used to join the data or the rows from 2
or more tables on the basis of a common eld/column among them.

Q #27) What are di erent types of joins in SQL?

Answer: There are 4 types of SQL Joins:

Inner Join: This type of join is used to fetch the data among the tables which are
common in both the tables.
Left Join: This returns all the rows from the table which is on the left side of the join
but only the matching rows from the table which is on the right side of the join.
Right Join: This returns all the rows from the table which is on the right side of the join
but only the matching rows from the table which is on the left side of the join.
Full Join: This returns the rows from all the tables on which the join condition has put
and the rows which do not match hold null values.

Q #28) What is meant by trigger?

Answer: Trigger is one of the very important codes or programs which get executed
automatically in response to the events that occur in a table or a view. For Example, If a new
record is inserted in an employee database then the data gets created automatically in the
related tables like salary, department and roles tables.

Q #29) Explain the Stored Procedure.

Answer: Stored Procedure is a group of SQL statements in the form of a function that has
some unique name and is stored in relational database management systems(RDBMS) and can
be accessed whenever required.

Q #30) What is RDBMS?

Answer: RDBMS is the Relational Database Management System which contains data in the
form of the tables and data is accessed on the basis of the common elds among the tables.

Q #31) What are the di erent type of relationships in the DBMS?

Answer: Relationships in DBMS depicts an association between the tables.

Di erent types of relationships are:

One-to-One: This basically states that there should be a one-to-one relationship


between the tables i.e. there should be one record in both the tables. Example: Among a
married couple, both wife and husband can have only one spouse.
One-to-Many: This states that there can be many relationships for one i.e. a primary key
table hold only one record which can have many, one or none records in the related
https://www.softwaretestinghelp.com/top-dbms-interview-questions/ 9/12
26/01/2021 Top 30 DBMS Interview Questions and Answers

table. Example: A Mother can have many children.


Many-to-Many: This states that both the tables can be related to many other tables.
Example: One can have many siblings and so do they have.

Conclusion
This is all about DBMS interview questions.

I hope that this article would have provided you a great insight regarding the questions that can
be asked during an interview and by now you should have gained the con dence to handle your
interview process.

Do practice all the important practical topics of DBMS for better understanding.

Happy Reading!!Happy Testing!!

Recommended Reading
Top 30 DBMS Interview Questions and Answers
Top 8 Most Popular Enterprise Grade Open Source DBMS Software

About SoftwareTestingHelp

Helping our community since 2006! Most popular portal for Software professionals
with 100 million+ visits and 300,000+ followers! You will absolutely love our tutorials
on QA Testing, Development, Software Tools and Services Reviews and more!

https://www.softwaretestinghelp.com/top-dbms-interview-questions/ 10/12
26/01/2021 Top 30 DBMS Interview Questions and Answers

Join Our Team!

https://www.softwaretestinghelp.com/top-dbms-interview-questions/ 11/12
26/01/2021 Top 30 DBMS Interview Questions and Answers

Recommended Reading

Top 30 DBMS Interview Questions and Answers


Top 8 Most Popular Enterprise Grade Open Source DBMS Software

ABOUT US | CONTACT US | ADVERTISE | TESTING SERVICES


ALL ARTICLES ARE COPYRIGHTED AND CAN NOT BE REPRODUCED WITHOUT PERMISSION.
© COPYRIGHT SOFTWARETESTINGHELP 2020 — READ OUR COPYRIGHT POLICY | PRIVACY POLICY | TERMS | COOKIE
POLICY | AFFILIATE DISCLAIMER | LINK TO US

https://www.softwaretestinghelp.com/top-dbms-interview-questions/ 12/12
26/01/2021 Top 50 DBMS Interview Questions and Answers | Edureka

Top 50 DBMS Interview Questions You Need to know


Last updated on Jan 20,2021 47.9K Views

Sahiti Kappagantula

There is no place where Data does not exist! In today’s market, around 2.5 quintillion bytes of data gets generated every day. So,
it is very important for all of us to analyze this data and generate the required results by using the database management
systems(DBMS). Well, knowing DBMS opens the doors for you to Become a Database Administrator. I believe that you are
already aware of these facts and this has made you land on this DBMS Interview Questions article.

In this article on DBMS Interview Questions, I will be discussing the top questions related to DBMS asked in your interviews.
These questions are segregated to generic, SQL-based, and query-based. These are collected after consulting with people having
excellent skills in this eld.

Top DBMS Interview Questions


1. What are the di erences between a DBMS and RDBMS?
2. Explain the terms database and DBMS. Also, mention the di erent types of DBMS.
3. What are the advantages of DBMS?
4. Mention the di erent languages present in DBMS
5. What do you understand by query optimization?
6. Do we consider NULL values the same as that of blank space or zero?
7. What do you understand by aggregation and atomicity?
8. What are the di erent levels of abstraction in the DBMS?
9. What is an entity-relationship model?
10. What do you understand by the terms Entity, Entity Type, and Entity Set in DBMS?

For your better understanding, I have divided the article into the following sections:

Generic DBMS Interview Questions


SQL Interview Questions
SQL Query Based Interview Questions

Let’s get started! 

DBMS Interview Questions


Generic DBMS Interview Questions
Q1. What are the di erences between a DBMS and RDBMS? 
DBMS RDBMS
Provides an organized way of managing, retrieving, and storing Provides the same as that of DBMS, but it provides relational
from a collection of logically related information integrity

Q2. Explain the terms database and DBMS. Also, mention the di erent types of DBMS.
A software application that interacts with databases, applications, and users to capture and analyze the required data. The data
stored in the database can be retrieved, deleted and modi ed based on the client’s requirement.

The di erent types of DBMS are as follows:

Relational DBMS (RDBMS): This type of DBMS, uses a structure which allows the users to access data in relation to another
piece of data in a database. In this type of DBMS, data is stored in the form of tables.
Hierarchical DBMS:  As the name suggests, this type of DBMS has a structure similar to that of a tree, wherein the nodes
represent records and the branches of the tree represent elds.
Network DBMS: This type of DBMS supports many-to-many relations wherein multiple member records can be linked.
Object-oriented  DBMS:  Uses small individual software called object to store pieces of data and the instructions for the
actions to be done with the data.

Q3. What are the advantages of DBMS?


The advantages of DBMS are as follows:

Sharing of Data: Multiple users can use data from the same database simultaneously.
https://www.edureka.co/blog/interview-questions/dbms-interview-questions 1/13
26/01/2021 Top 50 DBMS Interview Questions and Answers | Edureka

Integrity constraints: These constraints allow the data to be stored in a database in a re ned manner.
Redundancy control: Supports a mechanism to control the redundancy of data by integrating all the data into a single
database.
Data Independence: Allows to change the structure of the data without a ecting the structure of any of the running
Subscribe to our Newsletter, and get personalized recommendations.
×
application programs.
Provide backup and recovery facility: Provides a feature of ‘backup and recovery’ to automatically create the data backup
Sign up with Google
and restore the data as and when required.

Q4. Mention the di erent languages present in DBMS


Signup with Facebook
The di erent languages present in DBMS are as follows:

Already
DDL(Data De nition Language) – Consists of commands which are used to de have an account?
ne the Sign in.
database.
DML(Data Manipulation Language)  –  Consists of commands which are used to manipulate  the data present in the
database.
DCL(Data Control Language) – Consists of commands which deal with the user permissions and controls of the database
system.
TCL(Transaction Control Language) – Consist of commands which deal with the transaction of the database.

Q5. What do you understand by query optimization?


Query optimization is the phase that identi es a plan for evaluation query that has the least estimated cost. This phase comes
into the picture when there are a lot of algorithms and methods to execute the same task.

The advantages of query optimization are as follows:

The output is provided faster


A larger number of queries can be executed in less time
Reduces time and space complexity

Q6. Do we consider NULL values the same as that of blank space or zero? 
A NULL value is not at all same as that of zero or a blank space. The NULL value represents a value which is unavailable,
unknown, assigned or not applicable whereas zero is a number and blank space is a character.

Q7. What do you understand by aggregation and atomicity?


Aggregation Atomicity
This property states that a database modi cation must either
This is a feature of the E-R  model which allows a relationship
follow all the rules or nothing at all. So, if one part of the
set to participate in another relationship set.
transaction fails, then the entire transaction fails.

Q8. What are the di erent levels of abstraction in the DBMS?


There are three levels of data abstraction in DBMS. They are:

Physical Level: It is the lowest level of abstraction and describes how the data is stored.
Logical Level: This is the next level of abstraction after the Physical level. This layer determines what data is stored in the
database, and what is the relationship between the data points.
View Level: The View Level is the highest level of abstraction and it describes only a part of the entire database.

Q9. What is an entity-relationship model?


It is a diagrammatic approach to database design, where you represent real-world objects as entities and mention relationships
between them. This approach helps the team of DBAs’ to understand the schema easily.

Q10. What do you understand by the terms Entity, Entity Type, and Entity Set in DBMS?
Entity: An entity is a real-world object having attributes, which are nothing but characteristics of that particular object. For
example, an employee can be an entity. This particular entity can have attributes such as empid, empname, etc.
Entity Type: Entity type is nothing but a collection of entities, having the same attributes. Generally, an entity type refers to
one or more related tables in a particular database. So, you can understand, entity type as a characteristic which uniquely
identi es the entity. For example, An employee can have attributes such as empid, empname, department, etc.
Entity Set: An entity set is the collection of all the entities of a particular entity type in a database. For example, a set of
employees, a set of companies, and a set of people can come under an entity set.

DBMS Interview Questions


Q11. What are relationships and mention di erent types of relationships in the DBMS
A relationship in DBMS is the scenario where two entities are related to each other. In such a scenario, the table consisting of
foreign key references to that of a primary key of the other table. 
The di erent types of relationships in DBMS are as follows:

https://www.edureka.co/blog/interview-questions/dbms-interview-questions 2/13
26/01/2021 Top 50 DBMS Interview Questions and Answers | Edureka

One-to-One Relationship –  Used when a single row in Table A is related to a single row in Table B.
One-to-Many Relationship – Used when a single row in Table A is related to many rows in table B.
Many-to-Many Relationship – Used when many rows in table A can be related to many rows in table B.
Self -Referencing Relationship – Used when a record in table A is related to the same table itself.
Subscribe to our Newsletter, and get personalized recommendations.
×
Q12. What is concurrency control?
Sign up with Google
This is a process of managing simultaneous operations in a database so that database integrity is not compromised. The
following are the two approaches involved in concurrency control:
Signup with Facebook
Optimistic approach – Involves versioning
Pessimistic approach – Involves locking
Already have an account? Sign in.
Q13. What are the ACID properties in DBMS?
ACID stands for Atomicity, Consistency, Isolation, Durability. It is used to ensure that the data transactions are processed reliably
in a database system. 

Atomicity: Atomicity refers to those transactions which are completely successful or failed. Here each transaction refers to
a single logical operation of a data. So, even if one part of any transaction fails, the entire transaction fails and the database
state is left unchanged.
Consistency: Consistency ensures that the data must meet all the validation rules. In simple words,  you can say that your
transaction never leaves the database without completing its state.
Isolation: The main goal of isolation is concurrency control.
Durability: Durability means that if a transaction has been committed, it will occur whatever may be the scenario.

Q14. What is normalization and what are the di erent types of normalization?
The process of organizing data to avoid any duplication of data and redundancy is known as Normalization. There are many
successive levels of normalization which are known as normal forms. Each consecutive normal form depends on the previous
one. The following are the rst three normal forms. Apart from these, you have higher normal forms such as BCNF. 

First Normal Form (1NF) – No repeating groups within rows


Second Normal Form (2NF) – Every non-key (supporting) column value is dependent on the whole primary key.
Third Normal Form (3NF) – Dependent solely on the primary key and no other non-key (supporting) column value.

Q15. What are the di erent types of keys in the database?


There are mainly 7 types of Keys, that can be considered in a database. I am going to consider the below tables to explain to you
the various keys.

Fig 1: Di erent Types of Keys in Database – DBMS Interview Questions

Candidate Key –  This is a set of attributes which can uniquely identify a table. Each table can have more than a candidate
key. Apart from this, out of all the candidate keys, one key can be chosen as the Primary key.  In the above example, since
CustomerID and PanNumber can uniquely identify every tuple, they would be considered as a Candidate Key. 
Super Key – This is a set of attributes which can uniquely identify a tuple. So, a candidate key, primary key, and a unique
key is a superkey, but vice-versa isn’t true.
Primary Key – This is a set of attributes which are used to uniquely identify every tuple. In the above example, since 
CustomerID and PanNumber are candidate keys, any one of them can be chosen as a Primary Key. Here CustomerID is
chosen as the primary key.

https://www.edureka.co/blog/interview-questions/dbms-interview-questions 3/13
26/01/2021 Top 50 DBMS Interview Questions and Answers | Edureka

Unique Key –  The unique key is similar to the primary key, but allows NULL values in the column. Here the PanNumber can
be considered as a unique key.
Alternate Key – Alternate Keys are the candidate keys, which are not chosen as a Primary key. From the above example,
the alternate key is PanNumber 
Subscribe to our Newsletter, and get personalized recommendations.
×
Foreign Key – An attribute that can only take the values present as the values of some other attribute, is the foreign key to
the attribute to which it refers. in the above example, the CustomerID from the Customers Table is referred to the
Sign up with Google
CustomerID from the Customer_Payment Table.
Composite Key – A composite key is a combination of two or more columns that identify each tuple uniquely. Here, the
CustomerID and Date_of_Payment can be grouped togetherSignup
to uniquely identify every tuple in the table.
with Facebook

Q16. What do you understand by correlated subqueries in DBMS?


Already have an account? Sign in.
A correlated subquery is also a sort of subquery reliant on another query. So, when subqueries are executed for each of the rows
of outer queries, then they are termed as correlated subqueries. Each subquery is executed a single time for every row of the
outer query.

You can also understand correlated subqueries as those queries, which are used for row-by-row processing by the parent
statement. Here, the parent statement can be SELECT, UPDATE or DELETE statement.

Q17. Explain Database partitioning and its importance.


Data partitioning is the process of dividing a logical database into independent units for the betterment of availability,
performance, and manageability.

The importance of database partitioning is as follows:

MySQL DBA Certi cation Training


Instructor-led Sessions
Real-life Case Studies
Assignments
Lifetime Access

Explore Curriculum

Enables you to access large parts of a speci c partition


Cheap and slower storage can be used to store data
Improves query performance

Q18. What do you understand by functional dependency and transitive dependency in DBMS?
Functional Dependency: A functional dependency is a constraint that is used in describing the relationship among di erent
attributes in a relation.

Example: Consider a relation “A1” having attributes X and Y. The functional dependency among these two attributes will be X ->
Y, this implies that Y is functionally dependent on X.

Transitive Dependency: A transitive dependency is a constraint that can only occur in a relation of three or more attributes. 

Example: Consider a relation “A1” having attributes X, Y and Z. Now, X->Z is said to hold transitive dependency, only if the
following functional dependencies holds true:

X -> Y
Y doesn’t ->X
Y -> Z

DBMS Interview Questions


Q19. What is the di erence between two and three-tier architectures?

Two-tier architecture Three-tier architecture


This architecture contains an extra layer between the client and
This is similar to the client-server architecture.
the server.
Clients communicate with an application(GUI) on the server-
Clients directly communicate with the database at the server-
side
side, that makes the system more secure and accessible. This
application thereafter communicates with the database

system.

https://www.edureka.co/blog/interview-questions/dbms-interview-questions 4/13
26/01/2021 Top 50 DBMS Interview Questions and Answers | Edureka

Subscribe to our Newsletter, and get personalized recommendations.


×
Sign up with Google

Signup with Facebook

Already have an account? Sign in.

Fig 2: Two-Tier vs Three-Tier Architecture – DBMS Interview Questions

Q20. Mention the di erences between Unique Key and Primary Key

Unique Key Primary Key


Unique Key can have a NULL value The primary key cannot have a NULL value
Each table can have more than one unique key Each table can have only one primary key

Q21. What is a checkpoint in DBMS and when does it occur?


A checkpoint is a mechanism where all the previous logs are removed from the system and are permanently stored on the
storage disk.  So, basically, checkpoints are those points from where the transaction log record can be used to recover all the
committed data up to the point of crash.

Next, le us discuss one of the most commonly asked DBMS interview questions, that is:

Q22. Mention the di erences between Trigger and Stored Procedures

Triggers Stored Procedures


A special kind of stored procedure that is not called directly by A group of SQL statements which can be reused again and
a user. In fact, a trigger is created and is programmed to re again. These statements are created and stored in the
when a speci c event occurs. database.
A trigger cannot be called or execute directly by a user.  Only Can execute stored procedures by using the exec command,
when the corresponding events are red, triggers are created. whenever we want. 
You can schedule a job to execute the stored procedure on a
You cannot schedule a trigger.
pre-de ned time.

https://www.edureka.co/blog/interview-questions/dbms-interview-questions 5/13
26/01/2021 Top 50 DBMS Interview Questions and Answers | Edureka

Cannot directly call another trigger within a trigger. Call a stored procedure from another stored procedure.
 Parameters cannot be passed as input  Parameters can be passed as input
Cannot return values.
Transactions are not allowed within a trigger. Subscribe
You
Can return zero or n values.
tocan
ouruse transactions within
Newsletter, and get personalized recommendations.
a stored procedure.
×
Q23. What are the di erences between Hash join, Merge joinSign
and upNested loops?
with Google
Hash join Merge join Nested loops
Merge join is used when projections of
The hash join is used when you have to Signup with Facebook The nested loop consists of an outer loop
the joined tables are sorted on the join
join large tables. and an inner loop.
columns.
Already have an account? Sign in.

Q24. What do you understand by Proactive, Retroactive and Simultaneous Update?


Proactive Update: These updates are applied to the database before it becomes e ective in the real-world environment.
Retroactive Update: These retroactive updates are applied to a database after it becomes e ective in the real-world
environment.
Simultaneous Update: These updates are applied to the database at the same instance of time as it becomes e ective in a
real-world environment.

Q25. What are indexes? Mention the di erences between the clustered and non-clustered index
Indexes are data structures responsible for improving the speed of data retrieval operations on a table. This data structure uses
more storage space to maintain extra copies of data by using additional writes. So, indexes are mainly used for searching
algorithms, where you wish to retrieve data in a quick manner.

The di erences between clustered and non-clustered index are as follows:

Clustered Index Non-clustered Index


A clustered index is faster Non clustered index is relatively slower
Does not alter the way it was stored but it creates a separate
Alters the way records are stored in a database as it sorts out
object within a table which points back to the original table
rows by the column which is set to be clustered index
rows after searching
One table can only have one clustered index One table can only have many non clustered indexes

Q26. What do you understand by intension and extension?


Intension: Intension or most commonly known as Database schema de nes the description of the database. This is speci ed
during the database design and mostly remains unchanged.

Extension: Extension is the number of tuples available in the database at any instance of time. This value keeps changing as and
when the tuples are created, updated and destroyed. So, the data present in the database at a speci c instance of time is known
as the extension of the database or most commonly known as the snapshot of the database.

Q27. What do you understand by cursor? Mention the di erent types of cursor
A cursor is a database object which helps in manipulating data, row by row and represents a result set.

The types of cursor are as follows:

Implicit cursor: This type of cursor is declared automatically as soon as the execution of SQL takes place. Here, the user is
not indicated about the declaration of the cursor.
Explicit cursor: This type of cursor is de ned by the PL/ SQL, as it handles a query in more than a single row.

Q28. Explain the terms specialization and generalization


Specialization: Specialization is a process of de ning a set of subclasses of the entity type. Here, each subclass will contain
all the attributes and relationships of the parent entity. Apart from this, the subclasses may contain additional attributes
and relationships speci c to itself.
Generalization: Generalization is a process of nding relations, common attributes for a particular set of entities; and
nally de ning a common superclass for them.

Q29. What do you understand by Data Independence?


When you say an application has data independence, it implies that the application is independent of the storage structure and
data access strategies of data.

Q30. What are the di erent integrity rules present in the DBMS?

The di erent integrity rules present in DBMS are as follows:

https://www.edureka.co/blog/interview-questions/dbms-interview-questions 6/13
26/01/2021 Top 50 DBMS Interview Questions and Answers | Edureka

Entity Integrity: This rule states that the value of the primary key can never be NULL. So, all the tuples in the column
identi ed as the primary key should have a value.
Referential Integrity: This rule states that either the value of the foreign key is NULL or it should be the primary key of any
other relation.
Subscribe to our Newsletter, and get personalized recommendations.
×
DBMS Interview Questions
Sign up with Google
Q31. What does Fill Factor concept mean with respect to indexes?
Fill Factor is used to mention the percentage of space left on every leaf-level page, which is packed with data. Usually, the default
value is 100. Signup with Facebook

Q32. What is Index hunting and how does it help in improving query performance?
Already have an account? Sign in.
The process of boosting a collection of indexes is known as Index hunting. This is done as indexes improve the query
performance and the speed at which they are processed.

It helps in improving query performance in the following way:

The best queries are suggested using the query optimizer.


Index, query distribution and their performance are used as metrics to check the e ect
Databases are tuned into a small collection of problem queries.

Q33. What are the di erences between network and hierarchical database model?

Network Database Model Hierarchical Database Model


A top-down structure where each parent node can have many
Each parent node can have multiple children nodes and vice
child nodes. But, a child node can have only a single parent
versa.
node.
Supports one-to-one, one-to-many, and many-to-many
Supports one-tone and one-to-many relationships
relationships

Q34. Explain what is a deadlock and mention how it can be resolved?


Deadlock is a situation which occurs when two transactions wait on a resource which is locked or other transaction holds. 
Deadlocks can be prevented by making all the transactions acquire all the locks at the same instance of time. So, once deadlock
occurs, the only way to cure is to abort one of the transactions and remove the partially completed work.

Q35. What are the di erences between an exclusive lock and a shared lock?

Exclusive Lock Shared Lock


An exclusive lock is a lock on a data item when a transaction is A shared lock allows more than one transaction to read the
about to perform the write operation. data items.

Next, in this article on DBMS interview questions, let us discuss the top questions asked about SQL. Donwload and Install SQL
Server here

SQL Interview Questions


Q1. What are the di erences between DROP, TRUNCATE and DELETE commands?

DROP TRUNCATE DELETE


Used to delete a database, table or a view Used to delete all rows from a table Used to delete a row in the table
Data cannot be rollbacked Data cannot be rollbacked Data can be rollbacked
A DDL command A DDL command A DML command.
Slower than TRUNCATE Faster than DROP and DELETE Slower than TRUNCATE
Deletes the structure of the row from a
Deletes the full structure of the table Preserves the structure of the table 
table

Q2. What is SQL and where is it used?


SQL aka Structured Query Language is the core of the relational database which is used for accessing and managing the
databases. This language is used to manipulate and retrieve data from a structured data format in the form of tables and holds
relationships between those tables. So, in layman terms, you can use SQL to communicate with the database.

Q3. What do you understand by sub-queries in SQL?


A subquery is a query inside another query where a query is de ned to retrieve data or information back from the database. In a
subquery, the outer query is called as the main query whereas the inner query is called subquery. Subqueries are always
executed rst and the result of the subquery is passed on to the main query. It can be nested inside a SELECT, UPDATE or any
other query. A subquery can also use any comparison operators such as >,< or =.

Q4. Mention the di erences between UNION and UNION ALL

https://www.edureka.co/blog/interview-questions/dbms-interview-questions 7/13
26/01/2021 Top 50 DBMS Interview Questions and Answers | Edureka

UNION UNION ALL


Combines the result of two or more SELECT statements Combines the result set of two or more SELECT statements
consisting of distinct values consisting of duplicate values
Syntax: UNION Syntax:
Subscribe to our UNION ALL and get personalized recommendations.
Newsletter,
×
Has low performance than UNION ALL, as duplicate rows need Has better performance than UNION, as duplicate rows need
to be removed. notup
Sign have
withto be removed.
Google

Q5. What do you understand by CLAUSE in SQL?


Signup with Facebook
CLAUSE in SQL is used to limit the result set by mentioning a condition to the query. So, you can use a CLAUSE to lter rows from
the entire set of records.
Already have an account? Sign in.
Example: WHERE HAVING clause.

Q6. Mention the di erences between HAVING and WHERE clause?


HAVING WHERE
 Used only with SELECT statement Used in a GROUP BY clause
Applied to each row before they are a part of the GROUP BY
Used with the GROUP BY function in a query
function in a query

Note: Whenever GROUP BY is not used, HAVING behaves like a WHERE clause.

tabases Training

SQL ESSENTIALS MYSQL DBA MONGODB TERADATA

󡔨 TRAINING &
CERTIFICATION 󡊓 CERTIFICATION
TRAINING 󡀳 CERTIFICATION
TRAINING 󡉁 CERTIFICATI
TRAINING

SQL Essentials Training & MySQL DBA Certi cation MongoDB Certi cation Teradata Certi cat
Certi cation Training Training Training

Reviews Reviews Reviews Reviews

     5(7045)      5(3902)      4(15327)      5(2441)

Q7. How can you perform pattern matching in SQL?


You can perform pattern matching in SQL by using the LIKE operator.  With the LIKE operator, you can use the following symbols:

1. %(Percentage sign) – To match zero or more characters.

2. _ (Underscore) –To match exactly one character.

Example:

SELECT * FROM Customers WHERE CustomerName LIKE ‘s%’

SELECT * FROM Customers WHERE CustomerName like ‘xyz_’

Q8. Mention few case manipulation functions in SQL


There are three case manipulation functions in SQL, namely:

LOWER: This function returns the string in lowercase. It takes a string as an argument and returns it by converting it into lower
case.

Syntax:  LOWER(‘string’)

UPPER: This function returns the string in uppercase. It takes a string as an argument and returns it by converting it into
uppercase.

Syntax: UPPER(‘string’)

INITCAP: This function returns the string with the rst letter in uppercase and the rest of the letters in lowercase.

Syntax: INITCAP(‘string’)

Q9. What are joins in SQL and what are the di erent types of joins?
https://www.edureka.co/blog/interview-questions/dbms-interview-questions 8/13
26/01/2021 Top 50 DBMS Interview Questions and Answers | Edureka

A JOIN clause is used to combine rows from two or more tables, based on a related column between them. It is used to merge
two tables or retrieve data from there. There are 4 joins in SQL namely: 

Inner Join ×
Subscribe to our Newsletter, and get personalized recommendations.
Right Join
Left Join
Sign up with Google
Full Join

Q10. What do you understand by the view and mention the steps to create, update and drop a view?
Signup with Facebook
A view in SQL is a single table, which is derived from other tables. So, a view contains rows and columns similar to a real table
and has elds from one or more table.
Already have an account? Sign in.

To create a view, use the following syntax:

1 CREATE VIEW ViewName AS


2 SELECT Column1, Column2, ..., ColumnN
3 FROM TableName
4 WHERE Condition;

To update a view, use the following syntax:

1 CREATE VIEW OR REPLACE ViewName AS


2 SELECT Column1, Column2, ..., ColumnN
3 FROM TableName
4 WHERE Condition;

To drop a view, use the following syntax:

1 DROP VIEW ViewName;

Next, in this article on DBMS interview questions, let us discuss the most frequently asked queries about SQL.

SQL Query Based Interview Questions


Q1. Write a query to create a duplicate table with and without data present?
Consider you have a table named Customers, having details such as CustomerID, CustomerName and so on. Now, if you want to
create a duplicate table named ‘DuplicateCustomer’ with the data present in it, you can mention the following query:

1 CREATE TABLE DuplicateCustomer AS SELECT * FROM Customers;

Similarly, if you want to create a duplicate table without the data present, mention the following query:

1 CREATE TABLE DuplicateCustomer AS SELECT * FROM Customers WHERE 1=2;

Q2. Mention a query to calculate the even and odd records from a table
To write a query to calculate the even and odd records from a table, you can write two di erent queries by using the MOD
function.

So, if you want to retrieve the even records from a table, you can write a query as follows:

1 SELECT CustomerID FROM (SELECT rowno, CustomerID from Customers) where mod(rowno,2)=0;

Similarly, if you want to retrieve the odd records from a table, you can write a query as follows:

1 SELECT CustomerID FROM (SELECT rowno, CustomerID from Customers) where mod(rowno,2)=1;

Q3. Write a query to remove duplicate rows from a table?


To remove duplicate rows from a table, you have to initially select the duplicate rows from the table without using the DISTINCT
keyword. So, to select the duplicate rows from the table, you can write a query as follows:

1 SELECT CustomerNumber FROM Customers WHERE ROWID (SELECT MAX (rowid) FROM Customers C WHERE CustomerNumb

Now, to delete the duplicate records from the Customers table, mention the following query:

1 DELETE FROM Customers WHERE ROWID(SELECT MAX (rowid) FROM Customers C WHERE CustomerNumber = C.CustomerN

Q4. Mention a query to add email validation to your database
https://www.edureka.co/blog/interview-questions/dbms-interview-questions 9/13
26/01/2021 Top 50 DBMS Interview Questions and Answers | Edureka

Well, there are multiple ways to add email validation to your database, but one out the lot is as follows:

Subscribe
MySQL DBA Certito cation
our Newsletter,
Training and get personalized recommendations.
×
Weekday / Weekend Batches
Sign up with Google

See Batch Details

Signup with Facebook

1 SELECT Email FROM Customers WHERE NOT REGEXP_LIKE(Email, &amp;lsquo;[A-Z0-9._%+-]+@[A-Z0-9.-]+.[A-Z]{2,4


Already have an account? Sign in.

Q5. Write a query to retrieve the last day of next month in Oracle.
To write a query to retrieve the last day of the next month in Oracle, you can write a query as follows:

1 SELECT LAST_DAY (ADD_MONTHS (SYSDATE,1)) from dual;

So this brings us to the end of the DBMS Interview Questions article. I hope this set of DBMS Interview Questions will help you
ace your job interview. All the best for your interview!

Check out this  MySQL DBA Certi cation Training  by Edureka, a trusted online learning company with a network  of more than
250,000 satis ed learners spread across the globe. This course trains you on the core concepts & advanced tools and techniques
to manage data and administer the MySQL Database. It includes hands-on learning on concepts like MySQL Workbench, MySQL
Server, Data Modeling, MySQL Connector, Database Design, MySQL Command line, MySQL Functions, etc. End of the training you
will be able to create and administer your own MySQL Database and manage data.

Got a question for us? Please mention it in the comments section of this “DBMS Interview Questions” article and we will get back
to you as soon as possible.

Recommended videos for you

 
Build Application With Introduction to MongoDB
MongoDB

Watch Now Watch Now

Recommended blogs for you


What are SQL constraints and Why Learn Cassandra with Learn About How To
its di erent types? Hadoop? Server Management

https://www.edureka.co/blog/interview-questions/dbms-interview-questions 10/13
26/01/2021 Top 50 DBMS Interview Questions and Answers | Edureka

Di erences Between SQL &


Read Article Read Article NoSQL Databases – MySQL & Read Article
MongoDB Comparison

Subscribe to our Newsletter, and get personalized recommendations.


×
Read Article

Sign up with Google

‹›

Signup with Facebook


Comments 1 Comment

Sakib Sadman says: Already have an account? Sign in.


Jul 13, 2020 at 8:53 am GMT

Thanks a lot for preparing this.

Reply

Join the discussion

Trending Courses in Databases

SQL Essentials Training & MySQL DBA Certi cation MongoDB Certi cation Apache Cassandr
Certi cation Training Training Certi cation Train
 8k Enrolled Learners  4k Enrolled Learners  16k Enrolled Learners  13k Enrolled Learne
 Weekend/Weekday  Weekend  Weekend  Weekend
 Self Paced  Live Class  Live Class  Live Class

Reviews Reviews Reviews Reviews

 5 (2850)  5 (1600)  4 (6150)  5 (4950)

‹›
Browse Categories

Arti cial Intelligence BI and Visualization Big Data Blockchain Cloud Computing Cyber Security Data Science

Data Warehousing and ETL DevOps Digital Marketing Enterprise Front End Web Development Mobile Development

https://www.edureka.co/blog/interview-questions/dbms-interview-questions 11/13
26/01/2021 Top 50 DBMS Interview Questions and Answers | Edureka

Operating Systems Programming & Frameworks Project Management and Methodologies Robotic Process Automation Software Testing

Systems & Architecture

Subscribe to our Newsletter, and get personalized recommendations.


×
Sign up with Google

TRENDING CERTIFICATION COURSES TRENDING MASTERS COURSES
Signup with Facebook
DevOps Certi cation Training Data Scientist Masters Program

AWS Architect Certi cation Training DevOps Engineer Masters Program


Already have an account? Sign in.
Big Data Hadoop Certi cation Training Cloud Architect Masters Program

Tableau Training & Certi cation Big Data Architect Masters Program

Python Certi cation Training for Data Science Machine Learning Engineer Masters Program

Selenium Certi cation Training Full Stack Web Developer Masters Program

PMP® Certi cation Exam Training Business Intelligence Masters Program

Robotic Process Automation Training using UiPath Data Analyst Masters Program

Apache Spark and Scala Certi cation Training Test Automation Engineer Masters Program

Microsoft Power BI Training Post-Graduate Program in Arti cial Intelligence & Machine Learning

Online Java Course and Training Post-Graduate Program in Big Data Engineering

Python Certi cation Course

COMPANY WORK WITH US

About us Careers

News & Media Become an Instructor

Reviews Become an A liate

Contact us Become a Partner

Blog Hire from Edureka

Community
DOWNLOAD APP
Sitemap

Blog Sitemap

Community Sitemap

Webinars

CATEGORIES 

CATEGORIES
Cloud Computing DevOps Big Data Data Science BI and Visualization Programming & Frameworks Software Testing

Project Management and Methodologies Robotic Process Automation Frontend Development Data Warehousing and ETL Arti cial Intelligence

Blockchain Databases Cyber Security Mobile Development Operating Systems Architecture & Design Patterns Digital Marketing

TRENDING BLOG ARTICLES 

TRENDING BLOG ARTICLES


Selenium tutorial Selenium interview questions Java tutorial What is HTML Java interview questions PHP tutorial JavaScript interview questions

Spring tutorial PHP interview questions Inheritance in Java Polymorphism in Java Spring interview questions Pointers in C Linux commands

Android tutorial JavaScript tutorial jQuery tutorial SQL interview questions MySQL tutorial Machine learning tutorial Python tutorial

What is machine learning Ethical hacking tutorial SQL injection AWS certi cation career opportunities AWS tutorial What Is cloud computing

What is blockchain Hadoop tutorial What is arti cial intelligence Node Tutorial Collections in Java Exception handling in java

Python Programming Language Python interview questions Multithreading in Java ReactJS Tutorial Data Science vs Big Data vs Data Analyt…

Software Testing Interview Questions R Tutorial Java Programs JavaScript Reserved Words and Keywor… Implement thread.yield() in Java: Exam…

Implement Optical Character Recogniti… All you Need to Know About Implemen…

© 2021 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved. Terms & Conditions    

https://www.edureka.co/blog/interview-questions/dbms-interview-questions 12/13
26/01/2021 Top 50 DBMS Interview Questions and Answers | Edureka

Legal & Privacy

Subscribe to our Newsletter, and get personalized recommendations.


×
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of
MongoDB, Inc.
Sign up with Google

Signup with Facebook

Already have an account? Sign in.

https://www.edureka.co/blog/interview-questions/dbms-interview-questions 13/13
26/01/2021 Top 52 DBMS Interview Questions - javatpoint

DBMS Interview Questions


A list of top frequently asked DBMS interview questions and answers are given below.

1) What is DBMS?

DBMS is a collection of programs that facilitates users to create and maintain a database.
In other words, DBMS provides us an interface or tool for performing different operations
such as the creation of a database, inserting data into it, deleting data from it, updating the
data, etc. DBMS is a software in which data is stored in a more secure way as compared to
the file-based system. Using DBMS, we can overcome many problems such as- data
redundancy, data inconsistency, easy access, more organized and understandable, and so
on. There is the name of some popular Database Management System- MySQL, Oracle,
SQL Server, Amazon simple DB (Cloud-based), etc.

Working of DBMS is defined in the figure below.

SP Jain's MBA Programs


Study in Mumbai, Dubai, Singapore
& Sydney. Apply now to be part of
the Feb’21 intake.

2) What is a database?

https://www.javatpoint.com/dbms-interview-questions 1/15
26/01/2021 Top 52 DBMS Interview Questions - javatpoint

A Database is a logical, consistent and organized collection of data that it can easily be
accessed, managed and updated. Databases, also known as electronic databases are
structured to provide the facility of creation, insertion, updating of the data efficiently and
are stored in the form of a file or set of files, on the magnetic disk, tapes and another sort
of secondary devices. Database mostly consists of the objects (tables), and tables include
of the records and fields. Fields are the basic units of data storage, which contain the
information about a particular aspect or attribute of the entity described by the database.
DBMS is used for extraction of data from the database in the form of the queries.

For more information: Click here

3) What is a database system?

The collection of database and DBMS software together is known as a database system.
Through the database system, we can perform many activities such as-

The data can be stored in the database with ease, and there are no issues of data
redundancy and data inconsistency.

The data will be extracted from the database using DBMS software whenever required. So,
the combination of database and DBMS software enables one to store, retrieve and access
data with considerate accuracy and security.

4) What are the advantages of DBMS?

Redundancy control

Restriction for unauthorized access

Provides multiple user interfaces

Provides backup and recovery

Enforces integrity constraints

Ensure data consistency

Easy accessibility

Easy data extraction and data processing due to the use of queries

For more information: Click here

5) What is a checkpoint in DBMS?

The Checkpoint is a type of mechanism where all the previous logs are removed from the
system and permanently stored in the storage disk.

There are two ways which can help the DBMS in recovering and maintaining the ACID
properties, and they are- maintaining the log of each transaction and maintaining shadow
pages. So, when it comes to log based recovery system, checkpoints come into existence.
Checkpoints are those points to which the database engine can recover after a crash as a
specified minimal point from where the transaction log record can be used to recover all the
committed data up to the point of the crash.

6) When does checkpoint occur in DBMS?

https://www.javatpoint.com/dbms-interview-questions 2/15
26/01/2021 Top 52 DBMS Interview Questions - javatpoint

A checkpoint is like a snapshot of the DBMS state. Using checkpoints, the DBMS can reduce
the amount of work to be done during a restart in the event of subsequent crashes.
Checkpoints are used for the recovery of the database after the system crash. Checkpoints
are used in the log-based recovery system. When due to a system crash we need to restart
the system then at that point we use checkpoints. So that, we don't have to perform the
transactions from the very starting.

7) What do you mean by transparent DBMS?

The transparent DBMS is a type of DBMS which keeps its physical structure hidden from
users. Physical structure or physical storage structure implies to the memory manager of
the DBMS, and it describes how the data stored on disk.

8) What are the unary operations in Relational Algebra?

PROJECTION and SELECTION are the unary operations in relational algebra. Unary
operations are those operations which use single operands. Unary operations are
SELECTION, PROJECTION, and RENAME.

As in SELECTION relational operators are used for example - =,<=,>=, etc.

9) What is RDBMS?

RDBMS stands for Relational Database Management Systems. It is used to maintain the
data records and indices in tables. RDBMS is the form of DBMS which uses the structure to
identify and access data concerning the other piece of data in the database. RDBMS is the
system that enables you to perform different operations such as- update, insert, delete,
manipulate and administer a relational database with minimal difficulties. Most of the time
RDBMS use SQL language because it is easily understandable and is used for often.

10) How many types of database languages are?

There are four types of database languages:

Data Definition Language (DDL) e.g., CREATE, ALTER, DROP, TRUNCATE,


RENAME, etc. All these commands are used for updating the data that?s why they
are known as Data Definition Language.

Data Manipulation Language (DML) e.g., SELECT, UPDATE, INSERT, DELETE, etc.
These commands are used for the manipulation of already updated data that's why
they are the part of Data Manipulation Language.

DATA Control Language (DCL) e.g., GRANT and REVOKE. These commands are
used for giving and removing the user access on the database. So, they are the part
of Data Control Language.

Transaction Control Language (TCL) e.g., COMMIT, ROLLBACK, and SAVEPOINT.


These are the commands used for managing transactions in the database. TCL is
used for managing the changes made by DML.

Database language implies the queries that are used for the update, modify and manipulate
the data.

https://www.javatpoint.com/dbms-interview-questions 3/15
26/01/2021 Top 52 DBMS Interview Questions - javatpoint

11) What do you understand by Data Model?

The Data model is specified as a collection of conceptual tools for describing data, data
relationships, data semantics and constraints. These models are used to describe the
relationship between the entities and their attributes.

There is the number of data models:

Hierarchical data model

network model

relational model

Entity-Relationship model and so on.

12) Define a Relation Schema and a Relation.

A Relation Schema is specified as a set of attributes. It is also known as table schema. It


defines what the name of the table is. Relation schema is known as the blueprint with the
help of which we can explain that how the data is organized into tables. This blueprint
contains no data.

A relation is specified as a set of tuples. A relation is the set of related attributes with
identifying key attributes

See this example:

Let r be the relation which contains set tuples (t1, t2, t3, ..., tn). Each tuple is an ordered
list of n-values t=(v1,v2, ...., vn).

13) What is a degree of Relation?

The degree of relation is a number of attribute of its relation schema. A degree of relation is
also known as Cardinality it is defined as the number of occurrence of one entity which is
connected to the number of occurrence of other entity. There are three degree of relation
they are one-to-one(1:1), one-to-many(1:M), many-to-one(M:M).

14) What is the Relationship?

The Relationship is defined as an association among two or more entities. There are three
type of relationships in DBMS-

https://www.javatpoint.com/dbms-interview-questions 4/15
26/01/2021 Top 52 DBMS Interview Questions - javatpoint

One-To-One: Here one record of any object can be related to one record of another
object.

One-To-Many (many-to-one): Here one record of any object can be related to many
records of other object and vice versa.

Many-to-many: Here more than one records of an object can be related to n number of
records of another object.

15) What are the disadvantages of file processing systems?

Inconsistent

Not secure

Data redundancy

Difficult in accessing data

Data isolation

Data integrity

Concurrent access is not possible

Limited data sharing

Atomicity problem

16) What is data abstraction in DBMS?

Data abstraction in DBMS is a process of hiding irrelevant details from users. Because
database systems are made of complex data structures so, it makes accessible the user
interaction with the database.

For example: We know that most of the users prefer those systems which have a simple
GUI that means no complex processing. So, to keep the user tuned and for making the
access to the data easy, it is necessary to do data abstraction. In addition to it, data
abstraction divides the system in different layers to make the work specified and well
defined.

17) What are the three levels of data abstraction?

Following are three levels of data abstraction:

Physical level: It is the lowest level of abstraction. It describes how data are stored.

Logical level: It is the next higher level of abstraction. It describes what data are stored in
the database and what the relationship among those data is.

View level: It is the highest level of data abstraction. It describes only part of the entire
database.

For example- User interacts with the system using the GUI and fill the required details,
but the user doesn't have any idea how the data is being used. So, the abstraction level is
entirely high in VIEW LEVEL.

Then, the next level is for PROGRAMMERS as in this level the fields and records are visible
and the programmers have the knowledge of this layer. So, the level of abstraction here is
a little low in VIEW LEVEL.

https://www.javatpoint.com/dbms-interview-questions 5/15
26/01/2021 Top 52 DBMS Interview Questions - javatpoint

And lastly, physical level in which storage blocks are described.

18) What is DDL (Data Definition Language)?

Data Definition Language (DDL) is a standard for commands which defines the different
structures in a database. Most commonly DDL statements are CREATE, ALTER, and DROP.
These commands are used for updating data into the database.

19) What is DML (Data Manipulation Language)?

DData Manipulation Language (DML) is a language that enables the user to access or
manipulate data as organized by the appropriate data model. For example- SELECT,
UPDATE, INSERT, DELETE.

There is two type of DML:

Procedural DML or Low level DML: It requires a user to specify what data are needed
and how to get those data.

Non-Procedural DML or High level DML:It requires a user to specify what data are
needed without specifying how to get those data.

20) Explain the functionality of DML Compiler.

The DML Compiler translates DML statements in a query language that the query evaluation
engine can understand. DML Compiler is required because the DML is the family of syntax
element which is very similar to the other programming language which requires
compilation. So, it is essential to compile the code in the language which query evaluation
engine can understand and then work on those queries with proper output.

21) What is Relational Algebra?

Relational Algebra is a Procedural Query Language which contains a set of operations that
take one or two relations as input and produce a new relationship. Relational algebra is the
basic set of operations for the relational model. The decisive point of relational algebra is
that it is similar to the algebra which operates on the number.

There are few fundamental operations of relational algebra:

select

project

set difference

union

rename,etc.

22) What is Relational Calculus?

Relational Calculus is a Non-procedural Query Language which uses mathematical predicate


calculus instead of algebra. Relational calculus doesn't work on mathematics fundamentals
such as algebra, differential, integration, etc. That's why it is also known as predicate
calculus.

https://www.javatpoint.com/dbms-interview-questions 6/15
26/01/2021 Top 52 DBMS Interview Questions - javatpoint

There is two type of relational calculus:

Tuple relational calculus

Domain relational calculus

23) What do you understand by query optimization?

The term query optimization specifies an efficient execution plan for evaluating a query that
has the least estimated cost. The concept of query optimization came into the frame when
there were a number of methods, and algorithms existed for the same task then the
question arose that which one is more efficient and the process of determining the efficient
way is known as query optimization.

There are many benefits of query optimization:

It reduces the time and space complexity.

More queries can be performed as due to optimization every query comparatively


takes less time.

User satisfaction as it will provide output fast

24) What do you mean by durability in DBMS?

Once the DBMS informs the user that a transaction has completed successfully, its effect
should persist even if the system crashes before all its changes are reflected on disk. This
property is called durability. Durability ensures that once the transaction is committed into
the database, it will be stored in the non-volatile memory and after that system failure
cannot affect that data anymore.

25) What is normalization?

Normalization is a process of analysing the given relation schemas according to their


functional dependencies. It is used to minimize redundancy and also used to minimize
insertion, deletion and update distractions. Normalization is considered as an essential
process as it is used to avoid data redundancy, insertion anomaly, updation anomaly,
deletion anomaly.

There most commonly used normal forms are:

First Normal Form(1NF)

Second Normal Form(2NF)

Third Normal Form(3NF)

Boyce & Codd Normal Form(BCNF)

26) What is Denormalization?

Denormalization is the process of boosting up database performance and adding of


redundant data which helps to get rid of complex data. Denormalization is a part of
database optimization technique. This process is used to avoid the use of complex and
costly joins. Denormalization doesn't refer to the thought of not to normalize instead of that
denormalization takes place after normalization. In this process, firstly the redundancy of

https://www.javatpoint.com/dbms-interview-questions 7/15
26/01/2021 Top 52 DBMS Interview Questions - javatpoint

the data will be removed using normalization process than through denormalization process
we will add redundant data as per the requirement so that we can easily avoid the costly
joins.

27) What is functional Dependency?

Functional Dependency is the starting point of normalization. It exists when a relation


between two attributes allow you to determine the corresponding attribute's value uniquely.
The functional dependency is also known as database dependency and defines as the
relationship which occurs when one attribute in a relation uniquely determines another
attribute. It is written as A->B which means B is functionally dependent on A.

28) What is the E-R model?

E-R model is a short name for the Entity-Relationship model. This model is based on the
real world. It contains necessary objects (known as entities) and the relationship among
these objects. Here the primary objects are the entity, attribute of that entity, relationship
set, an attribute of that relationship set can be mapped in the form of E-R diagram.

In E-R diagram, entities are represented by rectangles, relationships are represented by


diamonds, attributes are the characteristics of entities and represented by ellipses, and
data flow is represented through a straight line.

29) What is an entity?

The Entity is a set of attributes in a database. An entity can be a real-world object which
physically exists in this world. All the entities have their attribute which in the real world
considered as the characteristics of the object.

For example: In the employee database of a company, the employee, department, and the
designation can be considered as the entities. These entities have some characteristics
which will be the attributes of the corresponding entity.

30) What is an Entity type?

An entity type is specified as a collection of entities, having the same attributes. Entity type
typically corresponds to one or several related tables in the database. A characteristic or
trait which defines or uniquely identifies the entity is called entity type.

For example, a student has student_id, department, and course as its characteristics.

31) What is an Entity set?

The entity set specifies the collection of all entities of a particular entity type in the
database. An entity set is known as the set of all the entities which share the same
properties.

For example, a set of people, a set of students, a set of companies, etc.

32) What is an Extension of entity type?

An extension of an entity type is specified as a collection of entities of a particular entity


type that are grouped into an entity set.

https://www.javatpoint.com/dbms-interview-questions 8/15
26/01/2021 Top 52 DBMS Interview Questions - javatpoint

33) What is Weak Entity set?

An entity set that doesn't have sufficient attributes to form a primary key is referred to as a
weak entity set. The member of a weak entity set is known as a subordinate entity. Weak
entity set does not have a primary key, but we need a mean to differentiate among all
those entries in the entity set that depend on one particular strong entity set.

34) What is an attribute?

An attribute refers to a database component. It is used to describe the property of an


entity. An attribute can be defined as the characteristics of the entity. Entities can be
uniquely identified using the attributes. Attributes represent the instances in the row of the
database.

For example: If a student is an entity in the table then age will be the attribute of that
student.

35) What are the integrity rules in DBMS?

Data integrity is one significant aspect while maintaining the database. So, data integrity is
enforced in the database system by imposing a series of rules. Those set of integrity is
known as the integrity rules.

There are two integrity rules in DBMS:

Entity Integrity : It specifies that "Primary key cannot have a NULL value."

Referential Integrity: It specifies that "Foreign Key can be either a NULL value or should
be the Primary Key value of other relation

36) What do you mean by extension and intension?

Extension: The Extension is the number of tuples present in a table at any instance. It
changes as the tuples are created, updated and destroyed. The actual data in the database
change quite frequently. So, the data in the database at a particular moment in time is
known as extension or database state or snapshot. It is time dependent.

Intension: Intension is also known as Data Schema and defined as the description of the
database, which is specified during database design and is expected to remain unchanged.
The Intension is a constant value that gives the name, structure of tables and the
constraints laid on it.

37) What is System R? How many of its two major subsystems?

System R was designed and developed from 1974 to 1979 at IBM San Jose Research
Centre. System R is the first implementation of SQL, which is the standard relational data
query language, and it was also the first to demonstrate that RDBMS could provide better
transaction processing performance. It is a prototype which is formed to show that it is
possible to build a Relational System that can be used in a real-life environment to solve
real-life problems.

Following are two major subsystems of System R:

Research Storage

https://www.javatpoint.com/dbms-interview-questions 9/15
26/01/2021 Top 52 DBMS Interview Questions - javatpoint

System Relational Data System

38) What is Data Independence?

Data independence specifies that "the application is independent of the storage structure
and access strategy of data." It makes you able to modify the schema definition at one
level without altering the schema definition in the next higher level.

It makes you able to modify the schema definition in one level should not affect the schema
definition in the next higher level.

There are two types of Data Independence:

Physical Data Independence: Physical data is the data stored in the database. It is in
the bit-format. Modification in physical level should not affect the logical level.

For example: If we want to manipulate the data inside any table that should not change the
format of the table.

Logical Data Independence: Logical data in the data about the database. It basically
defines the structure. Such as tables stored in the database. Modification in logical level
should not affect the view level.

For example: If we need to modify the format of any table, that modification should not
affect the data inside it.

NOTE: Logical Data Independence is more difficult to achieve.

39) What are the three levels of data abstraction?

Following are three levels of data abstraction:

Physical level: It is the lowest level of abstraction. It describes how data are stored.

Logical level: It is the next higher level of abstraction. It describes what data are stored in
the database and what relationship among those data.

View level: It is the highest level of data abstraction. It describes only part of the entire
database.

For example- User interact with the system using the GUI and fill the required details, but
the user doesn't have any idea how the data is being used. So, the abstraction level is
absolutely high in VIEW LEVEL.

Then, the next level is for PROGRAMMERS as in this level the fields and records are visible
and the programmer has the knowledge of this layer. So, the level of abstraction here is a
little low in VIEW LEVEL.

And lastly, physical level in which storage blocks are described.

40) What is Join?

The Join operation is one of the most useful activities in relational algebra. It is most
commonly used way to combine information from two or more relations. A Join is always
performed on the basis of the same or related column. Most complex queries of SQL involve

https://www.javatpoint.com/dbms-interview-questions 10/15
26/01/2021 Top 52 DBMS Interview Questions - javatpoint

JOIN command.

There are following types of join:

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

Theta join

Natural join

Equi join

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

Left outer join

Right outer join

Full outer join

41) What is 1NF?

1NF is the First Normal Form. It is the simplest type of normalization that you can
implement in a database. The primary objectives of 1NF are to:

Every column must have atomic (single value)

To Remove duplicate columns from the same table

Create separate tables for each group of related data and identify each row with a
unique column

42) What is 2NF?

2NF is the Second Normal Form. A table is said to be 2NF if it follows the following
conditions:

The table is in 1NF, i.e., firstly it is necessary that the table should follow the rules of
1NF.

Every non-prime attribute is fully functionally dependent on the primary key, i.e.,
every non-key attribute should be dependent on the primary key in such a way that
if any key element is deleted, then even the non_key element will still be saved in
the database.

43) What is 3NF?

3NF stands for Third Normal Form. A database is called in 3NF if it satisfies the following
conditions:

It is in second normal form.

There is no transitive functional dependency.

For example: X->Z

Where:
X->Y
Y does not -> X
Y->Z so, X->Z

https://www.javatpoint.com/dbms-interview-questions 11/15
26/01/2021 Top 52 DBMS Interview Questions - javatpoint

44) What is BCNF?

BCMF stands for Boyce-Codd Normal Form. It is an advanced version of 3NF, so it is also
referred to as 3.5NF. BCNF is stricter than 3NF.

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

It is in 3NF.

For every functional dependency X->Y, X should be the super key of the table. It
merely means that X cannot be a non-prime attribute if Y is a prime attribute.

45) Explain ACID properties

ACID properties are some basic rules, which has to be satisfied by every transaction to
preserve the integrity. These properties and rules are:

ATOMICITY: Atomicity is more generally known as ?all or nothing rule.' Which implies all
are considered as one unit, and they either run to completion or not executed at all.

CONSISTENCY: This property refers to the uniformity of the data. Consistency implies that
the database is consistent before and after the transaction.

ISOLATION: This property states that the number of the transaction can be executed
concurrently without leading to the inconsistency of the database state.

DURABILITY: This property ensures that once the transaction is committed it will be
stored in the non-volatile memory and system crash can also not affect it anymore.

46) What is stored procedure?

A stored procedure is a group of SQL statements that have been created and stored in the
database. The stored procedure increases the reusability as here the code or the procedure
is stored into the system and used again and again that makes the work easy, takes less
time in processing and decreases the complexity of the system. So, if you have a code
which you need to use again and again then save that code and call that code whenever it
is required.

47) What is the difference between a DELETE command and


TRUNCATE command?

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

DELETE command delete only those rows which are specified with the WHERE clause.

DELETE command can be rolled back.

DELETE command maintain a log, that's why it is slow.

DELETE use row lock while performing DELETE function.

TRUNCATE command: TRUNCATE command is used to remove all rows (complete data)
from a table. It is similar to the DELETE command with no WHERE clause.

The TRUNCATE command removes all the rows from the table.

The TRUNCATE command cannot be rolled back.

https://www.javatpoint.com/dbms-interview-questions 12/15
26/01/2021 Top 52 DBMS Interview Questions - javatpoint

The TRUNCATE command doesn't maintain a log. That's why it is fast.

TRUNCATE use table log while performing the TRUNCATE function.

48) What is 2-Tier architecture?

The 2-Tier architecture is the same as basic client-server. In the two-tier architecture,
applications on the client end can directly communicate with the database at the server
side.

49) What is the 3-Tier architecture?

The 3-Tier architecture contains another layer between the client and server. Introduction
of 3-tier architecture is for the ease of the users as it provides the GUI, which, make the
system secure and much more accessible. In this architecture, the application on the client-
end interacts with an application on the server which further communicates with the
database system.

https://www.javatpoint.com/dbms-interview-questions 13/15
26/01/2021 Top 52 DBMS Interview Questions - javatpoint

50) How do you communicate with an RDBMS?

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

51) What is the difference between a shared lock and exclusive lock?

Shared lock: Shared lock is required for reading a data item. In the shared lock, many
transactions may hold a lock on the same data item. When more than one transaction is
allowed to read the data items then that is known as the shared lock.

Exclusive lock: When any transaction is about to perform the write operation, then the
lock on the data item is an exclusive lock. Because, if we allow more than one transaction
then that will lead to the inconsistency in the database.

52) Describe the types of keys?

There are following types of keys:

Primary key: The Primary key is an attribute in a table that can uniquely identify each
record in a table. It is compulsory for every table.

Candidate key: The Candidate key is an attribute or set of an attribute which can uniquely
identify a tuple. The Primary key can be selected from these attributes.

Super key: The Super key is a set of attributes which can uniquely identify a tuple. Super
key is a superset of the candidate key.

Foreign key: The Foreign key is a primary key from one table, which has a relationship
with another table. It acts as a cross-reference between tables.

https://www.javatpoint.com/dbms-interview-questions 14/15
26/01/2021 Top 52 DBMS Interview Questions - javatpoint

Interview Tips Job/HR Interview Questions

JavaScript Interview Questions jQuery Interview Questions

Java Basics Interview Questions Java OOPs Interview Questions

Servlet Interview Questions JSP Interview Questions

Spring Interview Questions Hibernate Interview Questions

PL/SQL Interview Questions SQL Interview Questions

Oracle Interview Questions Android Interview Questions

SQL Server Interview Questions MySQL Interview Questions

https://www.javatpoint.com/dbms-interview-questions 15/15

You might also like