0% found this document useful (0 votes)
19 views4 pages

DBMS Viva Q&a

The document provides a comprehensive set of questions and answers related to Database Management Systems (DBMS) and SQL. Key topics include definitions of DBMS and RDBMS, SQL commands for data manipulation, normalization, transactions, indexing, and various database concepts such as keys, constraints, and integrity. It serves as a study guide for understanding fundamental database management principles and practices.

Uploaded by

lagishettisuresh
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)
19 views4 pages

DBMS Viva Q&a

The document provides a comprehensive set of questions and answers related to Database Management Systems (DBMS) and SQL. Key topics include definitions of DBMS and RDBMS, SQL commands for data manipulation, normalization, transactions, indexing, and various database concepts such as keys, constraints, and integrity. It serves as a study guide for understanding fundamental database management principles and practices.

Uploaded by

lagishettisuresh
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/ 4

DATABASE MANAGEMENT VIVA Question and Answers

1 Q: What is DBMS?
A: A DBMS (Database Management System) is software that is used to manage databases. It allows
users to store, retrieve, update, and delete data efficiently.
2 Q: What is the difference between DBMS and RDBMS?
A:
o DBMS stores data as files; RDBMS stores data in tabular form.
o RDBMS supports relational constraints like primary keys and foreign keys; DBMS does not
necessarily support this.
o RDBMS follows normalization; DBMS may not.
3 Q: What is a primary key?
A: A primary key is a column or a set of columns in a table that uniquely identifies each row. It cannot
have NULL values or duplicates.
4 Q: What is a foreign key?
A: A foreign key is a field (or collection of fields) in one table that refers to the primary key in another
table. It enforces referential integrity.

5. Q: How do you create a table in SQL?


A:

CREATE TABLE student (


id INT PRIMARY KEY,
name VARCHAR(50),
age INT
);

6. Q: How to insert a record into a table?


A:

INSERT INTO student (id, name, age) VALUES (1, 'John', 20);

7. Q: Write a query to fetch all records from a table.


A:

SELECT * FROM student;

8. Q: How to update a record in SQL?


A:

UPDATE student SET age = 21 WHERE id = 1;

9. Q: How to delete a record in SQL?


A:

DELETE FROM student WHERE id = 1;

10. Q: What is normalization? Why is it important?


A: Normalization is the process of organizing data to minimize redundancy and improve data integrity.
It involves dividing large tables into smaller ones and defining relationships.
11. Q: What is a transaction?
A: A transaction is a unit of work that is performed against a database. It must be ACID-compliant
(Atomicity, Consistency, Isolation, Durability).
12. Q: What is indexing in DBMS?
A: Indexing is a technique used to speed up the retrieval of data from a database table. It creates a data
structure that allows for faster searching.
13. Q: What are the different types of joins in SQL?
A:

 INNER JOIN
 LEFT JOIN (or LEFT OUTER JOIN)
 RIGHT JOIN (or RIGHT OUTER JOIN)
 FULL JOIN (or FULL OUTER JOIN)
 SELF JOIN
 CROSS JOIN

14. Q: What is the difference between WHERE and HAVING clause?


A:

 WHERE is used to filter rows before grouping.


 HAVING is used to filter groups after aggregation.

15. Q: What is a view?


A: A view is a virtual table based on the result-set of an SQL statement. It does not store the data itself.
16. Q: What is a stored procedure?
A: A stored procedure is a set of SQL statements that can be saved and reused. It allows for modular
programming and better performance.
17. Q: What is the difference between DELETE, TRUNCATE, and DROP?
A:

 DELETE removes rows based on condition and can be rolled back.


 TRUNCATE removes all rows, cannot be rolled back.
 DROP removes the table structure completely.

18. Q: What is ER diagram?


A: An Entity-Relationship (ER) diagram is a graphical representation of entities and their relationships
in a database.
19. Q: What are constraints in SQL?
A: Constraints are rules enforced on data columns such as NOT NULL, UNIQUE, PRIMARY KEY,
FOREIGN KEY, CHECK, and DEFAULT.
20. Q: What are ACID properties?
A:

 Atomicity: All operations succeed or none do.


 Consistency: The database remains in a consistent state.
 Isolation: Transactions do not interfere with each other.
 Durability: Once a transaction is committed, it is permanent.
21. Q: What is a composite key?
A: A composite key is a combination of two or more columns used together to uniquely identify a row
in a table.

22. Q: What is the difference between UNIQUE and PRIMARY KEY?


A: Both enforce uniqueness, but:

 PRIMARY KEY doesn't allow NULL and only one per table.
 UNIQUE allows one or more NULLs and can have multiple in a table.

23. Q: What is data redundancy?


A: Data redundancy refers to storing the same data in multiple places, which leads to wastage of space
and potential inconsistency.

24. Q: What is referential integrity?


A: It ensures that a foreign key value always refers to an existing, valid primary key in another table.

25. Q: What is a subquery in SQL?


A: A subquery is a query nested inside another SQL query, usually used in WHERE or HAVING
clauses.

26. Q: What are the different types of subqueries?


A:

 Single-row subquery
 Multiple-row subquery
 Correlated subquery
 Nested subquery

27. Q: What is a cursor in SQL?


A: A cursor is a database object used to retrieve, process, and manipulate rows returned by a query one
at a time.

28. Q: What is the use of the GROUP BY clause?


A: It groups rows with the same values in specified columns and is often used with aggregate functions
like COUNT(), SUM(), AVG(), etc.

29. Q: What is a trigger in DBMS?


A: A trigger is a stored procedure that automatically executes when a specific event occurs in a table
(e.g., INSERT, UPDATE, DELETE).

30. Q: What is data integrity?


A: It ensures the accuracy, consistency, and reliability of data over its lifecycle.

31. Q: What is a schema in DBMS?


A: A schema is the structure or blueprint of a database that defines tables, fields, relationships, views,
indexes, etc.
32. Q: What is a candidate key?
A: A candidate key is a set of attributes that can uniquely identify a record. One of them becomes the
primary key.

33. Q: What is a surrogate key?


A: A surrogate key is a system-generated unique identifier (like an auto-increment ID) used as a
primary key.

34. Q: What is a clustered index?


A: A clustered index determines the physical order of data in a table. A table can have only one
clustered index.

35. Q: What is a non-clustered index?


A: It stores a pointer to the actual data location, allowing multiple indexes in a table.

36. Q: What is the difference between DDL and DML?


A:

 DDL (Data Definition Language): CREATE, ALTER, DROP


 DML (Data Manipulation Language): INSERT, UPDATE, DELETE
 DQL : ,SELECT

37. Q: What is the difference between INNER JOIN and OUTER JOIN?
A:

 INNER JOIN returns only matching rows from both tables.


 OUTER JOIN returns matching + non-matching rows (LEFT, RIGHT, FULL).

38. Q: What is a transaction log?


A: It records all changes made to the database to ensure data recovery and rollback in case of failure.

39. Q: What is the role of the ROLLBACK and COMMIT commands?


A:

 COMMIT saves changes to the database.


 ROLLBACK undoes changes made in the current transaction.

40. Q: What is denormalization?


A: It is the process of intentionally introducing redundancy into a database design to improve read
performance.

You might also like