A comprehensive PostgreSQL Notes document.
- Section 0 → Index (Induction / Table of Contents)
- Section 1 → Database Fundamentals
- Section 2 → CRUD Operations
- Section 3 → Data Types & Constraints
- Section 4 → Clauses (WHERE, ORDER BY, LIKE, etc.)
- Section 5 → Aggregations & Grouping
- Section 6 → String Functions & Exercises
- Section 7 → Altering Tables & Constraints
- Section 8 → Relationships & Joins
- Section 9 → Advanced SQL (Views, Stored Procedures, CTEs, Triggers, etc.)
- Final → Consolidated exercises & summary
From Zero to Hero
- What is a Database?
- Database vs DBMS vs RDBMS
- Types of Databases
- SQL vs PostgreSQL
- Installing PostgreSQL
- Creating, Connecting, Listing, and Dropping Databases
- CRUD Operations (Create, Read, Update, Delete)
- Creating and Describing Tables
- Inserting Data
- Selecting (Reading) Data
- Updating and Deleting Records
- PostgreSQL Data Types
- Constraints (Primary Key, Not Null, Default, Serial, Unique)
- Table Creation Example with Constraints
- Exercises on Constraints
- WHERE Clause
- Logical Operators (AND, OR, IN, NOT IN, BETWEEN)
- DISTINCT, ORDER BY, LIMIT, LIKE
- Practice Queries
- COUNT, SUM, AVG, MIN, MAX
- GROUP BY and HAVING
- Exercises
- CONCAT, CONCAT_WS
- SUBSTRING, LEFT, RIGHT
- LENGTH, UPPER, LOWER
- TRIM, REPLACE, POSITION
- Practice Tasks
- ALTER TABLE – Add / Drop Columns
- RENAME Table / Column
- Modify Data Type / Default Values
- Add NOT NULL and CHECK Constraints
- Named Constraints
- Exercises
- Understanding Relationships (1:1, 1:N, N:M)
- Foreign Keys and References
- JOIN Types (INNER, LEFT, RIGHT, CROSS)
- Practical Examples (Customers, Orders, Products)
- Exercises
- Views
- HAVING Clause and ROLLUP
- Stored Procedures and Functions
- Window Functions (ROW_NUMBER, RANK, etc.)
- CTE (Common Table Expressions)
- Triggers
- CASCADE and Delete Behavior
- Full practice tasks
- Combined example database
- Revision notes