Normalization:
Normalization is a database design technique that organizes data to reduce redundancy and dependency. It involves dividing large tables into smaller ones and defining relationships between them to enhance data integrity.
Objectives of Normalization
1. Eliminate redundant data.
2. Ensure data dependencies are logical.
3. Minimize anomalies during data operations (insertion, update, and deletion).
Forms of Normalization
1. First Normal Form (1NF): Ensures the table has no repeating groups and each column contains atomic values.
2. Second Normal Form (2NF): Ensures all non-key attributes are fully dependent on the primary key.
3. Third Normal Form (3NF): Eliminates transitive dependency; non-key attributes should not depend on other non-key attributes.
4. Boyce-Codd Normal Form (BCNF): A stricter version of 3NF where every determinant is a candidate key.
Transaction Processing
Transaction processing refers to the management of changes in a database. A transaction is a sequence of operations performed as a single logical unit of work, which must meet the ACID properties.
ACID Properties
1. Atomicity: Transactions are all-or-nothing.
2. Consistency: Ensures database integrity before and after a transaction.
3. Isolation: Transactions operate independently.
4. Durability: Changes made by a transaction are permanent once committed.
Common Operations in Transactions
1. Begin Transaction: Marks the start of a transaction.
2. Commit: Saves all changes made during the transaction permanently.
3. Rollback: Reverts changes made by a transaction in case of failure.