- ๐ What is a database?
- ๐งฑ SQL introduction
- ๐ Types of database objects: Tables, Views, Indexes, Sequences, Triggers
- ๐งฑ DDL โ CREATE, ALTER, DROP, TRUNCATE
- โ๏ธ DML โ INSERT, UPDATE, DELETE
- ๐ DQL โ SELECT
- ๐ TCL โ COMMIT, ROLLBACK, SAVEPOINT
- ๐ DCL โ GRANT, REVOKE
- Filtering: WHERE, BETWEEN, IN, LIKE, IS NULL
- Sorting: ORDER BY
- Limiting: LIMIT
- Logical operators: AND, OR, NOT
- Conditional logic: CASE
SUM, AVG, COUNT, MAX, MIN
CONCAT, LENGTH, SUBSTRING, UPPER, LOWER, TRIM
NOW(), CURDATE(), DATE_ADD(), DATE_FORMAT()
- GROUP BY โ group rows
- HAVING โ filter groups after grouping
- ๐ INNER JOIN
- โช๏ธ LEFT JOIN
- โฉ๏ธ RIGHT JOIN
- ๐ FULL JOIN
- ๐ SELF JOIN
- โ CROSS JOIN
- ๐ PRIMARY KEY
- ๐ FOREIGN KEY
- ๐ UNIQUE
- ๐ซ NOT NULL
- โ๏ธ CHECK
- ๐ DEFAULT
- UNION
- UNION ALL
- INTERSECT
- EXCEPT (if supported)
- ๐งช
START TRANSACTION - ๐พ
COMMIT - โ
ROLLBACK - ๐งฉ
SAVEPOINT
Ensures ACID properties (Atomicity, Consistency, Isolation, Durability)
- โก
CREATE INDEXโ improves search speed - Can be: Unique or Non-Unique
๐ Advanced SQL โ Level Up Your Database Skills 1๏ธโฃ Subqueries & Nested Queries
๐ Subquery in WHERE
๐ฆ Subquery in FROM (derived table)
๐ฏ Subquery in SELECT
๐ Correlated Subqueries
โก EXISTS vs IN vs ANY vs ALL
2๏ธโฃ Advanced Joins
๐ฅ Self Join (manager-management table)
๐ Multi-table joins
๐ Joins with Aggregate Functions
๐ Cross Join usage in real cases
3๏ธโฃ Views
๐ช Creating views: CREATE VIEW
๐ Updating data with views
๐ซ Updatable vs Non-Updatable Views
๐ Real use cases: security, simplification
4๏ธโฃ Stored Procedures & Functions
โ๏ธ CREATE PROCEDURE
๐งต Input & Output parameters
๐ CALL a procedure
๐ Stored Functions using RETURN
๐ Reusable logic for apps
5๏ธโฃ Triggers
๐งจ BEFORE INSERT
๐ฅ AFTER UPDATE
๐ Auditing tables
๐ Logging data changes
6๏ธโฃ Window Functions (Analytical Functions)
๐ช ROW_NUMBER()
๐ RANK()
๐ฅ DENSE_RANK()
โญ๏ธ LEAD()
โฎ๏ธ LAG()
โ Running totals โ SUM() OVER()
7๏ธโฃ CTE โ Common Table Expressions
๐ WITH clause
๐ Recursive CTE
Organization hierarchy
Category trees
Explaining parent-child relations
8๏ธโฃ Indexing (Performance Boost)
โก Composite Index
๐ Covering Index
๐งฑ Clustered vs Non-Clustered (conceptual)
๐ How indexes affect WHERE, JOIN, ORDER BY
9๏ธโฃ Normalization & Design
1๏ธโฃ 1NF
2๏ธโฃ 2NF
3๏ธโฃ 3NF
๐ต BCNF
๐งฉ When to use Denormalization
๐ฆ Data redundancy control
๐ Query Optimization
๐ EXPLAIN โ read query execution plan
โ๏ธ Optimizing joins
๐งน Avoiding heavy subqueries
๐ Improving performance using indexes
๐ Avoid full table scans