0% found this document useful (0 votes)
11 views8 pages

DBMS Interview Q&A

The document provides an overview of Database Management Systems (DBMS), detailing types, key concepts like RDBMS, normalization, SQL commands, and various database operations. It explains advanced concepts such as ACID properties, transactions, indexing, and the differences between SQL and NoSQL databases. Additionally, it covers database design principles, including normalization forms, ER models, and data warehousing.

Uploaded by

20p61a04c4
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)
11 views8 pages

DBMS Interview Q&A

The document provides an overview of Database Management Systems (DBMS), detailing types, key concepts like RDBMS, normalization, SQL commands, and various database operations. It explains advanced concepts such as ACID properties, transactions, indexing, and the differences between SQL and NoSQL databases. Additionally, it covers database design principles, including normalization forms, ER models, and data warehousing.

Uploaded by

20p61a04c4
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/ 8

1. What is a DBMS?

o A Database Management System (DBMS) is software that interacts with users,


applications, and databases to store, modify, and retrieve data efficiently.

2. What are the types of DBMS?

o Hierarchical DBMS

o Network DBMS

o Relational DBMS (RDBMS)

o Object-oriented DBMS

3. What is RDBMS? How is it different from DBMS?

o RDBMS (Relational DBMS) stores data in tables with relationships, while DBMS
manages data without enforcing relationships strictly.

4. What is a database schema?

o A database schema defines the structure of the database, including tables, columns,
data types, and constraints.

5. What is normalization?

o Normalization is a process to minimize redundancy and dependency in a database


by dividing large tables into smaller ones.

SQL and Queries

6. What are the types of SQL commands?

o DDL (Data Definition Language) – CREATE, ALTER, DROP

o DML (Data Manipulation Language) – INSERT, UPDATE, DELETE

o DQL (Data Query Language) – SELECT

o DCL (Data Control Language) – GRANT, REVOKE

o TCL (Transaction Control Language) – COMMIT, ROLLBACK

7. What is the difference between DELETE and TRUNCATE?

o DELETE removes rows with a condition and can be rolled back.

o TRUNCATE removes all rows without a condition and cannot be rolled back.

8. What is the difference between WHERE and HAVING?

o WHERE is used to filter rows before aggregation.

o HAVING is used after aggregation to filter grouped data.

9. What is the difference between UNION and UNION ALL?


o UNION removes duplicate rows.

o UNION ALL includes all rows, including duplicates.

10. What are JOINS in SQL?

 INNER JOIN – Returns matching records.

 LEFT JOIN – Returns all from the left table and matching from the right.

 RIGHT JOIN – Returns all from the right table and matching from the left.

 FULL JOIN – Returns all records when there is a match in either table.

Indexes and Constraints

11. What is an index in DBMS?

 An index speeds up data retrieval in a database. It can be Clustered (physically reorders) or


Non-clustered (creates a logical order).

12. What are constraints in SQL?

 NOT NULL – Ensures column cannot have NULL values.

 UNIQUE – Ensures all values in a column are unique.

 PRIMARY KEY – A unique identifier for a table.

 FOREIGN KEY – Links two tables.

 CHECK – Restricts values in a column.

13. What is the difference between a primary key and a unique key?

 A primary key cannot have NULL values and uniquely identifies a row.

 A unique key allows NULL values and ensures unique values.

14. What is a foreign key?

 A foreign key is a column in one table that refers to the primary key in another table to
enforce referential integrity.

15. What is the difference between a clustered and a non-clustered index?

 A clustered index determines the physical order of rows.

 A non-clustered index creates a separate structure to store index data.

Advanced DBMS Concepts

16. What is a view in SQL?

 A view is a virtual table based on a SELECT query.

17. What is ACID in DBMS?


 Atomicity – Ensures all operations in a transaction complete successfully.

 Consistency – Ensures data integrity before and after a transaction.

 Isolation – Ensures transactions do not interfere with each other.

 Durability – Ensures changes persist after a successful transaction.

18. What is a stored procedure?

 A stored procedure is a precompiled set of SQL statements stored in the database to


improve performance.

19. What is a trigger in SQL?

 A trigger is an automatic action executed in response to database events (INSERT, UPDATE,


DELETE).

20. What is the difference between a function and a procedure?

 A function returns a single value, while a procedure can return multiple values and execute
complex logic.

Transactions and Concurrency Control

21. What is a transaction in DBMS?

 A transaction is a sequence of operations that follow ACID properties.

22. What is the difference between COMMIT and ROLLBACK?

 COMMIT saves all changes.

 ROLLBACK undoes all uncommitted changes.

23. What is deadlock in DBMS?

 A deadlock occurs when two transactions wait for each other’s resources indefinitely.

24. How can deadlocks be prevented?

 Using locks in a consistent order

 Timeouts for transactions

 Using deadlock detection mechanisms

25. What are isolation levels in DBMS?

 Read Uncommitted

 Read Committed

 Repeatable Read

 Serializable
Database Design and Normalization

26. What are the types of normal forms?

 1NF (First Normal Form) – No duplicate columns.

 2NF (Second Normal Form) – 1NF + No partial dependencies.

 3NF (Third Normal Form) – 2NF + No transitive dependencies.

 BCNF (Boyce-Codd Normal Form) – Stronger 3NF.

27. What is denormalization?

 Denormalization increases redundancy to improve performance.

28. What is an ER model?

 Entity-Relationship (ER) model represents entities and relationships between them.

29. What is the difference between OLTP and OLAP?

 OLTP (Online Transaction Processing) handles transactional data.

 OLAP (Online Analytical Processing) supports complex queries for analysis.

30. What is a surrogate key?

 A surrogate key is an artificial primary key generated by the system.

Miscellaneous

31. What is a materialized view?

 A materialized view stores query results for better performance.

32. What is a cursor in SQL?

 A cursor is used to fetch rows one by one from a result set.

33. What is an ORM?

 Object-Relational Mapping (ORM) converts data between relational databases and object-
oriented programming.

34. What is NoSQL?

 NoSQL is a non-relational database designed for scalability and flexibility (e.g., MongoDB,
Cassandra).

35. What is the difference between SQL and NoSQL?

 SQL is structured, uses tables, and follows ACID.

 NoSQL is unstructured, scalable, and schema-less.

1. What is denormalization?

o Denormalization increases redundancy to improve performance.


2. What is an entity?

 An entity is an object with attributes stored in a database (e.g., Student, Employee).

SQL & Queries

11. What are the types of SQL commands?

 DDL (CREATE, ALTER, DROP, TRUNCATE)

 DML (INSERT, UPDATE, DELETE)

 DQL (SELECT)

 DCL (GRANT, REVOKE)

 TCL (COMMIT, ROLLBACK, SAVEPOINT)

12. What is the difference between DELETE, TRUNCATE, and DROP?

 DELETE removes rows but keeps structure.

 TRUNCATE removes all rows and resets identity.

 DROP removes the table completely.

13. What is the difference between WHERE and HAVING?

 WHERE filters before aggregation; HAVING filters after aggregation.

14. What is the difference between UNION and UNION ALL?

 UNION removes duplicates; UNION ALL keeps all records.

15. What are JOINS in SQL?

 INNER JOIN, LEFT JOIN, RIGHT JOIN, FULL JOIN, CROSS JOIN, SELF JOIN.

16. What is a subquery?

 A subquery is a query inside another query.

17. What is a stored procedure?

 A stored procedure is a precompiled SQL script stored in the database.

18. What is a trigger in SQL?

 A trigger is an automatic action executed in response to an event.

19. What is a cursor in SQL?

 A cursor is a database object used to retrieve row-by-row results.

20. What are aggregate functions in SQL?

 COUNT(), SUM(), AVG(), MIN(), MAX().


Indexes & Constraints

21. What is an index in DBMS?

 An index speeds up data retrieval.

22. What are the types of indexes?

 Clustered Index – Reorders rows physically.

 Non-clustered Index – Creates a separate structure for quick lookup.

23. What is the difference between a primary key and a unique key?

 Primary Key: Unique + Not Null.

 Unique Key: Unique but allows NULL.

24. What is a foreign key?

 A foreign key links a column to another table’s primary key.

25. What are constraints in SQL?

 NOT NULL, UNIQUE, PRIMARY KEY, FOREIGN KEY, CHECK, DEFAULT.

Transactions & Concurrency

26. What is a transaction in DBMS?

 A transaction is a sequence of database operations that follow ACID properties.

27. What is ACID in DBMS?

 Atomicity, Consistency, Isolation, Durability.

28. What is the difference between COMMIT and ROLLBACK?

 COMMIT saves changes.

 ROLLBACK undoes changes.

29. What is deadlock?

 Deadlock occurs when two transactions wait for each other’s resources.

30. How to prevent deadlocks?

 Lock ordering, timeout mechanisms, deadlock detection.

31. What are isolation levels in DBMS?

 Read Uncommitted, Read Committed, Repeatable Read, Serializable.

Database Design & Normalization

32. What is an ER model?


 Entity-Relationship Model represents entities, attributes, and relationships.

33. What is BCNF?

 Boyce-Codd Normal Form (BCNF) is a stronger form of 3NF.

34. What is functional dependency?

 A functional dependency (FD) exists when one attribute uniquely determines another.

35. What is a surrogate key?

 A surrogate key is a system-generated unique identifier.

36. What is a materialized view?

 A materialized view stores query results for fast retrieval.

NoSQL & Big Data

37. What is NoSQL?

 NoSQL databases store unstructured or semi-structured data without a fixed schema.

38. What are the types of NoSQL databases?

 Key-Value Store, Document Store, Column-Family Store, Graph Database.

39. What is the difference between SQL and NoSQL?

 SQL follows a structured schema; NoSQL is flexible.

40. What is MongoDB?

 A document-oriented NoSQL database storing JSON-like data.

Miscellaneous

41. What is indexing?

 Indexing improves query performance by creating quick lookup tables.

42. What is partitioning in DBMS?

 Partitioning splits large tables into smaller, manageable parts.

43. What is sharding?

 Sharding distributes data across multiple servers to improve performance.

44. What is a hash join?

 Hash join uses a hash table for efficient joining of large tables.

45. What is a B-tree index?

 B-tree index is a balanced tree structure used for indexing in databases.


46. What is a log file in DBMS?

 A log file records all changes for recovery in case of failure.

47. What is replication in DBMS?

 Replication creates copies of a database for backup and high availability.

48. What is data warehousing?

 A data warehouse is a central repository for analytical reporting.

49. What is an ORM?

 Object-Relational Mapping (ORM) connects databases to programming languages.

50. What is an API in DBMS?

 API (Application Programming Interface) allows communication between databases and


applications.

You might also like