RDBMS Exam Answers Final
RDBMS Exam Answers Final
1. Database
A database is an organized collection of data that allows easy access, management,
and updating. Databases help store large amounts of data efficiently. They can be
relational, hierarchical, or object-oriented. Examples include MySQL, Oracle, and
MongoDB.
2. Generalization
Generalization is an abstraction technique that merges multiple lower-level entities
into a higher-level entity. For example, 'Car' and 'Bike' can be generalized into
'Vehicle.' It is useful in ER modeling to reduce redundancy.
3. Integrity Constraint
Integrity constraints are rules ensuring data consistency in a database. Examples
include: Primary Key (ensures unique identification), Foreign Key (maintains referential
integrity), and Check Constraint (restricts data values).
4. Heap File
A heap file is an unordered collection of records stored in a database. It allows fast
insertion but slow retrieval since records are stored randomly.
5. Dual Table
The DUAL table in SQL is a special table used for operations where no actual table is
needed. Example: SELECT SYSDATE FROM DUAL; retrieves the current system date in
Oracle.
6. Group by Queries
The GROUP BY clause in SQL groups rows with the same column values and performs
aggregate functions. Example: SELECT department, COUNT(*) FROM employees GROUP
BY department;
7. Client-Server Computing
A client-server model consists of clients requesting services from a central server. It is
used in web applications, email systems, and cloud storage like Google Drive.
8. Database Security
Database security involves measures to protect data from unauthorized access,
corruption, or loss. Methods include user authentication, encryption, and access control.
PART - B (Essay Answer Type)
Example: In banking systems, DBMS ensures that account balances are consistent
across multiple transactions, preventing anomalies.
1. **Heap File Organization**: Data is stored randomly without any specific order.
Suitable for temporary data storage.
Example: An airline reservation system may use indexed file organization to quickly
locate flight records by passenger ID.
DML enables users to interact with data efficiently, making it a crucial part
of database management.
**Causes of Deadlocks:**
- Circular Wait: Each transaction waits for a resource held by another.
- Hold and Wait: Transactions hold some resources while waiting for others.
Example: In an online shopping cart system, deadlocks may occur if one process
locks inventory while another locks payment processing. Using timeout-based
prevention can resolve such issues.
13. Structure of Distributed Databases
A distributed database is a collection of multiple interconnected databases spread
across different locations. It improves reliability, availability, and performance.
Example: A multinational company may use a distributed database where each branch
maintains its customer records while sharing critical data globally.
Relational Algebra and its Operations
Relational Algebra is a procedural query language that forms the foundation of SQL
and is used to manipulate and retrieve data from relational databases. It operates on
relations (tables) and produces new relations as results.
Types of Relational Algebra Operations:
1. Selection (σ)
o Used to filter rows based on conditions.
o Example: σ (salary > 50000) (Employee) retrieves employees earning more
than 50,000.
2. Projection (π)
o Selects specific columns from a relation.
o Example: π (name, age) (Employee) retrieves only the name and age
columns.
3. Union ( ∪ )
o Combines two relations and removes duplicates.
o Example: A ∪ B merges two sets of employees.
4. Intersection ( ∩ )
o Returns common records between two relations.
o Example: A ∩ B gives employees common in both sets.
5. Difference ( - )
o Finds records in one relation but not in another.
o Example: A - B returns employees in A but not in B.
6. Cartesian Product ( × )
o Combines all records from two relations.
o Example: Employee × Department lists all employee-department
combinations.
7. Join Operations
o Combines related tuples from different relations.
o Example: Employee ⨝ Department joins employees with their respective
departments.
8. Division ( ÷ )
o Used for queries involving "for all" conditions.
o Example: Finding students who have taken all required courses.
Conclusion:
Relational Algebra provides a mathematical framework for querying relational
databases. It serves as the theoretical foundation for SQL query processing.