Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
78 views6 pages

DBMS Interview

Uploaded by

cvekariya16
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
78 views6 pages

DBMS Interview

Uploaded by

cvekariya16
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

DBMS Interview

Q-1 What is DBMS?


A Database Management System (DBMS) is a software system that is designed to manage and organize data
in a structured manner. It allows users to create, modify, and query a database, as well as manage the
security and access controls for that database.

Q-2 What are the different types of DBMS?


The seven types of DBMS are Relational DBMS (RDBMS), Hierarchical DBMS, Network DBMS, Object-
Oriented DBMS (OODBMS), NoSQL DBMS, Columnar DBMS, and In-Memory DBMS.

Q-3 What are the issues of traditional file-based systems that make DBMS a superior
alternative?
A file system does not have a crash recovery mechanism, but a DBMS does.

File systems do not support complex transactions, but DBMS systems can quickly implement complex
transactions using SQL.

A DBMS provides concurrency, but a file system does not.

Data inconsistency is high in file systems. In contrast, data inconsistencies in database management systems
are rare.

Q-4 What is a transaction in DBMS?


A transaction is a group of SQL operations that are executed as a single unit. It must follow ACID properties.
A user can make different types of requests to access and modify the contents of a database. Ex – Read,
Write

Q-5 What are ACID properties?


The ACID properties in DBMS are fundamental principles that ensure data integrity. They are as follows:

Atomicity - It guarantees that a transaction is treated as a single unit of execution, either completing entirely
or not at all.

Consistency - This property ensures that the database remains in a consistent state before and after each
transaction.

Isolation - It allows multiple transactions to occur concurrently without interfering with each other.

Durability - Once a transaction is committed, its changes are permanently saved in non-volatile memory.
Q-6 What is 2-Tier and 3-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.

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.

Q-7 What is data abstraction in DBMS?


Data abstraction in DBMS means hiding unnecessary background details from the end user to make the
accessing of data easy and secure.

In DBMS, there are 3 levels of data abstraction

The physical or internal layer is the lowest level of data abstraction in the database management system. It is
the layer that defines how data is actually stored in the database.

The logical or conceptual level is the intermediate or next level of data abstraction. It explains what data is
going to be stored in the database and what the relationship is between them.

View or External Level is the highest level of data abstraction. There are different views at this level that
define the parts of the overall data of the database.

Q-8 What is normalization?


Normalization is used to minimize the redundancy from a relation or set of relations. It is also used to
eliminate undesirable characteristics like Insertion, Update, and Deletion Anomalies.

Normalization divides the larger table into smaller and links them using relationships.

Q-9 What is 1NF?


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

Q-10 What is 2NF?


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

Q-11 What is 3NF?


It is in second normal form.

There is no transitive functional dependency.

 Ex:
X->Y
Y does not -> X
Y->Z so, X->Z

Q-12 Wha
t is BCNF?
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.

Q-13 What is Denormalization?


Denormalization is a database optimization technique in which we add redundant data to one or more
tables. This can help us avoid costly joins in a relational database.

Denormalization is often used in large data warehouses where query performance is critical.

Q-14 What do you understand by Data Model?


A data model is a visual representation of an organization's data, including the structure, attributes, and
relationships of the data.

Data Models provide us with a transparent picture of data which helps us in creating an actual database.

One such popular model is the entity/relationship model (ER model).

LINK - https://www.geeksforgeeks.org/introduction-of-er-model/

Q-15 What are views in SQL?


Views in SQL are a kind of virtual table. A view also has rows and columns like tables, but a view doesn’t
store data on the disk like a table.

View defines a customized query that retrieves data from one or more tables

Q-16 What are materialized views?


Materialized views store the results of a query physically on disk, unlike regular views that generate results
dynamically.

A materialized view is a duplicate data table created by combining data from multiple existing tables for
faster data retrieval.

Q-17 Difference Between Snapshot and Materialized View


A database snapshot is a copy of a database at a specific point in time that can be used for backup, recovery,
or data management

Materialized view is Dynamic. It Contain Latest updation data also based upon the refreshment option we
specify.

Q-18 What is an indexing in DBMS?


Indexing is a technique for improving database performance by reducing the number of disk accesses
necessary when a query is run.

Two types of indexes: Clustered and Non-clustered indexes.

Q-19 Explain the difference between clustered and non-clustered indexes.

No Clustered Non-clustered

1 A clustered index is used to define the order or to A non-clustered index collects the data at one place
sort the table or arrange the data by alphabetical and records at another place.
order just like a dictionary.

2 It is faster than a non-clustered index. It is slower than the clustered index.

3 It demands less memory to execute the operation. It demands more memory to execute the operations.

4 It permits you to save data sheets in the leaf nodes It never saves data sheets in the leaf nodes of the
of the index. index.
5 A single table can consist of a sole cluster index. It can consist of multiple non-clustered indexes.

6 It has the natural ability to store data on the disk. It does not have the natural strength to store data on
the disk.

Q-20 Explain database partitioning.


database partitioning is a technique that involves splitting a database's data into separate, manageable
pieces called partitions. These partitions can be stored, accessed, and managed independently.

Data partitioning can improve a DBMS performance, scalability, and availability. It can also reduce the cost of
storing large amounts of data.

Vertical partitioning and horizontal partitioning are two techniques

Q-21 Difference between Vertical and Horizontal Partitioning


Involves dividing a table based on columns. It is useful when you have tables with many columns, and not all
columns are frequently accessed together. This can improve query performance by reducing I/O and
allowing for more efficient indexing of relevant columns.

Involves dividing a table based on rows, often using a range or a condition. It is useful when dealing with
tables containing a large number of rows, and data can be logically grouped based on certain criteria. This
can improve query performance by minimizing the amount of data that needs to be scanned for specific
queries and allows for easier data management.

Q-22 What is Database Sharding? How is differ from partitioning.


Database sharding is a technique that splits a large database into smaller, more manageable components
called shards, and stores them across multiple database servers

The main difference between sharding and partitioning is their approach to data distribution. Sharding
disperses data across various databases or servers, while partitioning segregates data within a single
database instance into subsets.

Q-23 Difference between Serial Schedule and Serializable Schedule

Serial Schedule Serializable Schedule

In Serial schedule, transactions will be executed In Serializable schedule transaction are executed
one after other. concurrently.

Serial schedule are less efficient. Serializable schedule are more efficient.
Serial Schedule Serializable Schedule

In serial schedule only one transaction executed In Serializable schedule multiple transactions can
at a time. be executed at a time.

Serial schedule takes more time for execution. In Serializable schedule execution is fast.

Q- 24 How do you handle concurrency control in a DBMS?


Concurrency control ensures that multiple transactions can run at the same time without leading to data
inconsistency.

(Concurrency Control Problems) There are several problems that arise when numerous transactions are
executed simultaneously in a random manner. LIKE - Dirty Read Problem(Write-Read conflict), Lost Update
Problem

(Concurrency Control Protocols) Concurrency control protocols are the set of rules which are maintained in
order to solve the concurrency control problems in the database. LIKE - Locked based concurrency control
protocol, Timestamp based concurrency control protocol

Q-25 What is shared lock vs exclusive lock?


shared lock - Allow multiple transactions to read data simultaneously, but prevent any transaction from
modifying it. Shared locks are used for reading

exclusive lock - Allow only one transaction to modify data, preventing other transactions from reading or
modifying it. Exclusive locks protect updates to file resources.

Q-26 What are deadlocks?


Deadlocks occur when two or more transactions are waiting for each other to release locks, causing them to
be stuck forever.

Q-27 Difference between DBMS AND RDBMS?

You might also like