DBMS Interview Questions and Answers: Sindhuja Hari
DBMS Interview Questions and Answers: Sindhuja Hari
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).
CHECKPOINT 10
https://hackr.io/blog/dbms-interview-questions 2/21
26/01/2021 50+ Best DBMS Interview Questions & Answers in 2021 [Updated]
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.
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.
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: 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.
DELETE TRUNCATE
Can acquire a row lock Locks the entire table and page
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: 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.
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]
GoDaddy.com Shop No
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.
select student_id, student_name, marks from students outer where salary > (select avg(mar
ks) from students where subject = outer.students);
https://hackr.io/blog/dbms-interview-questions 7/21
26/01/2021 50+ Best DBMS Interview Questions & Answers in 2021 [Updated]
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.
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.
https://hackr.io/blog/dbms-interview-questions 8/21
26/01/2021 50+ Best DBMS Interview Questions & Answers in 2021 [Updated]
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
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>
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.
https://hackr.io/blog/dbms-interview-questions 9/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.
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.
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.
https://hackr.io/blog/dbms-interview-questions 12/21
26/01/2021 50+ Best DBMS Interview Questions & Answers in 2021 [Updated]
https://hackr.io/blog/dbms-interview-questions 13/21
26/01/2021 50+ Best DBMS Interview Questions & Answers in 2021 [Updated]
GoDaddy.com Shop N
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.
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.
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).
https://hackr.io/blog/dbms-interview-questions 15/21
26/01/2021 50+ Best DBMS Interview Questions & Answers in 2021 [Updated]
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)
(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)
(https://hackr.io/blog/software-testing-interview-questions)
(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
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)
(https://hackr.io/tutorial/the-complete-sql-bootcamp)
(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]
(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
systems.
4. Integrity problems
5. Atomicity of updates
7. Security problems
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
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
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
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.
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
Relation schemas that do not meet the proper ties are decomposed into smaller relation
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
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.
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
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.
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
CourseIDEnrollNo
deepak singh
1 1000
[email protected]
Continue as deepak
2 1000
1 1002
2 1003
Following is join quer y that shows names of students enrolled in different courseIDs.
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
deepak singh
[email protected]
Continue as deepak
What is Identity?
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
Ans : A view is a vir tual table based on the result-set of an SQL statement. We can create
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
Google
4. Views can hide the complexity of data; for example a view could appear as Sales2000
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
Ans : A stored procedure is like a function that contains a set of operations compiled
Ans : Unlike Stored Procedures, Triggers cannot be called directly. They can only be
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
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
purpose, indexes are created on tables. These indexes need extra space on disk, but
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
DBMS Ar ticles
Please write comments if you find anything incorrect, or you want to share more
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
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
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
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
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.
Writing code in comment? Please use ide.geeksforgeeks.org, generate link and share the link here.
Load Comments
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
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
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
https://www.softwaretestinghelp.com/top-dbms-interview-questions/ 2/12
26/01/2021 Top 30 DBMS Interview Questions and Answers
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: 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.
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
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.
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?
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.
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.
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.
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.
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.
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.
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.
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
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.
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.
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.
Any table is said to have in the 2NF if it satis es the following 2 conditions:
Any table is said to have in the 3NF if it satis es the following 2 conditions:
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:
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:
If you want to fetch the even numbers, then the following query can be used:
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:
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.
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.
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.
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.
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.
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.
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
https://www.softwaretestinghelp.com/top-dbms-interview-questions/ 11/12
26/01/2021 Top 30 DBMS Interview Questions and Answers
Recommended Reading
https://www.softwaretestinghelp.com/top-dbms-interview-questions/ 12/12
26/01/2021 Top 50 DBMS Interview Questions and Answers | Edureka
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.
For your better understanding, I have divided the article into the following sections:
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.
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.
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.
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.
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.
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.
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.
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.
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
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.
Explore Curriculum
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
https://www.edureka.co/blog/interview-questions/dbms-interview-questions 4/13
26/01/2021 Top 50 DBMS Interview Questions and Answers | Edureka
Q20. Mention the di erences between Unique Key and Primary Key
Next, le us discuss one of the most commonly asked DBMS interview questions, that is:
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.
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.
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.
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.
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.
Q33. What are the di erences between network and hierarchical database model?
Q35. What are the di erences between an exclusive lock and a shared lock?
Next, in this article on DBMS interview questions, let us discuss the top questions asked about SQL. Donwload and Install SQL
Server here
https://www.edureka.co/blog/interview-questions/dbms-interview-questions 7/13
26/01/2021 Top 50 DBMS Interview Questions and Answers | Edureka
Note: Whenever GROUP BY is not used, HAVING behaves like a WHERE clause.
tabases Training
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
Example:
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.
Next, in this article on DBMS interview questions, let us discuss the most frequently asked queries about SQL.
Similarly, if you want to create a duplicate table without the data present, mention the following query:
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;
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
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:
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.
Build Application With Introduction to MongoDB
MongoDB
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
‹›
Reply
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
‹›
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
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
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
About us Careers
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
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
https://www.edureka.co/blog/interview-questions/dbms-interview-questions 13/13
26/01/2021 Top 52 DBMS Interview Questions - javatpoint
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.
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.
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.
Redundancy control
Easy accessibility
Easy data extraction and data processing due to the use of queries
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.
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.
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.
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.
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.
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.
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
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.
network model
relational model
A relation is specified as a set of tuples. A relation is the set of related attributes with
identifying key attributes
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).
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).
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.
Inconsistent
Not secure
Data redundancy
Data isolation
Data integrity
Atomicity problem
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.
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
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.
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.
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.
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.
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.
select
project
set difference
union
rename,etc.
https://www.javatpoint.com/dbms-interview-questions 6/15
26/01/2021 Top 52 DBMS Interview Questions - javatpoint
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.
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.
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.
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.
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.
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.
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.
https://www.javatpoint.com/dbms-interview-questions 8/15
26/01/2021 Top 52 DBMS Interview Questions - javatpoint
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.
For example: If a student is an entity in the table then age will be the attribute of that
student.
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.
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
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.
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.
Research Storage
https://www.javatpoint.com/dbms-interview-questions 9/15
26/01/2021 Top 52 DBMS Interview Questions - javatpoint
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.
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.
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.
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.
Theta join
Natural join
Equi join
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:
Create separate tables for each group of related data and identify each row with a
unique column
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.
3NF stands for Third Normal Form. A database is called in 3NF if it satisfies the following
conditions:
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
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.
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.
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.
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.
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.
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.
https://www.javatpoint.com/dbms-interview-questions 12/15
26/01/2021 Top 52 DBMS Interview Questions - javatpoint
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.
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
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.
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
https://www.javatpoint.com/dbms-interview-questions 15/15