DBMS
DBMS
6. Indexes
12.NoSQL vs SQL
🔹 4. Explain Normalization.
Answer:
Normalization is the process of organizing data to reduce redundancy and improve data
integrity.
Forms include:
● FULL OUTER JOIN – all records when there is a match in one of the tables.
🔹 8. What is a view?
Answer:
A View is a virtual table based on a SQL query. It doesn't store data itself but presents it
from one or more tables.
Awesome! Let’s move to the Advanced DBMS Interview Questions, covering deep
concepts like transactions, concurrency, query optimization, indexing strategies, etc.
● Dirty Reads
● Non-repeatable Reads
● Phantom Reads
Prevention Methods:
● Timeout
● Resource ordering
🔹 16. What are the differences between clustered and non-clustered indexes?
Feature Clustered Index Non-Clustered Index
● Join ordering
● Index usage
● Predicate pushdown
● Cost-based optimization
● Predicate locking
● Unique Constraints
● Check Constraints
● Transactions (ACID)
🔹 26. What is the difference between logical and physical data independence?
Type Definition Example
CopyEdit
BEGIN;
COMMIT;
-- If error occurs
ROLLBACK;
sql
CopyEdit
● ON UPDATE CASCADE
sql
CopyEdit
UNION ALL
🔹 42. What is the difference between a hot backup and a cold backup?
Backup Type Description
sql
CopyEdit
SELECT dept, COUNT(*) FROM employees GROUP BY dept HAVING COUNT(*) >
5;
● Application Programmer
● End User
● System Analyst
🔹 47. What is the difference between strong and weak entity sets?
Entity Description
Strong Has a primary key
Entity
Weak Entity Depends on another entity for identification; uses a foreign key and
discriminator
sql
CopyEdit
SAVEPOINT A;
-- some queries
ROLLBACK TO A;
sql
CopyEdit
● Primary Key
● Foreign Key
● Unique
● Not Null
● Check
sql
CopyEdit
● Avoid SELECT *
● Subschema: Subset of the schema, tailored for application or user needs (like
views).
🔹 62. What is a cursor in SQL?
Answer:
A cursor allows row-by-row processing of query results. Used when row-level operations
are needed.
sql
CopyEdit
🔹 64. What is the difference between stored procedure and function in SQL?
Feature Stored Procedure Function
● Horizontal – by rows
● Vertical – by columns
● Mixed
Ordered? No Yes
● Index usage
● Join methods
● Estimated cost
sql
CopyEdit
🔹 76. What is the difference between DELETE, TRUNCATE, and DROP again in context
of constraints and rollback?
TRUNCATE No No Minimal
● Timeout mechanisms
Resolution:
● Rollback
● Retry logic
🔹 88. What is the difference between eager and lazy evaluation in DBMS?
Type Description
🔹 89. What is the difference between OLTP and OLAP databases in architecture?
Feature OLTP OLAP
sql
CopyEdit
🔹 95. What are integrity constraints and why are they important?
Answer:
Rules to ensure valid and consistent data, such as:
● Primary Key
● Foreign Key
● Check
● Unique
● Not Null
🔹 96. What are LSM Trees and where are they used?
Answer:
Log-Structured Merge Trees are write-optimized data structures used in write-heavy
systems like Cassandra and LevelDB. They buffer writes in memory and flush them to disk.
● Needs maintenance
Prevents:
● Dirty reads
● Non-repeatable reads
🔹 99. What is cardinality in DBMS?
Answer:
Refers to the number of distinct values in a column. High cardinality = many unique
values (e.g., ID), Low cardinality = few (e.g., gender).
sql
CopyEdit