Database Management Systems (DBMS)


What is DBMS?

A DBMS is software that manages databases. It allows creating, reading, updating, and deleting data efficiently. Examples: MySQL, PostgreSQL, Oracle.

Basic SQL Commands

SQL (Structured Query Language) is used to interact with databases.

CREATE TABLE students (
    id INT PRIMARY KEY,
    name VARCHAR(50)
);
INSERT INTO students VALUES (1, 'Alice');

SELECT Queries

SELECT retrieves data.

SELECT * FROM students WHERE id = 1;
SELECT name FROM students ORDER BY name;

Joins

Joins combine data from multiple tables. Types: INNER JOIN, LEFT JOIN, RIGHT JOIN.

SELECT s.name, c.course
FROM students s
INNER JOIN courses c ON s.id = c.student_id;

Normalization

Normalization reduces redundancy using forms like 1NF, 2NF, 3NF. It organizes data efficiently.

Transactions

Transactions ensure data integrity with ACID properties (Atomicity, Consistency, Isolation, Durability).

Indexing

Indexes speed up data retrieval, like a book index.

Table of Contents