DBMS Imp
DBMS Imp
1. Introduction to DBMS
2. Database Models
· Network Model
· Hierarchical Model
· Relational Algebra Operations (Select, Project, Union, Difference, Cartesian Product, Join,
Rename)
4. Normalization
· Transaction States
7. Indexing
· Hashing Techniques
8. Database Design
9. File Organization
- **Q2**: Differentiate between the terms *Database*, *DBMS*, and *RDBMS*. Provide examples.
- **Q4**: What is the role of a Database Administrator (DBA)? Discuss the key responsibilities.
- **Q5**: What is an Entity-Relationship (ER) Diagram? Draw an ER diagram for a university database
system, including entities like *Student*, *Course*, *Professor*, and relationships.
- A company has *Departments* with a *Manager*, and each *Department* has multiple
*Employees*.
- a) Retrieve the names of all employees who work in the 'HR' department.
- c) Delete all records from the 'Student' table where the student’s grade is below 50.
- **Q10**: What is the difference between *Primary Key* and *Foreign Key*? Provide an example.
- **Q11**: Explain the concept of normalization. What are the different normal forms? Discuss 1NF,
2NF, and 3NF with examples.
- **Q13**: What is *BCNF*? How is it different from 3NF? Provide an example where a relation is in
3NF but not in BCNF.
- **Q14**: Define *transaction* in DBMS. Explain the ACID properties with examples.
- **Q15**: What are the different *transaction states*? Draw the state diagram of a transaction.
- **Q16**: Discuss the *Two-Phase Locking Protocol* and its role in concurrency control.
- **Q17**: Explain the concepts of *deadlock*, *deadlock prevention*, and *deadlock detection* in
DBMS.
- **Q18**: What is an index in a database? Discuss the differences between a *clustered* and a *non-
clustered* index.
- **Q19**: Explain the structure of a *B-Tree* and *B+ Tree*. Why are they used for indexing?
- **Q20**: What is hashing? Discuss different hashing techniques used in databases.
- **Q22**: Explain *data fragmentation*, *data replication*, and *data allocation* in distributed
databases.
- **Q23**: Discuss the differences between *horizontal fragmentation* and *vertical fragmentation*
in a distributed database system.
- **Q24**: What are the different types of database backup? Discuss their advantages and
disadvantages.
- **Q25**: Explain the concepts of *checkpointing* and *log-based recovery* in the context of
database recovery.
- **Q26**: What is *NoSQL*? Discuss the different types of NoSQL databases with examples.
- **Q27**: Explain the architecture of a *Data Warehouse* and discuss its components.
- **Q28**: Discuss the concept of *Data Mining* and how it is related to databases.
- **Q29**: Design a database for an online library system. Identify the entities and relationships, and
provide the ER diagram and relational schema.
- **Q30**: Consider a university database with students, courses, professors, and departments. Design
the database schema and write SQL queries to:
- a) Data redundancy
- b) Data inconsistency
- c) Data integrity
- a) Objects
- b) Tables
- c) Files
- d) Lists
**Answer**: b) Tables
- a) Record
- b) Field
- c) File
- d) Tuple
**Answer**: d) Tuple
### **4. Which of the following is used to perform a SELECT operation in SQL?**
- a) INSERT
- b) UPDATE
- c) SELECT
- d) DELETE
**Answer**: c) SELECT
- a) One-to-One
- b) One-to-Many
- c) Many-to-Many
- d) Many-to-Few
**Answer**: d) Many-to-Few
- a) Atomicity
- b) Consistency
- c) Isolation
- a) 1NF
- b) 2NF
- c) 3NF
- d) BCNF
**Answer**: b) 2NF
- a) Heap
- b) Clustered
- c) Record
- d) File
**Answer**: b) Clustered
### **10. In a relational database, a primary key:**
### **11. Which of the following ensures that a database remains consistent even in the event of a
system crash?**
- a) Backup
- b) Transaction log
- c) Concurrency control
- d) Recovery manager
### **12. Which type of join returns all rows from the left table and matching rows from the right table?
**
- a) Inner Join
- b) Left Join
- c) Right Join
- d) Full Join
- a) ORDER BY
- b) WHERE
- c) GROUP BY
- d) HAVING
**Answer**: b) WHERE
- a) Codd
- b) Date
- c) Bachman
- d) Silverman
**Answer**: a) Codd
- d) Both b and c
### **16. Which of the following is used to retrieve data from one or more tables in a database?**
- a) SELECT
- b) INSERT
- c) UPDATE
- d) DELETE
**Answer**: a) SELECT
- a) Data redundancy
- b) Data inconsistency
- c) Costly to implement
- d) Data security
- a) 1NF
- b) 2NF
- c) 3NF
### **19. In which normal form is a relation free from transitive dependency?**
- a) 1NF
- b) 2NF
- c) 3NF
- d) BCNF
**Answer**: c) 3NF
### **20. Which SQL command is used to remove a table from a database?**
- a) DELETE
- b) DROP
- c) REMOVE
- d) TRUNCATE
**Answer**: b) DROP
### **1. Which of the following is the primary advantage of using a DBMS?**
- a) Data redundancy
- b) Data inconsistency
- c) Data integrity
- d) Data isolation
### **2. In which normal form is a relation free from transitive dependencies?**
- a) 1NF
- b) 2NF
- c) 3NF
- d) BCNF
**Answer**: c) 3NF
- a) Graphs
- b) Tables
- c) Objects
- d) Trees
**Answer**: b) Tables
- a) Inner Join
- b) Outer Join
- c) Left Join
### **6. In SQL, which of the following commands is used to modify data in a table?**
- a) SELECT
- b) UPDATE
- c) INSERT
- d) DELETE
**Answer**: b) UPDATE
### **7. Which of the following statements is true about a primary key?**
- a) 1NF
- b) 2NF
- c) 3NF
- d) BCNF
**Answer**: b) 2NF
- a) It is atomic.
### **12. Which SQL clause is used to sort the result set in ascending or descending order?**
- a) WHERE
- b) ORDER BY
- c) GROUP BY
- d) HAVING
**Answer**: b) ORDER BY
### **13. Which of the following is used to uniquely identify a record in a relational database?**
- a) Foreign Key
- b) Primary Key
- c) Candidate Key
- d) Composite Key
### **14. In which normal form is a relation free from both transitive and partial dependencies?**
- a) 1NF
- b) 2NF
- c) 3NF
- d) BCNF
**Answer**: c) 3NF
### **15. Which of the following is not a DBMS function?**
- a) Data definition
- b) Data manipulation
- c) Data communication
- d) Data security
### **16. Which of the following types of indexing is used to speed up the search for data?**
- a) B-Tree Index
- b) Hash Index
- c) Bitmap Index
**Answer**: a) A situation where two transactions are locked and cannot proceed.
### **18. Which of the following is true about a clustered index?**
- d) Both a and c
### **19. Which of the following is used to ensure data consistency in a DBMS?**
- b) Concurrency control
- c) Transaction management
- d) Indexing
- a) MySQL
- b) MongoDB
- c) Oracle
- d) SQL Server
**Answer**: b) MongoDB
### **1. Which of the following is NOT a type of database model?**
- a) Hierarchical Model
- b) Network Model
- c) Object-Oriented Model
- d) Linear Model
- d) Both a and c
### **3. Which of the following is true about *inner join* in SQL?**
**Answer**: c) It returns only the rows where there is a match in both tables.
### **4. Which of the following is NOT a valid SQL aggregate function?**
- a) COUNT
- b) AVG
- c) MAX
- d) CONCAT
**Answer**: d) CONCAT
- a) It is atomic (all-or-nothing).
### **7. Which of the following SQL statements is used to remove all records from a table without
deleting the table itself?**
- a) DELETE
- b) TRUNCATE
- c) DROP
- d) REMOVE
**Answer**: b) TRUNCATE
### **8. What is the difference between `WHERE` and `HAVING` clauses in SQL?**
- a) `WHERE` is used to filter rows before aggregation, and `HAVING` is used after aggregation.
- c) `WHERE` is used to filter rows after aggregation, and `HAVING` is used before.
**Answer**: a) `WHERE` is used to filter rows before aggregation, and `HAVING` is used after
aggregation.
**Answer**: c) A set of one or more attributes that can uniquely identify a record
### **10. Which of the following is the most appropriate action if a deadlock occurs in a DBMS?**
### **11. Which of the following commands is used to change data in an existing table?**
- a) SELECT
- b) UPDATE
- c) INSERT
- d) ALTER
**Answer**: b) UPDATE
- a) A view is a virtual table that does not store data but is used to represent data from one or more
tables.
**Answer**: a) A view is a virtual table that does not store data but is used to represent data from one
or more tables.
### **13. Which of the following is used to ensure the integrity of data in a DBMS?**
- a) Constraints
- b) Normalization
- c) Indexing
- d) Both a and b
- a) LEFT JOIN
- b) RIGHT JOIN
- c) INNER JOIN
- d) EXTERNAL JOIN
### **16. Which of the following is the correct order of SQL operations when performing a query?**
### **17. Which type of backup involves backing up only the changes made since the last backup?**
- a) Full Backup
- b) Incremental Backup
- c) Differential Backup
- d) Partial Backup
### **18. In SQL, which keyword is used to prevent duplicate rows in the result set?**
- a) UNIQUE
- b) DISTINCT
- c) LIMIT
- d) ALL
**Answer**: b) DISTINCT
### **20. Which of the following is true about *BCNF (Boyce-Codd Normal Form)*?**
- b) A relation is in BCNF if it is in 2NF and all non-prime attributes are fully functionally dependent on
the primary key.
- d) Both a and b
### **1. In a database, which of the following is used to prevent unauthorized access to data?**
- a) Backup
- b) Authentication
- c) Indexing
- d) Normalization
**Answer**: b) Authentication
### **2. Which of the following is used to identify a record uniquely in a table?**
- a) Candidate key
- b) Foreign key
- c) Primary key
- d) Composite key
- a) 1NF
- b) 2NF
- c) 3NF
- d) BCNF
**Answer**: d) BCNF
- a) NOT NULL
- b) UNIQUE
- c) DEFAULT
- d) UPDATE
**Answer**: d) UPDATE
### **7. In SQL, which of the following clauses is used to group rows that have the same values in
specified columns?**
- a) GROUP BY
- b) ORDER BY
- c) HAVING
- d) WHERE
**Answer**: a) GROUP BY
### **8. Which of the following is a disadvantage of a *File System* over a *DBMS*?**
- a) Data redundancy
- d) Both a and c
**Answer**: d) Both a and c
### **10. Which SQL keyword is used to remove a table from the database?**
- a) DELETE
- b) REMOVE
- c) DROP
- d) TRUNCATE
**Answer**: c) DROP
- d) Both a and b
- a) Oracle
- b) SQL Server
- c) MongoDB
- d) MySQL
**Answer**: c) MongoDB
### **13. In SQL, which clause is used to filter data after applying GROUP BY?**
- a) HAVING
- b) WHERE
- c) ORDER BY
- d) SELECT
**Answer**: a) HAVING
### **14. Which of the following is used to ensure that only one record exists for a primary key?**
- a) Unique constraint
- b) Default constraint
- b) Returns all rows from both tables, whether there is a match or not
- c) Returns rows from the left table, even if there is no match in the right table
### **16. Which of the following is used to enforce a relationship between two tables in SQL?**
- a) Foreign key
- b) Primary key
- c) Composite key
- d) Candidate key
### **17. Which of the following is used to combine data from two or more tables in SQL?**
- a) UNION
- b) JOIN
- c) SELECT
- d) GROUP BY
**Answer**: b) JOIN
- b) Hashing
- c) Bitmap indexing
- d) Sorting
**Answer**: d) Sorting
### **19. What does the *SQL SELECT DISTINCT* statement do?**