DBMS Revision Notes
1. Data Models
ER Model: Consists of entities, attributes, and relationships.
Relational Model: Represents data in tables (relations).
Network Model: Uses graph structures, with nodes and edges to represent relationships.
2. Normalization
1NF: Remove duplicate columns, create separate tables for related data.
2NF: Meet 1NF, and move partial dependencies to other tables.
3NF: Meet 2NF, and remove transitive dependencies.
BCNF: Stronger version of 3NF, where every determinant is a candidate key.
3. Keys
Primary Key: Unique identifier for a table row.
Foreign Key: References primary key in another table.
Super Key: Any combination of attributes that uniquely identify a row.
Candidate Key: Minimal super key, eligible to become a primary key.
4. SQL Commands
DDL (Data Definition Language): CREATE, ALTER, DROP.
DML (Data Manipulation Language): SELECT, INSERT, UPDATE, DELETE.
DCL (Data Control Language): GRANT, REVOKE.
5. Transactions and ACID Properties
Atomicity: Ensures all operations of a transaction are completed.
Consistency: Ensures database integrity is maintained.
Isolation: Ensures transactions do not interfere with each other.
Durability: Ensures that once a transaction is committed, it remains in the system.
6. Joins
Inner Join: Returns records that have matching values in both tables.
Outer Join: Returns all records from one or both tables, with NULLs where no match is found.
Cross Join: Cartesian product of both tables.
7. Indexing
Clustered Index: Sorts and stores data rows in the table based on their key values.
Non-clustered Index: A separate structure that stores the index and references the data row.
8. Concurrency Control
Lock-based Protocols: Locks used to control access.
Timestamp-based Protocols: Assigns a unique timestamp to each transaction.
Deadlock Handling: Deadlocks are prevented by locking in a specific order or timeout.
9. Relational Algebra
Selection: Select rows based on conditions.
Projection: Select specific columns.
Union: Combine two relations.
Intersection: Common tuples between two relations.
Cartesian Product: Combine all rows from two relations.