DBMS SQL Viva Questions With Answers BCA Sem2
DBMS SQL Viva Questions With Answers BCA Sem2
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.
Ans: Primary Key uniquely identifies each record. Foreign Key refers to the primary key of another table.
Ans: DBMS provides data consistency, reduced redundancy, better security, and data integrity compared to
file systems.
Ans: Normalization is organizing data to reduce redundancy. Types: 1NF, 2NF, 3NF, BCNF.
Ans: Anomalies are data inconsistencies. Types: Insertion, Update, and Deletion anomalies.
Ans: Schema is the structure of the database. Instance is the data in the database at a moment.
Ans: Data Independence means change in schema doesn't affect data. Types: Logical and Physical.
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.
Ans: DDL: Data Definition Language (CREATE), DML: Data Manipulation Language (INSERT), TCL:
Ans: SQL (Structured Query Language) is used to manage databases. Types: DDL, DML, DCL, TCL.
Ans: SELECT MAX(salary) FROM employees WHERE salary < (SELECT MAX(salary) FROM employees);
Ans: WHERE filters rows before grouping; HAVING filters after GROUP BY.
Ans: INNER JOIN: matching rows, LEFT JOIN: all from left + matches, FULL JOIN: all rows from both.
Ans: SELECT name, COUNT(*) FROM table GROUP BY name HAVING COUNT(*) > 1;
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
Ans: Constraints enforce rules: NOT NULL, UNIQUE, PRIMARY KEY, FOREIGN KEY, CHECK.
Ans: TRUNCATE removes all records, DELETE removes selected rows, DROP removes entire table.