0% found this document useful (0 votes)
47 views

DBMS SQL Viva Questions With Answers BCA Sem2

The document contains a comprehensive list of DBMS and SQL viva questions along with their answers, covering fundamental concepts such as DBMS vs RDBMS, keys, normalization, ACID properties, and SQL operations. It also includes practical SQL queries for data manipulation and retrieval, as well as explanations of various SQL functions and constraints. This resource is aimed at BCA Sem 2 students preparing for their viva examinations.

Uploaded by

Manmeet Singh
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)
47 views

DBMS SQL Viva Questions With Answers BCA Sem2

The document contains a comprehensive list of DBMS and SQL viva questions along with their answers, covering fundamental concepts such as DBMS vs RDBMS, keys, normalization, ACID properties, and SQL operations. It also includes practical SQL queries for data manipulation and retrieval, as well as explanations of various SQL functions and constraints. This resource is aimed at BCA Sem 2 students preparing for their viva examinations.

Uploaded by

Manmeet Singh
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

DBMS & SQL Viva Questions with Answers - BCA Sem 2

DBMS Viva Questions with Answers

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

Ans: DBMS (Database Management System) is software to store, retrieve, and manage data. RDBMS

(Relational DBMS) is a type of DBMS that stores data in tables with relationships.

2. Define primary key, foreign key, and unique key.

Ans: Primary Key uniquely identifies each record. Foreign Key refers to the primary key of another table.

Unique Key also ensures uniqueness but allows one NULL.

3. What are the advantages of DBMS over file systems?

Ans: DBMS provides data consistency, reduced redundancy, better security, and data integrity compared to

file systems.

4. What is normalization? Name its types.

Ans: Normalization is organizing data to reduce redundancy. Types: 1NF, 2NF, 3NF, BCNF.

5. What are anomalies in DBMS?

Ans: Anomalies are data inconsistencies. Types: Insertion, Update, and Deletion anomalies.

6. Explain the different types of relationships in DBMS.

Ans: Types: One-to-One, One-to-Many, Many-to-Many.

7. What is a schema and instance in DBMS?

Ans: Schema is the structure of the database. Instance is the data in the database at a moment.

8. What are ACID properties?

Ans: ACID: Atomicity, Consistency, Isolation, Durability - ensures reliable transactions.

9. What is data independence? Types?

Ans: Data Independence means change in schema doesn't affect data. Types: Logical and Physical.

10. What are different data models in DBMS?

Ans: Hierarchical, Network, Relational, and Object-Oriented models.

11. What is a candidate key? Can a table have more than one?

Ans: Candidate key can uniquely identify records. Yes, a table can have multiple candidate keys.

12. What is the difference between DDL, DML, and TCL?

Ans: DDL: Data Definition Language (CREATE), DML: Data Manipulation Language (INSERT), TCL:

Transaction Control Language (COMMIT).


13. What is a view? How is it different from a table?

Ans: View is a virtual table. Table is physical and stores data.

14. What is indexing? Why is it used?

Ans: Indexing speeds up data retrieval by creating pointers to data.

15. Explain the concept of transactions.

Ans: Transaction is a sequence of operations treated as a single unit of work.


SQL Viva Questions with Answers

1. What is SQL? What are its types?

Ans: SQL (Structured Query Language) is used to manage databases. Types: DDL, DML, DCL, TCL.

2. Write a query to fetch the second highest salary from a table.

Ans: SELECT MAX(salary) FROM employees WHERE salary < (SELECT MAX(salary) FROM employees);

3. What is the difference between WHERE and HAVING?

Ans: WHERE filters rows before grouping; HAVING filters after GROUP BY.

4. Difference between INNER JOIN, LEFT JOIN, and FULL JOIN.

Ans: INNER JOIN: matching rows, LEFT JOIN: all from left + matches, FULL JOIN: all rows from both.

5. Write a query to find duplicate records in a table.

Ans: SELECT name, COUNT(*) FROM table GROUP BY name HAVING COUNT(*) > 1;

6. What is a subquery? Types of subqueries?

Ans: Subquery is a query inside another. Types: Scalar, Correlated, Nested.

7. What are aggregate functions? Give examples.

Ans: Aggregate functions: COUNT(), SUM(), AVG(), MAX(), MIN().

8. How to use GROUP BY and ORDER BY in queries?

Ans: GROUP BY groups data, ORDER BY sorts it.

9. What is the use of DISTINCT in SQL?

Ans: DISTINCT removes duplicate values.

10. Write SQL queries for: Creating a table, Inserting data, Updating a record, Deleting a record

Ans: CREATE TABLE students(id INT); INSERT INTO students VALUES (1); UPDATE students SET id=2

WHERE id=1; DELETE FROM students WHERE id=2;

11. What is a constraint in SQL? Types?

Ans: Constraints enforce rules: NOT NULL, UNIQUE, PRIMARY KEY, FOREIGN KEY, CHECK.

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

Ans: TRUNCATE removes all records, DELETE removes selected rows, DROP removes entire table.

13. Explain the use of NULL in SQL.

Ans: NULL represents missing or undefined value.

14. What is the default sorting order in SQL?

Ans: Default sorting is ascending (ASC).

15. What is the use of LIKE, IN, and BETWEEN?


Ans: LIKE is used for pattern matching, IN for multiple values, BETWEEN for range.

You might also like