DBMS Questions and Answers
DBMS Questions and Answers
Answers PDF
Here, we will be discussing the top basic DBMS interview questions and answers for
freshers that are commonly asked during the recruitment process.
It is a software system that allows users to manage, organize, and manipulate data in a
database. If you are not aware of what a database is, then understand that it is a collection
of data that is stored electronically, and a DBMS provides a way to interact with this data in a
structured and organized way.
Let’s Understand DBMS Definition With Real-life Example
Imagine you run a small retail store that sells various products, such as clothing,
accessories, and home goods. You want to keep track of your inventory, customer
information, sales data, and employee records.
Instead of using a bunch of different spreadsheets or paper records to manage all of this
information, you could use a database management system to store and organize everything
in one place.
With a DBMS, you could create a database that includes tables for each type of information
you need to track. This can include a table for inventory, a table for customer information, a
table for sales data, a table for employee records, and so on.
You can easily add new data to each table, update existing data, or delete data as needed.
You could also run queries to search for specific information or generate reports to analyze
data trends.
Overall, a DBMS would make it much easier for you to manage and use all of the data you
need to run your retail store effectively.
1. Business:
It is widely used by businesses to store and manage customer data, sales data, inventory
data, financial data, employee data, and much more.
2. Healthcare:
DBMS is used to manage patient data, including medical history, prescriptions, test results,
and other information.
3. Education:
Schools, colleges, and other educational organizations can implement DBMS to store
student information, such as attendance records, grades, and academic performance.
4. Government:
Governments use DBMS to store and manage data related to taxes, licenses, permits, and
other official records.
5. E-commerce:
Online retailers use DBMS to store and manage product catalogs, customer orders, and
payment information.
7. Telecommunication Industry:
Telecommunications companies use DBMS to store and manage customer account
information, call records, and network usage data.
Codd's paper "A Relational Model of Data for Large Shared Data Banks" described a new
approach to data management that emphasized the use of tables and relationships between
them, rather than hierarchical or network-based data models.
The first commercial relational DBMS was released by IBM in 1981, called SQL/DS. This
was followed by other popular relational DBMSs, including Oracle, Microsoft SQL Server,
and MySQL.
Increased productivity:
Database management system improves productivity by providing faster access to data,
minimizing manual data entry and reducing the likelihood of errors.
Better decision-making:
Moreover, it facilitates better decision-making by providing access to accurate, up-to-date,
and comprehensive data. This helps in making informed decisions based on data analysis.
Scalability:
DBMS can handle large amounts of data and can scale up or down depending on an
organization's needs, making it easy to manage growing amounts of data.
It is one of the top DBMS interview questions for placement, especially if you are a fresher.
Database DBMS
Can be a simple text file or a complex A software system with many features and
system of interconnected tables capabilities
Performance and scalability are limited Performance and scalability can be optimized
by the hardware and software used to using various techniques and features provided
manage the database by the DBMS
6. What are the 3 main types of databases?
There are several types of databases, but the three main types of databases are:
Relational databases
Relational databases are the most common type of databases. They store data in tables,
where each table represents a specific entity or object, and each row represents a record or
instance of that entity.
Relational databases use SQL (Structured Query Language) to manage and manipulate
data.
NoSQL databases
NoSQL databases are non-relational databases that store data in a variety of ways, such as
key-value pairs, documents, or graphs.
They are designed to handle large volumes of unstructured or semi-structured data and can
scale horizontally to handle increasing amounts of data.
Object-oriented databases
Object-oriented databases store data as objects, which are instances of classes that contain
both data and behavior.
Object-oriented databases are well-suited for complex data structures and applications that
require extensive data manipulation.
Each type of database has its own strengths and weaknesses and is suitable for different
types of applications. Choosing the right type of database depends on factors such as the
size and complexity of the data, the performance requirements of the application, and the
scalability needs of the system.
Data storage
The primary function of a DBMS is to store large amounts of data in an organized and
structured way.
A DBMS provides mechanisms to define the structure of data, including tables, fields, and
relationships between tables. It also manages the physical storage of data on disk or other
storage devices.
It also provides mechanisms to prevent data corruption, such as transaction processing and
data validation rules.
These functions are essential for managing large amounts of data efficiently and securely. A
DBMS provides a centralized and controlled environment for storing and managing data,
ensuring that it is available when needed and is accurate and consistent.
DBMS RDBMS
Does not support complex Supports complex queries and transactions using SQL
queries and transactions or other query languages
Does not provide support for Provides support for relationships between tables,
relationships between tables enabling the creation of complex data models
On the other hand, RDBMS manages data as tables or relations and stores data in a tabular
or two-dimensional form.
It enforces data integrity and consistency using various constraints, and supports complex
queries and transactions using SQL or other query languages. RDBMS also provides
support for relationships between tables, enabling the creation of complex data models.
For example, Oracle is an RDBMS that allows you to store data in tables, enforce data
constraints, and perform complex queries using SQL. IMS, on the other hand, is a DBMS
that stores data in hierarchical structures and does not enforce data constraints or provide
support for complex queries.
You must be well-prepared for this type of DBMS interview questions and answers to land
your dream job.
Data security:
Moreover, it provides better data security by allowing access to data only to authorized users
and by implementing various security mechanisms like encryption, access control, and
auditing.
Performance optimization:
There are also some mechanisms for optimizing the performance of data retrieval and
manipulation operations, such as indexing, query optimization, and caching.
T-SQL (Transact-SQL):
T-SQL is Microsoft's proprietary language for managing and manipulating data in SQL
Server databases. It is an extension of SQL that allows users to write procedural code to
manipulate data.
Instead, they use other languages, such as JavaScript or Python. Some popular NoSQL
databases include MongoDB and Cassandra.
PL/pgSQL:
PL/pgSQL is a procedural language used in PostgreSQL. It allows users to write stored
procedures, functions, and triggers to manipulate data.
Attributes in DBMS are used to define the structure of a database and to represent the
characteristics of the data that is stored in the database. Each attribute has a name and a
data type, which specifies the kind of data that can be stored in the attribute.
For example, an attribute called "customer_name" might have a data type of "string,"
indicating that it can store a sequence of characters.
12. What is the difference between DBMS and SQL?
DBMS and SQL are two different concepts, but they are often used together to manage and
modify databases.
DBMS SQL
Provides mechanisms for creating, storing, Provides a standard syntax for querying
modifying, and retrieving data and manipulating data in a database
Example of how DBMS and SQL work together for database management:
Let's say you have a database that stores customer information, and you want to retrieve a
list of customers who live in a particular city. To do this, you would use SQL to write a query
that retrieves the relevant data from the database.
This type of topics are asked among the top DBMS interview questions for freshers.
SELECT
Using it, the retrieval of data can be done among tables. It allows you to specify which
columns to retrieve and any filters or conditions to apply.
INSERT
It is used for adding new data to a table in a database. It requires specifying the name of the
table and the values to insert for each column.
UPDATE
It is used for modification to existing data in a table in a database. It requires specifying the
name of the table, the columns to update, and the new values.
DELETE
The DELETE command is used to remove data from a table in a database. It requires
specifying the name of the table and any conditions to apply.
CREATE
The CREATE command is used to create new tables, views, indexes, and other database
objects. It requires specifying the name of the object and the columns or other properties to
define.
These five basic SQL commands are the foundation of many more complex SQL statements
and are essential for managing data in a relational database.
The normalization process involves breaking down a database into smaller, more
manageable tables, and defining relationships between them. The goal is to eliminate
redundant data and ensure that each piece of information is stored in only one place in the
database.
There are several levels of normalization, known as normal forms, that a database can be
designed to meet. The most commonly used normal forms are the first normal form (1NF),
second normal form (2NF), and third normal form (3NF).
● First normal form (1NF): A table is in 1NF if it contains only atomic values (i.e., each
attribute contains only a single value).
● Second normal form (2NF): A table is in 2NF if it is in 1NF and each non-key
attribute is dependent on the entire primary key (i.e., there are no partial
dependencies).
● Third normal form (3NF): A table is in 3NF if it is in 2NF and there are no transitive
dependencies (i.e., each non-key attribute is dependent only on the primary key).
It is important for you to note that normalization is an important topic in the list of DBMS
interview questions and answers.
Hardware:
The physical devices that store and process the data, such as servers, storage devices, and
network equipment.
Software:
The software programs that enable users to create, modify, and query databases, such as
the DBMS software itself, database drivers, and programming languages.
Data:
The actual information stored in the database, such as customer records, product catalogs,
or financial transactions.
Procedures:
The rules and processes that govern how the data is managed and accessed, such as
backup and recovery procedures, security policies, and data access controls.
Database schema:
The blueprint or design of the database that defines the structure of the data, including
tables, relationships between tables, and constraints on the data.
Database engine:
The core component of the DBMS that manages the storage, retrieval, and manipulation of
data, including functions such as indexing, data caching, and transaction processing.
Users:
The people or applications that interact with the database, such as database administrators,
developers, and end-users.
Complexity:
DBMS can be complex and difficult to learn, particularly for those who are not familiar with
database concepts and programming. This can require additional training and expertise, as
well as potentially higher costs for hiring and retaining skilled personnel.
Cost:
DBMS can be expensive, especially for large-scale systems that require high-performance
hardware and software, as well as ongoing maintenance and support.
Security:
While DBMS can provide security features such as encryption, access controls, and backup
and recovery procedures, they are still vulnerable to data breaches and other security
threats. This can be particularly concerning for sensitive or confidential data.
Performance:
DBMS can be slower than traditional file-based systems, particularly for complex queries or
large volumes of data. This can impact the overall performance of applications that rely on
the database.
Maintenance:
It requires ongoing maintenance and support, including regular backups, updates, and
patches, which can be time-consuming and costly.
Here are the main differences between the two, presented in tabular comparison form:
Feature DBMS File System
Atomicity:
Its role is to make sure that a transaction is counted as a single, indivisible unit of work. This
means that either all the operations in the transaction will successfully complete or none of
them will. In case some part of the transaction fails, the complete transaction is rolled back
to its original state.
Consistency:
Consistency ensures that the data in a database remains consistent before and after a
transaction. This means that any change made to the database must not violate any integrity
constraints, such as referential integrity or unique key constraints.
Isolation:
Isolation ensures that transactions are executed independently of each other. This means
that multiple transactions can be executed concurrently without interfering with each other.
Each transaction should have its own space in memory, and the intermediate states of a
transaction should not be visible to other transactions.
Durability:
Durability ensures that once a transaction is committed, its effects are permanent and
survive any subsequent failures, such as power outages or system crashes.
This means that the changes made by a committed transaction are stored permanently in
the database and cannot be lost due to any failure.
Together, these four properties of ACID ensure that transactions in a DBMS are reliable,
consistent, and durable. These properties are critical for applications that require accurate
and reliable data storage, such as financial transactions or airline reservations systems.
This is one of the most important interview questions on DBMS for freshers.
When a checkpoint occurs, the DBMS writes all the modified data from the buffer cache to
the physical storage on disk, and updates the database's metadata to reflect the changes.
This process ensures that any data modifications made by transactions are written to the
physical storage, making them durable even in the event of a system crash or power failure.
Relation
A relation is a table with rows and columns that stores related data in a structured format.
Each row represents a record, and each column represents a field or attribute of that record.
The relation is also referred to as a "table" in some database systems.
Relation Schema
On the other hand, a relation schema is a blueprint or a description of a relation's structure. It
specifies the names of the columns, the data types of the columns, and any constraints that
must be followed when data is inserted into the relation.
In other words, the relation schema defines the structure of the relation, while the relation
itself is the actual instance of the relation schema with data populated in it.
To better understand the difference between relation and relation schema, consider an
analogy. Think of a relation as a physical table, while the relation schema is the blueprint or
design that specifies the table's size, shape, and properties.
The table is the actual instance of the design that is used to store objects, while the design
specifies how the table should be built and used.
DDL stands for Data Definition Language, which is used to define the structure of a
database schema.
DDL commands are used to create, modify, and delete database objects such as tables,
indexes, views, and stored procedures. Some common DDL commands include:
● CREATE
● ALTER
● DROP
● TRUNCATE
DML commands are used to add, modify, retrieve, and delete data from a database. Some
common DML commands include:
● SELECT
● INSERT
● UPDATE
● DELETE
When a query is executed in a database, the DBMS must determine the most efficient way
to execute the query, which involves selecting the appropriate indexes, algorithms, and
access methods to use to retrieve the requested data.
Query optimization process selects the best execution plan for a query, based on factors
such as the size of the data set, available system resources, and the complexity of the
query.
A well-optimized query can reduce the time and resources required to retrieve data, resulting
in faster query response times, improved system performance, and a better user experience.
To optimize queries, DBMS systems use a variety of techniques such as index selection, join
ordering, and cost-based optimization. The specific approach used by a DBMS depends on
its architecture, the type of data being stored, and the query patterns of the application.
It involves intentionally violating the normalization rules of a database schema to reduce the
number of tables and simplify the database structure, with the aim of improving query
performance.
Example
Consider a normalized database schema for an online bookstore, where customers, orders,
and books are stored in separate tables.
When a customer places an order, the order information is stored in the orders table and
linked to the customer and book records using foreign keys. To retrieve all the information
about a customer's order, multiple table joins are required.
However, by denormalizing the database and adding customer and book information to the
orders table, queries can be simplified, and the number of table joins required can be
reduced, resulting in faster query response times.
Well, we'll be exploring some of the most challenging and advanced DBMS interview
questions and answers for experienced.
Functional dependency:
This occurs when one attribute or set of attributes in a table determines the value of another
attribute.
For example, in a table of customer orders, the customer ID attribute may determine the
customer name attribute.
Transitive dependency:
This occurs when a functional dependency exists between three or more attributes, where
one attribute determines another attribute which, in turn, determines a third attribute.
For example, in a table of employee data, the employee ID attribute may determine the
department attribute, which in turn determines the manager attribute.
2. What are database constraints?
Database constraints in DBMS are rules that are used to limit the type of data that can be
inserted, updated, or deleted in a database. Constraints are used to ensure data integrity,
consistency, and accuracy within a database.
Unique constraint:
This ensures that a specific column or set of columns in a table contains unique values. The
unique constraint can be used to prevent duplicate data from being inserted into a table.
Check constraint:
This ensures that the data in a column meets a specific condition or set of conditions. The
check constraint can be used to enforce data accuracy and consistency.
Data mining techniques can be applied to a wide range of industries, including finance,
healthcare, retail, and e-commerce.
Example
A retailer may use data mining techniques to analyze customer purchase data to identify
products that are frequently purchased together. This information can be used to optimize
product placement and promotions, leading to increased sales and customer satisfaction.
● data preprocessing
● data cleaning
● data transformation
● data mining
● interpretation/evaluation of results
During data mining, various statistical and machine learning algorithms are applied to the
data to discover patterns and trends. The output of data mining can be presented in various
forms, such as graphs, charts, and reports.
Each technique is used to address a specific problem and extract insights from the data.
The primary difference between a data warehouse and a traditional database system is that
a data warehouse is optimized for reporting and analysis, whereas a traditional database
system is optimized for transactional processing.
A traditional database system is designed to efficiently store, retrieve, and modify data in
real-time as part of transactional processing. In contrast, a data warehouse is designed to
store and manage large volumes of historical data that can be used for analysis and
reporting.
In other words, a functional dependency X → Y means that for every value of X in a table,
there is a unique corresponding value of Y in that table.
For example, consider a table called "Employees" with the following attributes: EmployeeID,
Name, Address, and Phone. The functional dependencies in this table might be:
This means that each employee's ID uniquely determines their name, address, and phone
number, and each employee's name uniquely determines their address and phone number.
In other words, it is needed to manage concurrent access to the database and to prevent
unwanted interactions between transactions.
When multiple transactions are executed concurrently, there is a risk of data inconsistencies
or conflicts, such as lost updates, dirty reads, or inconsistent retrievals. Concurrency control
techniques are used to prevent or manage these issues, and to ensure that each transaction
has a consistent view of the database at all times.
This is one of the advanced DBMS interview questions for which you must be well-prepared.
The primary key serves as a reference point for other tables that may have a foreign key
relationship with the table containing the primary key. The values in the primary key
column(s) must be unique and cannot be null.
Hierarchical model:
In this model, data is organized in a tree-like structure, with each parent node having one or
more child nodes. It is a rigid and inflexible model that is best suited for storing data with a
strict, predictable structure.
Network model:
This model is an extension of the hierarchical model, where each node can have multiple
parent and child nodes. It is more flexible than the hierarchical model, but can still be difficult
to work with for complex data structures.
Relational model:
This is the most commonly used data model in modern DBMS. In this, data is organized in
tables, with each table representing a logical entity and each row representing a record.
Relationships between different tables are established through keys and constraints.
There are also other data models used in DBMS, such as object-oriented,
document-oriented, and graph-based models, which are used in specialized applications.
Relational algebra includes a set of basic operations, such as selection, projection, union,
intersection, and difference, as well as more complex operations, like join, division, and
aggregation. These operations can be combined to form more complex queries and
expressions.
The basic operations in relational algebra can be expressed in terms of set operations, such
as intersection, union, and difference, or in terms of predicates or logical conditions, such as
equality or inequality.
For example, the selection operation selects rows from a table that satisfy a given predicate
or condition, while the projection operation selects a subset of columns from a table.
Queries are one of the most important features of a DBMS, as they enable users to interact
with and retrieve information from the database.
It can take many forms, depending on the type and complexity of the information requested.
SELECT queries:
Their role is to retrieve specific data from one or more tables in a database. They can also
be used to aggregate data, sort results, and apply filters or conditions.
UPDATE queries:
Used to modify data in a table or set of tables. They can be used to add, update, or delete
data based on certain conditions.
INSERT queries:
The role of such queries is to add new data to a table or set of tables in a database.
DELETE queries:
Generally implemented to remove data from a table or set of tables in a database based on
certain conditions.
JOIN queries:
These are used to combine data from multiple tables based on a common field or key.
When data is inserted into a database, a hash function is used to generate a unique hash
value based on the data. This hash value is then used to index the data, making it faster to
search for and retrieve the data later on.
Example
Let's say you have a database of customers, and you want to quickly find the record for a
customer named John Smith. Instead of searching through the entire database for the
record, the hash value for John Smith's record can be calculated and used to directly access
the record.
Example
Consider a table of customers that includes attributes such as name, address, and phone
number. A super key for this table could be a combination of the name and address
attributes, since no two customers with the same name and address can exist in the table.
Another super key could be the phone number attribute, since each customer is likely to
have a unique phone number.
However, a super key may contain more attributes than are strictly necessary to uniquely
identify each record in the table.
For example, a customer table could have a super key that includes both the name and
address attributes, as well as the phone number attribute. This super key would still uniquely
identify each record in the table, but it would be more complex than a primary key that only
included the name and address attributes.
When preparing for interview questions and answers on DBMS, you simply can’t miss out on
topics like super key.
Physical level:
This is the lowest level of abstraction and deals with the physical storage of data on the
storage media. It is concerned with the representation of data on the storage media, such as
the way data is stored on a hard drive or solid-state drive.
It includes details such as data block size, data access methods, and disk space
management.
Logical level:
This level deals with the logical structure of the database, such as the tables, views, and
indexes.
It provides an abstraction of the physical storage layer and allows users to interact with the
database in a more user-friendly way. It is concerned with the organization of data and the
relationships between different data elements.
View level:
This is the highest level of abstraction and deals with the user's view of the data. It provides
a way for users to access and manipulate the data without needing to understand the
underlying physical or logical structures.
It provides a visual representation of the database and helps to design and maintain
complex databases.
In the ER model, data is represented using entities, which are objects or concepts with a
distinct identity, such as a customer, product, or order. Each entity has attributes that
describe its characteristics, such as the name, age, or address of a customer.
Entities in the ER model are connected by relationships, which describe how the entities
interact with each other. Relationships can be one-to-one, one-to-many, or many-to-many,
and they can have cardinality constraints that specify the minimum and maximum number of
entities that can be involved in the relationship.
Entity
It is a real-world object or concept that is represented as a table in a database. An entity can
be a physical object, such as a car or a person. Or, it can be an abstract concept, such as an
order or a transaction.
Entity Type
An entity type is a collection of similar entities.
For example, the entity type "customer" would include all the individual customers in a
database.
Each entity type has a set of attributes that describe its characteristics, such as the name,
age, or address of a customer.
Entity Set
An entity set is a collection of all the entities of a particular entity type in a database.
For example, the entity set "customer" would include all the individual customers in a
database.
An entity set can be thought of as a table in a database, where each row represents an
individual entity and each column represents an attribute of the entity.
19. What do you understand by a weak entity set?
It is an entity set that does not have a primary key attribute. This type of entity set depends
on another entity set, called a strong entity set, for its existence. A weak entity set has a
partial key, which is a set of attributes that identifies a particular weak entity within its strong
entity set.
Example:
Consider an entity set "order_item" that represents the items in an order. Each order item is
associated with an order, represented by the strong entity set "order". The order_item entity
set cannot exist without the order entity set, as each order item must be associated with an
order. In this case, "order" is the strong entity set, and "order_item" is the weak entity set.
In a DBMS, a weak entity set is identified using a double rectangle notation. The partial key
of the weak entity set is indicated using a dashed underline.
The relationship between the weak entity set and its strong entity set is represented using a
diamond-shaped symbol, with the line connecting the diamond to the weak entity set.
One-to-One (1:1)
In a one-to-one relationship, each row in one table corresponds to exactly one row in
another table, and vice versa.
This type of relationship is not commonly used in practice, but it can be useful for breaking
down a large table into smaller, more manageable tables.
One-to-Many (1:N)
In a one-to-many relationship, each row in one table can correspond to one or more rows in
another table, but each row in the second table corresponds to only one row in the first table.
For example, in a customer and orders database, one customer can have many orders, but
each order is associated with only one customer.
Many-to-Many (N:M)
In a many-to-many relationship, each row in one table can correspond to one or more rows
in another table, and vice versa.
For example, in a database for a library, many books can be borrowed by many users,
creating a many-to-many relationship between the users and books tables. To represent
such a relationship, a junction table or a linking table is used, which includes foreign keys to
both tables.
It is one of the most asked database management system interview questions nowadays.
Intension:
The intension of a database is the logical or conceptual schema that defines the structure of
the database. It specifies the data types, relationships, constraints, and other properties of
the data that the database will store.
The intension provides a high-level view of the database that is independent of any specific
instance of the data. In other words, it defines what the data should look like and how it
should be organized.
Extension:
The extension of a database is the set of all actual instances of the data stored in the
database. It consists of the specific data values that are stored in the database at any given
time. The extension represents the actual data that is being used or processed by the
system.
The intension of the database would specify the structure of the database, such as the
tables for students, courses, and enrollment, and the relationships between them.
Whereas, the extension would consist of the actual data values stored in the database, such
as the names and grades of students, course descriptions and schedules, and enrollment
records.
DELETE Command:
It is used to remove one or more rows from a table. It is a Data Manipulation Language
(DML) command that can be used with or without a WHERE clause to specify which rows to
delete.
When a DELETE statement is executed, the rows are deleted one at a time, and the space
occupied by the deleted rows is released back to the system for reuse. This command can
be rolled back, meaning that it can be undone if necessary.
TRUNCATE Command:
It is used to remove all rows from a table. It is a Data Definition Language (DDL) command
that removes all the data in a table, but not the structure of the table itself.
When a TRUNCATE statement is executed, the data is removed in a single operation, and
the space occupied by the data is released back to the system for reuse.
The TRUNCATE command cannot be rolled back, meaning that it cannot be undone once it
has been executed.
DELETE TRUNCATE
Command
Data Manipulation Language (DML) Data Definition Language (DDL)
Type
Table Only removes data rows, not table Only removes data, not the table
Structure structure structure
Primary Key:
A primary key is a unique identifier for a row or record in a table. It is a column or a
combination of columns that uniquely identifies each row in a table.
Primary keys must be unique and cannot contain null values. A table can have only one
primary key, and it is used to enforce referential integrity in relationships between tables.
Foreign Key:
A foreign key is a column or a combination of columns in one table that refers to the primary
key of another table.
It is used to enforce referential integrity between two tables and to establish a relationship
between them. A foreign key can have null values, and a table can have multiple foreign
keys.
Candidate Key:
A candidate key is a column or a combination of columns that can be used as a primary key
for a table.
It is a unique identifier for a row or record in a table and can be used as an alternative to the
primary key. A table can have multiple candidate keys, but only one primary key.
Alternate Key:
An alternate key is a candidate key that is not selected as the primary key.
It is a unique identifier for a row or record in a table, but it is not used as the primary key. An
alternate key can be used to enforce unique constraints in a table.
It is one of the important DBMS interview questions for lecturers and assistant professors as
well.
It is among the most asked DBMS interview questions for experienced professionals.
It requires that a foreign key value in a table must match a primary key value in another
table, or it must be null. This rule ensures that any changes made to a primary key value in
one table are reflected in the related foreign key values in other tables.
These rules can be defined as triggers, stored procedures, or functions that are executed
when specific conditions are met.
Physical Level:
The physical level is the lowest level of data abstraction, which describes how data is
actually stored on the physical storage devices such as hard disks, tapes, and memory.
This level deals with the details of how data is stored, organized, and accessed on the
physical storage media.
Logical Level:
The logical level is the next level of data abstraction, which describes the logical structure of
data in a database.
It deals with the way data is viewed by users and applications. The logical level hides the
physical storage details and provides a conceptual view of the data, including the
relationships between data elements, tables, and their attributes.
View Level:
The view level is the highest level of data abstraction, which describes how data is
presented to users and applications.
This level deals with the way data is viewed and accessed by users and applications. Views
provide a customized and simplified view of the data according to the specific needs of
different users and applications.
As a result, none of the transactions can proceed, and the system becomes stuck or
deadlocked.
When a deadlock occurs, the only way to resolve it is to terminate one or more of the
transactions involved, which can result in loss of data and system downtime.
For example, DBMS may use lock-based concurrency control to ensure that transactions do
not interfere with each other and deadlock does not occur. In addition, DBMS may use
timeout mechanisms to detect and resolve deadlocks automatically by terminating one or
more of the transactions involved.
It is essential to design the database and the application carefully to prevent deadlocks. This
can include optimizing queries to minimize locking and reducing the time that transactions
hold locks on resources.
Additionally, database administrators should monitor the system for deadlocks and take
steps to prevent them from occurring, such as adjusting the concurrency control settings or
modifying the database schema to reduce contention for resources.
So, while preparing for interview questions on database management system, make sure to
know the answer to such tough and tricky topics.
Data
Data is the basic building block of a database. It refers to the facts and figures that are
stored in the database.
Database
It is a collection of related data that is stored in an organized and structured way. It is
designed to store, organize, and manage large amounts of data.
Tables
It is a basic structure in which data is stored in a database. It consists of rows and columns,
where each row represents a record and each column represents a field or attribute.
Records
It is a set of related fields or attributes that describe a single instance of an entity or object. It
represents a single row in a table.
Fields
It is a single piece of information that is stored in a database. It represents a single column in
a table.
Primary key
It is a unique identifier that is used to identify each record in a table. It is used to ensure that
each record in the table is unique and can be easily accessed.
Foreign key
It is a key that is used to link two or more tables in a database. It is used to establish
relationships between tables.
Queries
A query is a request for data from a database. It is used to retrieve, update, or delete data
from tables.
Indexes
It is a data structure that is used to accelerate the retrieval of data from a database. It is
used to organize data in a specific order to optimize the performance of queries.
Transaction
It is a sequence of database operations that are treated as a single unit of work.
Transactions are used to ensure the integrity and consistency of data in a database.
These are some of the basic concepts of DBMS. Understanding these concepts is essential
along with preparing for the DBMS important questions and answers, as discussed above.
Infosys
● What is a database, and what are the advantages of using a database management
system?
● What are the different types of normalization, and how is each achieved?
● What is the difference between a primary key and a unique key?
● What is the difference between a clustered and non-clustered index, and when would
you use each?
● What is a stored procedure, and how is it used in a database?
● What is a transaction, and what are the properties of a transaction?
● What is a deadlock, and how can it be prevented?
● What is a view, and how is it used in a database?
● What is the difference between a left outer join and a right outer join?
● What is the difference between a schema and a database?
Cognizant
Accenture
● What is a database, and what are the advantages of using a database management
system?
● What is normalization, and how is it achieved in a database?
● What is the difference between a primary key and a unique key?
● What is a clustered index, and how is it used in a database?
● What is a stored procedure, and how is it used in a database?
● What is the difference between a left outer join and a right outer join?
● What is a transaction, and what are the properties of a transaction?
● What is a view, and how is it used in a database?
● What is the difference between a schema and a database?
● What is a trigger, and how is it used in a database?
IBM
● What is a database, and what are the advantages of using a database management
system?
● What is normalization, and how is it achieved in a database?
● What is the difference between a primary key and a foreign key?
● What is the purpose of an index in a database, and what are the different types of
indexes?
● What is a stored procedure, and how is it used in a database?
● What is a trigger, and how is it used in a database?
● What is the difference between a clustered and non-clustered index, and when would
you use each?
● What is a view, and how is it used in a database?
● What is a transaction, and what are the properties of a transaction?
● What is the difference between a schema and a database?
Deloitte
● What is a database, and what are the advantages of using a database management
system?
● What is normalization, and how is it achieved in a database?
● What is the difference between a primary key and a foreign key?
● What is an index in a database, and why is it used?
● What is a trigger, and how is it used in a database?
● What is the difference between a clustered and non-clustered index, and when would
you use each?
● What is a view, and how is it used in a database?
● What is a transaction, and what are the properties of a transaction?
● What is the difference between a schema and a database?
● What is a stored procedure, and how is it used in a database?
Amazon
Amazon DBMS interview questions include:
● What is a database, and what are the advantages of using a database management
system?
● What is normalization, and how is it achieved in a database?
● What is the difference between a primary key and a foreign key?
● What is an index in a database, and why is it used?
● What is a trigger, and how is it used in a database?
● What is the difference between a clustered and non-clustered index, and when would
you use each?
● What is a view, and how is it used in a database?
● What is a transaction, and what are the properties of a transaction?
● What is the difference between a schema and a database?
● What is a stored procedure, and how is it used in a database?
● What is ACID, and how is it important in a database system?
● What is NoSQL, and when would you use it over a traditional relational database?
HCL
● What is a database, and what are the advantages of using a database management
system?
● What is normalization, and how is it achieved in a database?
● What is the difference between a primary key and a foreign key?
● What is an index in a database, and why is it used?
● What is a trigger, and how is it used in a database?
● What is the difference between a clustered and non-clustered index, and when would
you use each?
● What is a view, and how is it used in a database?
● What is a transaction, and what are the properties of a transaction?
● What is the difference between a schema and a database?
● What is a stored procedure, and how is it used in a database?
● What is database replication, and how is it used in a distributed database
environment?
● What is the difference between a OLTP and OLAP database, and when would you
use each?
Wipro
● What is a database, and what are the advantages of using a database management
system?
● What is normalization, and how is it achieved in a database?
● What is the difference between a primary key and a foreign key?
● What is an index in a database, and why is it used?
● What is a trigger, and how is it used in a database?
● What is the difference between a clustered and non-clustered index, and when would
you use each?
● What is a view, and how is it used in a database?
● What is a transaction, and what are the properties of a transaction?
● What is the difference between a schema and a database?
● What is a stored procedure, and how is it used in a database?
● What is the difference between a database backup and a database restore?
● What is data mining, and how is it used in a database environment?
Note:
Please note that these questions are not exhaustive, and the interviewer may ask additional
questions based on your responses. You should also be prepared to discuss your previous
experience with DBMS and provide examples of projects you have worked on, particularly
those that involved large-scale databases or data analytics.
1. What is a DBMS?
a) A program that creates and maintains a database
b) A program that creates and manages tables in a database
c) A program that allows users to access and manipulate data in a database
d) None of the above
Answer: a)
Answer: b)
Answer: a)
Answer: a)
Answer: a)
Answer: c)
7. The difference between a view and a table is:
a) There is no difference
b) A table stores data, while a view is a virtual table that displays data from one or more
tables
c) A view stores data, while a table is a virtual table that displays data from one or more
views
d) None of the above
Answer: b)
Answer: a)
Answer: a)
Answer: b)
Answer: c)
Answer: a)
Stay up-to-date
Keep up-to-date with the latest trends and developments in the DBMS field by reading
industry publications, attending conferences, and following blogs and social media accounts
of DBMS experts.
Be confident
Remember to approach the interview with confidence, and be ready to discuss your
experience and skills in a clear and concise manner. Emphasize your ability to work
collaboratively with others and your problem-solving skills.
However, here are some of the most common and important DBMS topics that interviewers
may focus on:
Having a good understanding of these topics can demonstrate your knowledge and
experience in the field of DBMS, and increase your chances of getting hired for a position
that requires working with databases.
Be prepared to discuss your experience and skills in each of these areas, and provide
specific examples of how you have applied them in previous projects or work experiences.
Who is DBA (Database Administrator)?
A DBA (Database Administrator) is a professional responsible for the design,
implementation, and maintenance of databases in an organization. The DBA's main role is to
ensure the efficient and reliable operation of a company's database systems.
● Designing and implementing databases that meet the organization's needs and
requirements.
● Setting up and configuring database systems and software.
● Ensuring the security and integrity of the database by implementing access controls
and backup and recovery strategies.
● Monitoring database performance and optimizing database performance by
implementing indexing and query optimization techniques.
● Troubleshooting and resolving database issues.
● Upgrading and patching database software to ensure that it is up-to-date and secure.
● Developing and implementing policies and procedures for database use and
management.
● Working closely with developers, system administrators, and other IT staff to ensure
that the database is integrated with other systems and applications.
According to Glassdoor, the average salary for a Database Administrator in India is around
INR 7.1 Lakh per year.
However, some DBMS are generally considered to be easier to learn than others, including:
MySQL
MySQL is a popular open-source DBMS that is widely used in web development. It is known
for its ease of use and simplicity, and it has a large and active community that provides
support and resources for learning.
SQLite
SQLite is a lightweight, file-based DBMS that is often used for mobile and embedded
applications. It is easy to set up and use, and it requires minimal configuration or
administration.
Microsoft Access
Microsoft Access is a desktop-based DBMS that is part of the Microsoft Office suite. It is
easy to use and provides a graphical user interface for designing and managing databases.
PostgreSQL
PostgreSQL is a powerful open-source DBMS that is known for its reliability and scalability.
Although it is more complex than some other DBMS, it has a strong community and provides
extensive documentation and resources for learning.