SQL.
Database querying from fundamentals to advanced — SELECT, JOINs, window functions, CTEs, and query optimisation.
Beginner
Start here — no prior experience needed
Setting Up PostgreSQL
Install PostgreSQL, connect with psql, and run your first query.
SQL Data Types
Understand PostgreSQL data types: numbers, text, dates, booleans, JSON, and arrays.
Data Definition Language (DDL)
Create, modify, and drop tables using DDL commands in PostgreSQL.
INSERT, UPDATE, and DELETE
Modify table data with INSERT, UPDATE, DELETE, and learn UPSERT with ON CONFLICT.
SELECT Queries
Query data with SELECT, filter rows, sort results, and paginate with LIMIT and OFFSET.
Filtering Data
Use comparison operators, BETWEEN, IN, LIKE, IS NULL, and COALESCE to filter query results.
SQL JOINs
Combine rows from multiple tables using INNER JOIN, LEFT JOIN, RIGHT JOIN, and other join types.
Introduction to SQL
Learn what SQL is, how relational databases work, and when to use them.
Intermediate
For developers with core concepts down
Aggregations and GROUP BY
Summarize data with COUNT, SUM, AVG, GROUP BY, HAVING, and the FILTER clause.
Subqueries
Use subqueries in SELECT, WHERE, and FROM clauses — including correlated subqueries, EXISTS, and lateral joins.
Common Table Expressions (CTEs)
Write cleaner queries with WITH clauses, chain multiple CTEs, and use recursive CTEs for hierarchical data.
Window Functions
Use ROW_NUMBER, RANK, LAG, LEAD, and other window functions to perform calculations across rows.
Indexes and Query Performance
Speed up queries with B-tree, Hash, GIN, and GiST indexes, and use EXPLAIN ANALYZE to verify.
Transactions
Ensure data integrity with ACID transactions, savepoints, and isolation levels in PostgreSQL.
Views
Create views and materialized views to simplify queries, encapsulate logic, and improve security.
Working with JSON in PostgreSQL
Store, query, and index JSON data using PostgreSQL's JSON and JSONB types.
Database Schema Design
Design normalized, maintainable schemas with proper relationships, constraints, and best practices.
SQL Interview Preparation
The top 35 SQL interview questions with real query solutions and explanations.
Advanced
Production-grade patterns for experienced engineers
Stored Procedures and Functions
Write reusable database logic with PL/pgSQL functions, triggers, and stored procedures.
Query Optimization
Read EXPLAIN ANALYZE output, understand query plans, and tune slow PostgreSQL queries.
SQL Security
Secure your PostgreSQL database with roles, GRANT/REVOKE, row-level security, and SQL injection prevention.
Replication and High Availability
Understand PostgreSQL WAL, streaming replication, logical replication, and connection pooling.