Database Management System Exam Guide
Database Management System Exam Guide
Cross join in relational algebra combines all rows from two tables to form a Cartesian product, used when analyzing combinations of rows. Self join is a table joined with itself, used to query hierarchical data or compare rows within the same table. Cross join example: selecting employee combinations; self join example: comparing employee records in different roles .
Mapping constraints specify the number of instances of one entity that can be associated with the related entity, which are essential for defining the cardinality between entities. They help ensure that the data integrity is maintained by enforcing rules that govern how entities relate within the database structure .
Selection operation is used to retrieve rows from a table that satisfy a given condition, while projection operation retrieves specific columns from rows. For example, selection could query: SELECT * FROM employees WHERE age > 30; This extracts all rows where the condition is met. Projection might be: SELECT name, salary FROM employees; which returns only the specified columns for each row .
Creating a trigger involves defining a set of instructions to automatically execute in response to a certain event on a particular table. The procedure typically involves specifying the triggering event (such as INSERT, UPDATE, DELETE), the timing (BEFORE, AFTER), and the operations to perform. Triggers are used for tasks like auditing changes, enforcing business rules, or synchronizing data between tables .
Closure of a set of attributes involves deriving all attributes that can be functionally determined by the given attributes based on a set of functional dependencies. For example, given a relation R and FDs such as A->BC, E->CF, B->E, CD->EF, the closure of {A, B} would include attributes A, B, C, D, E, F, as A determines BC, B determines E, and then E determines CF, covering all attributes .
Normalization organizes data to reduce redundancy and improve data integrity. However, not all databases should be fully normalized. In scenarios where performance is critical or for analytics, denormalization may be preferred to optimize read operations. Balance between normalization levels is often necessary depending on specific use cases and performance needs .
DROP TABLE command removes the entire table, including its definition and all contained data, affecting the database schema by eliminating its structure. DELETE command, however, removes rows from a table based on a condition without altering the table structure, affecting only the data within it .
Two fundamental characteristics of a database in a DBMS are data independence and security. Data independence allows the structure of the database to be changed without affecting the data access mechanism. Security ensures that only authorized users have access to certain data .
4NF eliminates multi-valued dependencies, ensuring that no table contains two or more independent and unrelated multi-valued facts about an entity. 5NF, or Project-Join Normal Form, further decomposes relationships by ensuring that every join dependency in a relation is a consequence of its candidate keys. By achieving these forms, redundancy is minimized, and anomalies in update operations are reduced .
Clustering in relational databases groups together data that is frequently accessed together, optimizing query performance. In the context of displaying partywise details of politicians, clustering can organize records by party code, allowing for efficient retrieval and summary of data based on the party each politician belongs to, thus enhancing query performance and organization .