0% found this document useful (0 votes)
70 views18 pages

$RZAT2JZ

The document is a comprehensive guide on Database Management Systems (DBMS), covering fundamental concepts such as types of DBMS, architecture, relational models, SQL basics, normalization, transactions, indexes, and advanced DBMS concepts. It includes definitions, differences, and explanations of key terms and processes related to database design, backup and recovery, concurrency control, and normalization. The content serves as a resource for understanding DBMS principles and practices, suitable for both beginners and advanced learners.

Uploaded by

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

$RZAT2JZ

The document is a comprehensive guide on Database Management Systems (DBMS), covering fundamental concepts such as types of DBMS, architecture, relational models, SQL basics, normalization, transactions, indexes, and advanced DBMS concepts. It includes definitions, differences, and explanations of key terms and processes related to database design, backup and recovery, concurrency control, and normalization. The content serves as a resource for understanding DBMS principles and practices, suitable for both beginners and advanced learners.

Uploaded by

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

DBMS Viva Questions

Introduction to DBMS:

1. What is DBMS?
○ DBMS (Database Management System) is software that manages databases
and provides an interface to interact with data.
2. What are the types of DBMS?
○ The four types are:
■ Hierarchical DBMS
■ Network DBMS
■ Relational DBMS
■ Object-oriented DBMS
3. What is a database?
○ A database is a collection of organized data that can be easily accessed,
managed, and updated.
4. What is the difference between DBMS and RDBMS?
○ DBMS (Database Management System) manages data in a non-relational
format, while RDBMS (Relational DBMS) uses tables and supports relationships
between data.
5. What is an entity in DBMS?
○ An entity is a real-world object or concept that is represented in the database,
such as a student, employee, or product.

DBMS Architecture:

6. What are the three levels of DBMS architecture?


○ The three levels are:
■ External level (User view)
■ Logical level (Conceptual view)
■ Internal level (Physical view)
7. What is the purpose of the DBMS architecture?
○ DBMS architecture separates user views, logical data representation, and
physical storage, ensuring data independence.
8. What is data independence?
○ Data independence is the ability to change the schema at one level without
affecting the schema at the next higher level.
9. What is a schema in DBMS?
○ A schema is the logical structure of the database, describing the relationships
between different data elements.
10. What is the difference between logical and physical schema?
● Logical schema defines the structure of the data without concern for how it is stored,
while physical schema defines how data is stored in the system.

Relational Model:

11. What is the relational model in DBMS?


● The relational model uses tables (relations) to represent data and their relationships,
where each table consists of rows (tuples) and columns (attributes).
12. What is a relation?
● A relation is a table in the relational model, consisting of rows and columns.
13. What is a tuple?
● A tuple is a single row in a table that contains data for each attribute of the relation.
14. What is an attribute?
● An attribute is a column in a table, representing a property or characteristic of the entity.
15. What is a primary key?
● A primary key is a unique identifier for each record in a table, ensuring that no two rows
have the same value for this key.

SQL Basics:

16. What is SQL?


● SQL (Structured Query Language) is a standard programming language used to
manage and manipulate relational databases.
17. What are the types of SQL commands?
● SQL commands are divided into five categories:
○ Data Definition Language (DDL)
○ Data Manipulation Language (DML)
○ Data Query Language (DQL)
○ Data Control Language (DCL)
○ Transaction Control Language (TCL)
18. What is a SELECT statement?
● The SELECT statement is used to query the database and retrieve data from one or
more tables.
19. What is the difference between DELETE and TRUNCATE in SQL?
● DELETE removes rows from a table based on a condition, whereas TRUNCATE
removes all rows from a table without conditions.
20. What is the purpose of the WHERE clause in SQL?
● The WHERE clause filters records based on specific conditions.
Normalization & Relationships:

21. What is normalization in DBMS?


● Normalization is the process of organizing data in a database to reduce redundancy and
dependency.
22. What are the different normal forms?
● The normal forms are:
○ 1NF (First Normal Form)
○ 2NF (Second Normal Form)
○ 3NF (Third Normal Form)
○ BCNF (Boyce-Codd Normal Form)
○ 4NF (Fourth Normal Form)
○ 5NF (Fifth Normal Form)
23. What is a foreign key?
● A foreign key is a column in one table that refers to the primary key of another table,
establishing a relationship between the two tables.
24. What is a one-to-many relationship?
● A one-to-many relationship occurs when a record in one table is related to multiple
records in another table.
25. What is a many-to-many relationship?
● A many-to-many relationship occurs when multiple records in one table are related to
multiple records in another table.

Transactions:

26. What is a transaction in DBMS?


● A transaction is a sequence of one or more SQL operations executed as a single unit of
work, ensuring data integrity.
27. What are ACID properties?
● ACID stands for:
○ Atomicity: All operations in a transaction are either completed or none are.
○ Consistency: The database remains in a valid state before and after the
transaction.
○ Isolation: Transactions are executed independently of each other.
○ Durability: Once a transaction is committed, it cannot be undone.
28. What is a commit in DBMS?
● A commit is the operation that finalizes a transaction, making the changes permanent.
29. What is a rollback in DBMS?
● A rollback is used to undo the changes made by a transaction if an error occurs or a
transaction is aborted.
30. What is concurrency control?
● Concurrency control ensures that multiple transactions are executed in such a way that
the integrity of the database is maintained.

Indexes:

31. What is an index in DBMS?


● An index is a data structure used to speed up the retrieval of records from a table, similar
to an index in a book.
32. What are the types of indexes in DBMS?
● Types include:
○ Single-level index
○ Multi-level index
○ Clustered index
○ Non-clustered index
33. What is a clustered index?
● A clustered index determines the physical order of data rows in a table, and a table can
have only one clustered index.
34. What is a non-clustered index?
● A non-clustered index is a separate structure from the table, where the data is not stored
in a particular order, and a table can have multiple non-clustered indexes.
35. What is the difference between a primary key and a unique key?
● Both primary and unique keys enforce uniqueness, but a primary key does not allow
NULL values, whereas a unique key allows NULLs.

Advanced DBMS Concepts:

36. What is a view in DBMS?


● A view is a virtual table based on the result of a SELECT query, which can combine data
from one or more tables.
37. What is a stored procedure?
● A stored procedure is a precompiled set of one or more SQL statements stored in the
database that can be executed as needed.
38. What is a trigger in DBMS?
● A trigger is a set of SQL statements that automatically execute in response to certain
events on a particular table or view.
39. What is a cursor in DBMS?
● A cursor is a database object used to retrieve, manipulate, and navigate through a result
set row by row.
40. What is a transaction log?
● A transaction log records all changes made to the database, ensuring data recovery in
case of failure.
Database Design:

41. What is Entity-Relationship (ER) modeling?


● ER modeling is a conceptual framework used to visually describe the structure and
relationships of data within a database.
42. What are the components of an ER diagram?
● The components are entities, attributes, and relationships.
43. What is a composite key?
● A composite key is a combination of two or more columns in a table used to uniquely
identify a record.
44. What is a candidate key?
● A candidate key is a column or a combination of columns that could be used as the
primary key for a table.
45. What is the difference between a superkey and a candidate key?
● A superkey is any set of columns that can uniquely identify a row in a table, while a
candidate key is a minimal superkey with no redundant columns.

Backup and Recovery:

46. What is database backup?


● Database backup is the process of creating a copy of the database to restore it in case
of data loss or corruption.
47. What are the types of database backups?
● Types include:
○ Full backup
○ Incremental backup
○ Differential backup
48. What is the difference between a full and incremental backup?
● A full backup includes all data, while an incremental backup includes only the data
changed since the last backup.
49. What is database recovery?
● Database recovery is the process of restoring a database to its previous state after a
failure or corruption.
50. What is a point-in-time recovery?
● Point-in-time recovery restores a database to a specific moment, usually using
transaction logs to roll back to a particular transaction.

Advanced DBMS Concepts:

51. What is referential integrity?


● Referential integrity ensures that foreign keys in a table correspond to valid primary keys
in another table.
52. What is the difference between a union and a join?
● A union combines results from two or more SELECT statements into a single result set,
while a join combines columns from two tables based on a related column.
53. What are the different types of joins in DBMS?
● Types of joins:
○ INNER JOIN
○ LEFT JOIN (or LEFT OUTER JOIN)
○ RIGHT JOIN (or RIGHT OUTER JOIN)
○ FULL JOIN (or FULL OUTER JOIN)
○ CROSS JOIN
54. What is a deadlock in DBMS?
● A deadlock occurs when two or more transactions are waiting for each other to release
resources, causing a standstill.
55. How can deadlocks be avoided in DBMS?
● Deadlocks can be avoided by using techniques such as timeout, resource ordering, or
using a deadlock detection algorithm.
56. What is a database trigger?
● A trigger is a set of SQL statements that automatically execute in response to certain
events like INSERT, UPDATE, or DELETE on a table or view.
57. What is a stored procedure?
● A stored procedure is a set of SQL commands stored in the database that can be
executed multiple times without re-writing the SQL.
58. What is a function in DBMS?
● A function is similar to a stored procedure but typically returns a single value and can be
used in SQL expressions.
59. What is the difference between a procedure and a function?
● A procedure may or may not return a value, while a function always returns a value.
60. What is a cursor in DBMS?
● A cursor is a database object used to retrieve, manipulate, and navigate through a result
set row by row.

Transaction Management:

61. What is a transaction log?


● A transaction log records all changes made to the database, ensuring the ability to roll
back or recover after a failure.
62. What is the difference between a rollback and a commit?
● A rollback undoes changes made by a transaction, while a commit makes the changes
permanent in the database.
63. What is the significance of the ACID properties?
● ACID properties ensure reliable processing of transactions in a database, maintaining
data integrity and consistency.
64. What is isolation in DBMS?
● Isolation ensures that the operations of one transaction do not interfere with another
transaction.
65. What is atomicity in DBMS?
● Atomicity means that a transaction is either fully completed or fully aborted, ensuring no
partial transactions.
66. What is consistency in DBMS?
● Consistency ensures that a transaction brings the database from one valid state to
another.
67. What is durability in DBMS?
● Durability ensures that once a transaction is committed, the changes are permanent,
even in case of a system crash.
68. What is a transaction manager?
● A transaction manager is a software component responsible for managing the
transactions, ensuring ACID properties.
69. What is a two-phase commit protocol?
● Two-phase commit ensures that all database nodes involved in a transaction either
commit or abort, ensuring consistency in a distributed system.
70. What is a distributed transaction?
● A distributed transaction involves multiple databases or servers, and each transaction's
integrity must be maintained across all involved systems.

Backup and Recovery:

71. What are the types of database backups?


● Types of backups include:
○ Full backup
○ Incremental backup
○ Differential backup
72. What is the difference between incremental and differential backup?
● Incremental backup saves only the changes since the last backup, while differential
backup saves the changes since the last full backup.
73. What is point-in-time recovery?
● Point-in-time recovery restores the database to a specific moment in time, typically by
using transaction logs.
74. What is a hot backup?
● A hot backup occurs while the database is running, ensuring minimal downtime for the
system.
75. What is a cold backup?
● A cold backup is performed while the database is offline, ensuring that no changes occur
during the backup process.
76. What is a backup strategy?
● A backup strategy involves planning the types, frequency, and methods of backups to
ensure data integrity and recovery.
77. What is a restore in DBMS?
● A restore is the process of recovering data from a backup and restoring it to the
database.
78. What is a backup set?
● A backup set is a collection of backup files created together during a backup operation.
79. What is a differential backup?
● A differential backup contains only the changes made since the last full backup, offering
a balance between full and incremental backups.
80. What is a log-based backup?
● Log-based backup uses transaction logs to restore the database to a specific point in
time, ensuring consistency after a failure.

Concurrency Control:

81. What is concurrency control in DBMS?


● Concurrency control ensures that multiple transactions can execute concurrently without
conflicting and causing data integrity issues.
82. What is a locking mechanism?
● Locking is a technique used in concurrency control to prevent other transactions from
accessing data that is currently being modified by another transaction.
83. What is a deadlock in database systems?
● A deadlock occurs when two or more transactions are waiting for each other to release
resources, causing a system freeze.
84. How can deadlocks be prevented?
● Deadlocks can be prevented by using techniques such as resource ordering, timeout,
and deadlock detection algorithms.
85. What are the different types of locks in DBMS?
● Types of locks:
○ Shared Lock (S Lock)
○ Exclusive Lock (X Lock)
○ Intent Lock (IS, IX)
86. What is a two-phase locking protocol?
● A two-phase locking protocol ensures that transactions acquire all locks before releasing
any, preventing deadlocks and ensuring serializability.
87. What is the difference between pessimistic and optimistic concurrency control?
● Pessimistic concurrency control locks resources to prevent conflicts, while optimistic
concurrency control allows conflicts and resolves them when they occur.
88. What is a serializable schedule?
● A serializable schedule ensures that the result of executing transactions concurrently is
equivalent to some serial execution of those transactions.
89. What is a phantom read?
● A phantom read occurs when a transaction reads a set of rows that match a condition,
but another transaction inserts or deletes rows that match that condition.
90. What is a strict two-phase locking protocol?
● A strict two-phase locking protocol requires transactions to hold all locks until they
commit or abort, ensuring serializability and preventing cascading aborts.

Normalization and Denormalization:

91. What is normalization in DBMS?


● Normalization is the process of organizing data to reduce redundancy and dependency
by dividing a large table into smaller, manageable tables.
92. What are the different types of normal forms?
● The normal forms are:
○ 1NF (First Normal Form)
○ 2NF (Second Normal Form)
○ 3NF (Third Normal Form)
○ BCNF (Boyce-Codd Normal Form)
○ 4NF (Fourth Normal Form)
○ 5NF (Fifth Normal Form)
93. What is denormalization?
● Denormalization is the process of combining tables in a way that reduces the number of
joins, improving query performance at the cost of increased redundancy.
94. What is functional dependency in DBMS?
● A functional dependency exists when one attribute uniquely determines another attribute
in a relation.
95. What is a candidate key?
● A candidate key is a set of attributes that uniquely identify a record in a table and could
be chosen as the primary key.
96. What is a composite key?
● A composite key is a combination of two or more columns used to uniquely identify a
record in a table.
97. What is a primary key?
● A primary key is a column or set of columns that uniquely identifies each row in a table
and cannot have NULL values.
98. What is a foreign key?
● A foreign key is a column or set of columns in a table that uniquely identifies a row in
another table, creating a relationship between the two.
99. What is the difference between 1NF, 2NF, and 3NF?
● 1NF eliminates duplicate columns; 2NF removes partial dependencies, and 3NF
removes transitive dependencies.
100. What is Boyce-Codd Normal Form (BCNF)?
● BCNF is a stricter version of 3NF that eliminates all functional dependencies where a
non-prime attribute determines a candidate key.

Indexing:

101. What is an index in DBMS?


● An index is a data structure used to speed up the retrieval of rows from a table.
102. What is the purpose of an index?
● An index improves query performance by allowing faster searching and retrieval of
records.
103. What are the types of indexes in DBMS?
● Types of indexes include:
○ Single-level index
○ Multi-level index
○ Clustered index
○ Non-clustered index
104. What is a clustered index?
● A clustered index determines the physical order of rows in a table and can only be
created once per table.
105. What is a non-clustered index?
● A non-clustered index is a separate structure from the table that does not affect the
physical order of rows.
106. What is a composite index?
● A composite index is an index that uses multiple columns in a table to improve query
performance.
107. What is a unique index?
● A unique index ensures that no two rows in a table have the same value for the indexed
columns.
108. What is the difference between a clustered and non-clustered index?
● A clustered index sorts the actual data in the table, while a non-clustered index creates a
separate structure to hold the pointers to the data.
109. What is indexing by hashing?
● Indexing by hashing uses a hash function to map key values to specific slots in a hash
table for quick retrieval.
110. What is a full-text index?
● A full-text index is used to store information about text data and supports fast searching
of text-based data.

Database Design and Concepts:


111. What is a schema in DBMS?
● A schema is the structure that defines the organization of data in a database, including
tables, views, indexes, etc.
112. What is a relational model?
● The relational model organizes data into tables (or relations) with rows and columns,
where each row represents a record and each column represents an attribute.
113. What are the components of a relational database?
● Components include tables, rows, columns, keys, and relationships between tables.
114. What is a view in DBMS?
● A view is a virtual table derived from a SELECT query, which can simplify complex
queries or restrict data access.
115. What is a synonym in DBMS?
● A synonym is an alias for database objects like tables or views, providing a way to
access these objects more easily or securely.
116. What is normalization?
● Normalization is the process of organizing a database to reduce redundancy and
improve data integrity by breaking down large tables into smaller ones.
117. What is de-normalization?
● De-normalization is the process of combining normalized tables back into larger tables to
improve performance for read-heavy queries.
118. What are the advantages of normalization?
● Reduces data redundancy, improves data integrity, and makes updates, deletions, and
insertions easier.
119. What is the difference between primary key and foreign key?
● A primary key uniquely identifies records within a table, whereas a foreign key
establishes a relationship between two tables.
120. What is a composite key in DBMS?
● A composite key is a combination of two or more columns used to uniquely identify a
record in a table.

Query Optimization:

121. What is query optimization?


● Query optimization is the process of selecting the most efficient execution plan for a SQL
query.
122. What is an execution plan in DBMS?
● An execution plan is the sequence of operations that the database engine follows to
execute a query.
123. What are the types of query optimization?
● Types of query optimization include:
○ Rule-based optimization
○ Cost-based optimization
124. What is a cost-based optimizer?
● A cost-based optimizer chooses the execution plan that has the least cost in terms of
time and resources based on statistics.
125. What is a rule-based optimizer?
● A rule-based optimizer chooses an execution plan based on predefined rules and
heuristics.
126. What are the factors that affect query performance?
● Factors include the size of the dataset, indexing, complexity of joins, hardware
resources, and query structure.
127. What is indexing?
● Indexing is the process of creating a data structure that speeds up query processing by
allowing faster searches.
128. What is a covering index?
● A covering index is an index that includes all the columns required to answer a query,
preventing the need to access the table.
129. What is the difference between a clustered and non-clustered index?
● A clustered index determines the physical order of rows in the table, while a
non-clustered index is a separate structure that points to the table rows.
130. What is the use of the "EXPLAIN" keyword in SQL?
● The "EXPLAIN" keyword provides information about the execution plan of a query.

Distributed Databases:

131. What is a distributed database?


● A distributed database is a database that is spread across multiple locations or
computers, which may or may not be connected over a network.
132. What are the advantages of distributed databases?
● Advantages include fault tolerance, improved performance, scalability, and data
availability.
133. What is data fragmentation in a distributed database?
● Data fragmentation is the process of dividing a database into smaller parts called
fragments, which can be stored at different locations.
134. What is replication in a distributed database?
● Replication is the process of copying data from one database to another to ensure
consistency and availability.
135. What is a two-phase commit protocol in distributed databases?
● The two-phase commit protocol ensures that a transaction is either committed or rolled
back across multiple databases in a distributed system.
136. What is a distributed transaction?
● A distributed transaction involves multiple databases or servers, where each node must
participate in the transaction.
137. What is consistency in distributed databases?
● Consistency ensures that all copies of a distributed database are in sync and reflect the
same data.
138. What is availability in distributed databases?
● Availability ensures that the database is accessible and can respond to queries even if
some nodes fail.
139. What is partition tolerance in distributed databases?
● Partition tolerance ensures that the database can function even if the network is
partitioned and communication between nodes is temporarily unavailable.
140. What is CAP theorem?
● The CAP theorem states that a distributed database can only guarantee two of the
following three properties: Consistency, Availability, and Partition Tolerance.

Data Integrity and Security:

141. What is data integrity in DBMS?


● Data integrity ensures that the data in the database is accurate, consistent, and reliable.
142. What are the types of data integrity?
● Types include:
○ Entity Integrity
○ Referential Integrity
○ Domain Integrity
143. What is domain integrity?
● Domain integrity ensures that values in a column come from a defined set of valid
values.
144. What is entity integrity?
● Entity integrity ensures that each table has a primary key that uniquely identifies each
record and that no part of the primary key is NULL.
145. What is referential integrity?
● Referential integrity ensures that foreign keys correctly reference primary keys in related
tables.
146. What is a constraint in DBMS?
● A constraint is a rule enforced on data in a table to ensure the integrity and correctness
of data.
147. What is an integrity constraint?
● An integrity constraint is a rule that helps maintain the correctness of data in a database,
such as primary key, foreign key, and check constraints.
148. What is SQL injection?
● SQL injection is a security vulnerability where attackers inject malicious SQL code into a
query to manipulate or access data.
149. How can SQL injection be prevented?
● SQL injection can be prevented by using prepared statements, parameterized queries,
and validating input data.
150. What is encryption in DBMS?
● Encryption is the process of converting data into a coded form to prevent unauthorized
access.

Backup and Recovery:

151. What is a database backup?


● A database backup is a copy of the database created to protect against data loss due to
system failure or other issues.
152. What is the difference between a full backup and an incremental backup?
● A full backup copies all data in the database, while an incremental backup only copies
the changes made since the last backup.
153. What is point-in-time recovery?
● Point-in-time recovery allows you to restore a database to a specific moment in time,
using transaction logs.
154. What is a differential backup?
● A differential backup copies the changes made since the last full backup.
155. What is the importance of a transaction log in database recovery?
● The transaction log records all changes made to the database, enabling recovery to a
specific point in time.
156. What is a hot backup?
● A hot backup is performed while the database is online and being actively used.
157. What is a cold backup?
● A cold backup is performed when the database is offline, ensuring no changes are made
during the backup.
158. What is a backup set?
● A backup set is a collection of backup files that are created during the same backup
operation.
159. What is database restore?
● Database restore is the process of recovering a database from a backup copy to restore
it to a functional state.
160. What is log shipping in DBMS?
● Log shipping involves automatically sending transaction log backups from a primary
database to a secondary database for recovery.

Advanced DBMS Topics:

161. What is an Entity-Relationship diagram (ERD)?


● An ERD is a graphical representation of the entities and their relationships in a
database.
162. What is the difference between a strong entity and a weak entity?
● A strong entity can exist independently, while a weak entity depends on another entity for
identification.
163. What is a cardinality constraint?
● Cardinality constraint defines the number of instances of one entity that can or must be
associated with another entity.
164. What is an associative entity?
● An associative entity is used to represent a many-to-many relationship between two
entities.
165. What is a surrogate key?
● A surrogate key is a unique identifier for an entity, not derived from application data but
generated by the database.
166. What is the difference between a view and a table?
● A table is a physical storage unit, while a view is a virtual table created by a query.
167. What is the use of a primary key in a database?
● A primary key uniquely identifies each record in a table and ensures that no record has a
NULL value in the primary key column.
168. What is an object-oriented database?
● An object-oriented database stores data as objects, similar to how data is represented in
object-oriented programming languages.
169. What is a materialized view?
● A materialized view is a view whose results are stored physically, allowing for faster
query performance at the cost of being out-of-date with the underlying data.
170. What is a recursive relationship in DBMS?
● A recursive relationship occurs when an entity has a relationship with itself, such as an
employee-manager relationship.

Advanced DBMS Topics (Continued):

171. What is the difference between OLTP and OLAP?


● OLTP (Online Transaction Processing) focuses on managing transactional data, while
OLAP (Online Analytical Processing) is used for complex querying and reporting on
large volumes of data.
172. What is a database trigger?
● A trigger is a set of SQL statements that are automatically executed or fired when a
specific event (insert, update, delete) occurs on a table or view.
173. What is a stored procedure?
● A stored procedure is a set of SQL statements that can be stored in the database and
executed on demand to perform operations like insertions, updates, or deletions.
174. What is a database cursor?
● A cursor is a database object used to retrieve and process individual rows from a result
set, typically used in stored procedures or complex queries.
175. What are the advantages of stored procedures?
● Stored procedures improve performance, enhance security, promote code reuse, and
reduce network traffic by allowing multiple SQL commands to be executed in a single
call.
176. What is a recursive query in SQL?
● A recursive query is a query that references itself, often used to retrieve hierarchical
data, such as organizational structures.
177. What is an index and what are its types?
● An index is a database object that improves the speed of data retrieval. Types include
unique index, composite index, and full-text index.
178. What is a foreign key constraint?
● A foreign key constraint ensures that the values in one table match the values in the
primary key column of another table, enforcing referential integrity.
179. What is an aggregate function in SQL?
● An aggregate function performs a calculation on a set of values and returns a single
value. Examples include COUNT(), SUM(), AVG(), MIN(), and MAX().
180. What is the difference between a "UNION" and a "JOIN"?
● "UNION" combines results from two or more SELECT queries into a single result set,
while "JOIN" combines columns from two or more tables based on a related column.

Transaction Management and Concurrency Control:

181. What is a database transaction?


● A database transaction is a sequence of one or more SQL operations executed as a
single unit of work, which is either fully completed or fully rolled back.
182. What are ACID properties in DBMS?
● ACID stands for Atomicity, Consistency, Isolation, and Durability, which guarantee
reliable transaction processing in databases.
183. What is the isolation level in DBMS?
● The isolation level defines the degree to which the operations in one transaction are
isolated from those in other concurrent transactions. Common levels include READ
UNCOMMITTED, READ COMMITTED, REPEATABLE READ, and SERIALIZABLE.
184. What is a deadlock in DBMS?
● A deadlock occurs when two or more transactions block each other, causing the system
to reach a state where no progress can be made.
185. How can deadlock be prevented?
● Deadlock prevention methods include using timeouts, resource allocation strategies, and
transaction ordering.
186. What is a write-ahead log (WAL)?
● The write-ahead log is a logging mechanism that ensures that changes to the database
are first written to a log before being applied to the database, which helps in recovery
after a crash.
187. What is a lock in DBMS?
● A lock is a mechanism to control access to a resource in a database, ensuring that
transactions are executed without interfering with each other.
188. What are different types of locks?
● Types of locks include:
○ Shared lock (S)
○ Exclusive lock (X)
○ Intention lock
○ Read lock
○ Write lock
189. What is a rollback in DBMS?
● A rollback undoes the changes made by a transaction, reverting the database to its
previous state in case of failure.
190. What is a commit in DBMS?
● A commit is the operation that finalizes a transaction, making all changes permanent.

Normalization and Denormalization (Continued):

191. What is First Normal Form (1NF)?


● A table is in 1NF if all columns contain atomic (indivisible) values, and each column
contains values of a single type.
192. What is Second Normal Form (2NF)?
● A table is in 2NF if it is in 1NF and all non-key attributes are fully dependent on the
primary key.
193. What is Third Normal Form (3NF)?
● A table is in 3NF if it is in 2NF and no transitive dependencies exist between non-key
attributes.
194. What is Boyce-Codd Normal Form (BCNF)?
● A table is in BCNF if it is in 3NF and every determinant is a candidate key.
195. What is Fourth Normal Form (4NF)?
● A table is in 4NF if it is in BCNF and there are no multi-valued dependencies.
196. What is Fifth Normal Form (5NF)?
● A table is in 5NF if it is in 4NF and contains no join dependencies.
197. What are functional dependencies in DBMS?
● Functional dependencies define a relationship between attributes, where one attribute
uniquely determines another.
198. What is the role of primary key in normalization?
● The primary key ensures that each record in a table is unique and helps eliminate
redundancy during normalization.
199. What is denormalization?
● Denormalization is the process of combining normalized tables into larger tables to
improve query performance at the cost of data redundancy.
200. What is a surrogate key in normalization?
● A surrogate key is an artificial key used to uniquely identify records when a natural key is
not available or practical.

You might also like