This material focuses heavily on foundational RDBMS theory, SQL language elements, integrity constraints, and database design principles (Normalization and ER Modeling).
Database Management System (DBMS): A software system that manages, stores, and retrieves data efficiently in a structured format. It provides security, integrity, and consistency across multiple users.
Relational Database Management System (RDBMS): Stores data in the form of related tables (relations).
The goal of data abstraction is to hide complexity from users.
Constraints are rules added to columns to control the data stored, ensuring accuracy and reliability.
Primary Key: Uniquely identifies a row/record. A table can have **only one** Primary Key. It cannot contain duplicate or NULL values.
Foreign Key: A column in one table that references (points to) the primary key or candidate key of another table. Used to link two tables and maintain **Referential Integrity**.
SQL is a **4th Generation Language**, developed at IBM by Raymond Boyce and Donald Chamberlin. It is the standard language for relational databases.
| Language (Full Form) | Purpose/Focus | Core Commands |
|---|---|---|
| DDL (Data Definition Language) | Defines database schema/structure. | CREATE (table, view, index), ALTER (modifies structure), DROP (deletes entire object/structure), TRUNCATE (removes all rows/data quickly, structure remains), RENAME. |
| DML (Data Manipulation Language) | Manipulates data stored in the tables. | INSERT, UPDATE, DELETE (removes specific rows; uses WHERE clause; slower than TRUNCATE). |
| DQL (Data Query Language) | Subset of DML, retrieves data. | SELECT (The primary command). |
| TCL (Transaction Control Language) | Manages transactions to maintain consistency/reliability. | COMMIT (saves changes permanently), ROLLBACK (undoes changes to last commit/savepoint), SAVEPOINT. |
| DCL (Data Control Language) | Manages access permissions (security/authorization). | GRANT (permits user privileges), REVOKE (removes privileges). |
ACID properties ensure accuracy, completeness, and data integrity during database transactions.
Normalization is the process of minimizing redundancy and unwanted data from a relation or set of relations.
Anomalies (Problems Normalization Solves):
The Entity-Relationship (ER) model (introduced by Peter Chen in 1976) is used to represent real-world objects (entities) and their relationships.
Defines how many times an entity of one set participates in a relationship set.
Used to combine rows from two or more tables based on related columns, promoting normalization. ANSI standard SQL defines five types of JOINs.