sql

    SQL Course

    Production-grade database engineering with SQL, PostgreSQL, Query Optimization, Transactions & Real-World Data Systems.

    85
    Lessons
    8
    Modules
    0/85
    Completed

    Architecture

    SQL Query Lifecycle

    From an application request through the parser, optimizer and executor — back to a typed result set.

    App Request
    HTTP
    SQL Query
    text
    Parser
    AST
    Optimizer
    cost-based
    Executor
    plan run
    Storage
    pages + WAL
    Result Set
    rows
    Indexing
    B-tree / GIN / BRIN
    Joins
    Nested · Hash · Merge
    ACID + Locks
    Tx isolation levels
    Scaling
    Replicas · Sharding
    Curriculum

    Enterprise learning path

    8 modules · 85 lessons

    SQL Fundamentals

    0/15 complete
    1. 1
      SQL Home
      Next up

      Welcome to the SQL Engineering track on TechLearningPRO — a complete, production-grade roadmap from your very first SELECT to designing multi-tenant, billion-row, ACID-compliant…

    2. 2
      Introduction to Databases

      A database is an organized collection of data that a program can read, write and search efficiently.

    3. 3
      What is SQL?

      SQL — Structured Query Language — is a declarative language for talking to relational databases.

    4. 4
      SQL vs NoSQL

      Both store data, but they make different trade-offs.

    5. 5
      Database Management Systems

      A DBMS is the software that runs your database — it accepts SQL, manages files on disk, handles concurrent users, enforces constraints, replicates data and recovers from crashes.

    6. 6
      Installing PostgreSQL / MySQL

      To learn SQL the right way you need a real database on your machine.

    7. 7
      Creating Databases

      A database is a logical container for tables.

    8. 8
      Creating Tables

      Tables are the heart of relational databases.

    9. 9
      SQL Data Types

      Choosing the right data type for each column controls correctness, storage cost and performance.

    10. 10
      INSERT Queries

      INSERT adds new rows to a table.

    11. 11
      SELECT Queries

      SELECT reads data.

    12. 12
      WHERE Clause

      WHERE filters rows before grouping or projection.

    13. 13
      ORDER BY

      ORDER BY sorts the result.

    14. 14
      LIMIT & OFFSET

      LIMIT caps the number of returned rows.

    15. 15
      SQL Aliases

      Aliases rename columns or tables in a query for readability.

    Database Design

    0/10 complete
    1. 16
      Database Design Basics

      Database design is the practice of modelling real-world entities (users, orders, products) into tables, columns and relationships.

    2. 17
      Primary Keys

      A primary key uniquely identifies each row in a table.

    3. 18
      Foreign Keys

      A foreign key is a column that references the primary key of another table — the way relational databases enforce relationships.

    4. 19
      Relationships

      Relational databases get their name from relationships between tables.

    5. 20
      One-to-One Relationship

      A 1:1 relationship means each row in table A maps to exactly one row in table B.

    6. 21
      One-to-Many Relationship

      1:N is the most common relationship — one parent row has many children.

    7. 22
      Many-to-Many Relationship

      M:N means each row in A can relate to many in B and vice-versa.

    8. 23
      Normalization

      Normalization is the process of organizing data to remove redundancy and dependency anomalies.

    9. 24
      Denormalization

      Denormalization deliberately introduces redundancy to make reads cheaper.

    10. 25
      ER Diagrams

      Entity-Relationship (ER) diagrams visually show entities, attributes and relationships before any SQL is written.

    Advanced SQL Queries

    0/10 complete
    1. 26
      Aggregate Functions

      Aggregate functions collapse many rows into one summary value: COUNT, SUM, AVG, MIN, MAX.

    2. 27
      GROUP BY

      GROUP BY partitions rows into groups so aggregates apply per group.

    3. 28
      HAVING Clause

      HAVING filters groups, not rows.

    4. 29
      Subqueries

      A subquery is a SELECT inside another SQL statement.

    5. 30
      Nested Queries

      Beyond simple subqueries, nested queries can be many levels deep — answering complex business questions in one statement.

    6. 31
      CASE Statements

      CASE is SQL's if/else.

    7. 32
      Window Functions

      Window functions compute a value across a set of rows related to the current row, without collapsing them.

    8. 33
      Common Table Expressions (CTE)

      A CTE (WITH … AS (…)) is a named, in-query temporary result.

    9. 34
      Views

      A view is a stored named query — it behaves like a virtual table.

    10. 35
      Stored Procedures

      A stored procedure is a named block of SQL/PLpgSQL/T-SQL stored in the DB.

    Joins & Relationships

    0/10 complete
    1. 36
      INNER JOIN

      INNER JOIN returns rows where the join condition matches in both tables.

    2. 37
      LEFT JOIN

      LEFT JOIN returns all rows from the left table, plus matching rows from the right (NULL where none match).

    3. 38
      RIGHT JOIN

      RIGHT JOIN is the mirror of LEFT JOIN — it keeps all rows from the right table.

    4. 39
      FULL OUTER JOIN

      FULL OUTER JOIN keeps unmatched rows from both sides.

    5. 40
      SELF JOIN

      A self join joins a table to itself.

    6. 41
      CROSS JOIN

      CROSS JOIN returns the Cartesian product of two tables — every combination of A × B.

    7. 42
      Multi-Table Queries

      Real apps regularly join 4–8 tables in one query — orders, users, products, line items, addresses, payments.

    8. 43
      Join Optimization

      Joins are where queries live or die.

    9. 44
      Relationship Queries

      Relationship queries answer 'who is connected to whom' — friend-of-friend, customers who bought X also bought Y, manager → reports.

    10. 45
      Real-World Join Scenarios

      Real production join queries combine all you've learned: filters, multiple joins, aggregates, CTEs and indexes.

    Performance Optimization

    0/10 complete
    1. 46
      Query Optimization

      Query optimization turns slow queries into fast ones.

    2. 47
      Indexing Basics

      An index is a data structure (usually a B-tree) that lets the DB jump to rows by column value in O(log n) instead of O(n).

    3. 48
      Composite Indexes

      A composite index covers multiple columns.

    4. 49
      Execution Plans

      An execution plan is the optimizer's chosen recipe to run your query.

    5. 50
      Query Performance Analysis

      Performance work is methodical: find slow queries, understand their plan, fix with indexes/rewrites, verify with measurements.

    6. 51
      Database Caching

      Caching avoids hitting the DB.

    7. 52
      Partitioning

      Partitioning splits a giant table into smaller physical pieces — by range (date), list (region) or hash (user_id).

    8. 53
      Scaling Databases

      When one DB box isn't enough, scale via vertical (bigger box), read replicas (copies for reads), sharding (split by key), and caching.

    9. 54
      SQL Optimization Best Practices

      A consolidated checklist used by senior engineers to keep databases fast — at small and large scale.

    10. 55
      Production Query Tuning

      Tuning live queries safely takes process: capture, reproduce on a copy, fix, ship behind a feature flag, measure.

    Transactions & Security

    0/10 complete
    1. 56
      Transactions

      A transaction is a group of SQL statements that either all succeed or all fail — atomically.

    2. 57
      ACID Properties

      ACID — Atomicity, Consistency, Isolation, Durability — is the contract a relational DB makes.

    3. 58
      COMMIT & ROLLBACK

      COMMIT finalizes a transaction; ROLLBACK undoes it.

    4. 59
      Isolation Levels

      Transactions running concurrently can see each other's partial work — unless prevented by an isolation level.

    5. 60
      Locks & Concurrency

      Locks serialize concurrent access to rows/tables to keep data consistent.

    6. 61
      SQL Injection

      SQL Injection happens when user input is concatenated into SQL strings — letting attackers run their own queries.

    7. 62
      Database Security

      Beyond SQL injection: least privilege, encryption, audit, network isolation, secrets management.

    8. 63
      User Roles & Permissions

      Databases support fine-grained roles, users, GRANTs and REVOKEs.

    9. 64
      Backup & Recovery

      Backups save your business when something goes wrong — accidental DROP, ransomware, hardware failure.

    10. 65
      Production Security Practices

      A consolidated security checklist for production DBs — every box must be checked before any sensitive workload goes live.

    Real-World SQL Engineering

    0/10 complete
    1. 66
      E-Commerce Database

      An e-commerce DB is the canonical project to learn relational design — users, products, carts, orders, line items, payments, reviews.

    2. 67
      Banking Database System

      Banking schemas demand strict ACID, double-entry ledgers, immutable history and audit logs.

    3. 68
      Analytics Dashboard Queries

      Dashboards need fast aggregates over big tables — DAU/MAU, revenue, retention, funnels.

    4. 69
      User Authentication Database

      Auth schemas store users, passwords (hashed!), sessions, tokens, MFA.

    5. 70
      Inventory Management System

      Inventory schemas track stock, movements, warehouses with strong consistency to avoid overselling.

    6. 71
      SaaS Multi-Tenant Database

      SaaS apps store many tenants' data in one DB.

    7. 72
      Reporting Systems

      Reporting workloads are read-heavy, scan-large, and run by humans on demand.

    8. 73
      Data Warehousing Basics

      A data warehouse is a separate analytics-optimized DB — star schema, columnar storage, MPP.

    9. 74
      Real Production Database Design

      Production schemas evolve with the business.

    10. 75
      Enterprise SQL Architecture

      At enterprise scale, SQL lives inside a wider data platform: OLTP DBs, replicas, ETL, warehouse, lakehouse, BI, governance, lineage.

    Practice & Interview Preparation

    0/10 complete
    1. 76
      SQL Exercises

      Theory only sticks once you've solved real problems.

    2. 77
      Query Challenges

      Harder query challenges that test creative SQL — recursive CTEs, gaps & islands, sessionization, percentiles.

    3. 78
      Database Design Challenges

      Design rounds test your ability to model real systems.

    4. 79
      Query Optimization Tasks

      Practical tuning tasks — given a slow query, make it fast.

    5. 80
      SQL Debugging Exercises

      Bug-hunting practice: queries that look right but return wrong data.

    6. 81
      SQL Interview Questions

      A curated, reusable bank of SQL interview questions covering fundamentals to advanced — exactly what FAANG, fintech and SaaS hiring managers ask.

    7. 82
      Mock SQL Projects

      Project-style exercises that mirror real work: build the schema, write the queries, optimize, and present trade-offs.

    8. 83
      Real-World Case Studies

      Lessons from real production incidents and migrations: GitLab's 2017 backup loss, Stripe's MongoDB→Postgres trade-offs, Shopify's MySQL sharding (Vitess).

    9. 84
      Database Engineering Challenges

      Open-ended scenarios that test full engineering judgement: scale a slow service, recover from corruption, migrate without downtime, design for compliance.

    10. 85
      Enterprise SQL Scenarios

      Capstone scenarios combining everything — design + scale + security + ops.