PostgreSQL · Beginner

PostgreSQL Fundamentals

Learn PostgreSQL, the advanced open-source database trusted by banks, fintechs and fast-growing startups. Design tables, write powerful SQL, use JSON and full-text search, tune queries with indexes, secure data with roles, and connect it to real applications.

Units
4
Lessons
20
Practice questions
86
Minutes
~300

Start learning today

Try every course free for 7 days. After that, this course is in Learnix Pro (KES 699/month).

Create free account Log in

What you'll learn

Install PostgreSQL and work in psql and pgAdmin

Design tables with the right data types and constraints

Write joins, aggregates, CTEs and window functions

Store and query JSON with jsonb

Speed up queries with indexes and EXPLAIN

Protect data with transactions, roles and backups

Connect PostgreSQL to Python, PHP and Django apps

How the lessons work

Clear explanations

Step-by-step lessons in plain language

23 in this course

Worked examples

Real code and examples you can copy and run

21 in this course

Quick checks

Test your understanding as you go

60 in this course

Fill the blank

Recall the key commands and syntax

20 in this course

Hands-on workspace

A practical task at the end of every lesson

20 in this course

Syllabus

  1. 1.1

    Why PostgreSQL?

    What PostgreSQL is, why companies choose it, and how it compares with MySQL and NoSQL databases.

  2. 1.2

    Installing PostgreSQL, psql & pgAdmin

    Install PostgreSQL on your computer (or use a free cloud database), connect with psql and pgAdmin, and create your first database.

  3. 1.3

    Creating Tables & Choosing Data Types

    Pick the right PostgreSQL types (identity, text, numeric, timestamptz, boolean, uuid) so your data stays accurate.

  4. 1.4

    Insert, Select, Update, Delete & RETURNING

    The four everyday commands, plus PostgreSQL's RETURNING clause and upserts with ON CONFLICT.

  5. 1.5

    Filtering, Sorting & Pagination

    WHERE with AND/OR, IN, BETWEEN, ILIKE and NULL handling, ORDER BY and LIMIT/OFFSET pagination.

  1. 2.1

    Keys & Constraints: Let the Database Enforce the Rules

    Primary and foreign keys, UNIQUE, CHECK and NOT NULL, plus ON DELETE behaviour.

  2. 2.2

    Joining Tables

    INNER, LEFT and multi-table joins to answer questions that span customers, orders, items and products.

  3. 2.3

    Aggregates, GROUP BY & HAVING

    Totals, counts and averages per group, filtered with HAVING, plus PostgreSQL extras like FILTER and string_agg.

  4. 2.4

    Subqueries & CTEs (WITH)

    Break complex questions into readable steps with subqueries and common table expressions, including recursive CTEs.

  5. 2.5

    Window Functions

    Rankings, running totals and comparisons with previous rows, without collapsing rows.

  1. 3.1

    JSON in PostgreSQL with jsonb

    Store flexible attributes in jsonb columns, query them with -> and ->> and @>, and index them with GIN.

  2. 3.2

    Arrays, Enums & Generated Columns

    Use PostgreSQL array columns, enum types and generated columns for cleaner schemas, and know when not to.

  3. 3.3

    Full-Text Search

    Build fast, relevance-ranked search with tsvector, tsquery and GIN indexes, no extra search server needed.

  4. 3.4

    Indexes & EXPLAIN ANALYZE

    Find out why a query is slow and fix it with the right index: B-tree, composite, partial and expression indexes.

  5. 3.5

    Transactions, Isolation & Locking

    Group changes so they all succeed or all fail, understand MVCC, and avoid double-spending with row locks.

  1. 4.1

    Views, Functions & Triggers

    Save queries as views, write SQL and PL/pgSQL functions, and keep data consistent automatically with triggers.

  2. 4.2

    Roles, Permissions & Row-Level Security

    Give each app and person only the access they need, and enforce per-user data access inside the database with RLS.

  3. 4.3

    Backups, Restores & Maintenance

    Back up with pg_dump, restore with pg_restore, automate it, and keep the database healthy with VACUUM and monitoring.

  4. 4.4

    Connecting PostgreSQL to Your Apps

    Use PostgreSQL from Python (psycopg), PHP/Laravel and Django safely, with parameterised queries and connection pooling.

  5. 4.5

    Project: A Mobile-Money Wallet Ledger

    Design and build a double-entry wallet ledger in PostgreSQL: accounts, transfers, balances and audit, the core of every fintech.

Earn a verifiable certificate

Finish every lesson and pass the 20-question final exam (70% to pass). Each certificate has a unique number anyone can check online.

Get started

Helping with:

🍪 We use essential cookies to keep you signed in, protect your account and remember your settings. We don't use advertising or tracking cookies. Read our Privacy Policy.