
An introduction to the course. Topics covered. Who the target audience is.
We need to set up PostGreSQL
This section is concerned with installing PostGreSQL and setting up datasets for this course.
Learning Goal: Understand the foundational mechanics of requesting and retrieving data.
This section introduces the core building blocks of database interaction. Students will learn how to formulate precise questions to extract specific information from a single dataset, reorder the results for readability, and establish the structural logic that underpins all future data analysis tasks.
Learning Goal: Manage data inconsistencies and missing information gracefully to ensure accurate reporting.
Real-world data is rarely perfect or uniform. In this module, students will learn how to translate data from one format to another (such as converting text into calculable numbers). Furthermore, they will explore strategies for identifying, substituting, and performing calculations around missing or blank data points without breaking their queries or skewing their final results.
Learning Goal: Perform flexible, dynamic searches to categorize and analyze unstructured data.
Students will move beyond requiring exact, word-for-word matches to uncover hidden data. This section focuses on using wildcards and logical expressions to search for specific textual patterns, partial words, or specific numerical ranges. This allows for much more robust, forgiving, and exploratory data analysi
Learning Goal: Summarize complex, massive datasets to extract high-level business insights.
Building on basic retrieval, this section shifts the focus from looking at individual rows to analyzing data in bulk. Students will learn how to group raw records into meaningful categories, apply mathematical summaries (like totals or averages), and implement complex, multi-layered filtering rules to those summarized groups to generate high-level metrics.
Learning Goal: Analyze time-series data, calculate durations, and uncover chronological trends.
Time is a critical dimension in almost every business dataset. Students will learn the unique rules for managing temporal data. The focus will be on manipulating timestamps, calculating the time elapsed between events, extracting specific calendar components (like finding all data from the "third quarter"), and accurately filtering records based on dynamic, rolling time windows.
Learning Goal: Connect disparate datasets to reconstruct comprehensive records across a relational database.
Databases store data in separate, organized tables to maintain efficiency. In this module, students will learn how to stitch these tables back together horizontally. They will explore different relationship types to understand how to blend data when direct matches exist, how to prioritize data from one table over another, and how to safely handle missing relationships without dropping vital information.
Learning Goal: Combine, compare, and isolate lists of data using vertical stacking and mathematical set theory.
Unlike joins which expand datasets horizontally, set operations teach students how to manipulate datasets vertically. Students will learn how to merge similar data streams into unified master lists, identify the exact overlap or common denominators between distinct groups, and isolate unique records by subtracting one data list from another.
Learning Goal: Manage the full lifecycle of data by learning to safely create, modify, and remove database records.
Databases are not static; they must constantly adapt to real-world changes. This section shifts focus from merely viewing data to actively managing it. Students will learn the protocols for safely introducing new data into a system, updating existing records to maintain accuracy, and permanently or systematically deleting outdated information while maintaining data integrity.
Learning Goal: Solve complex, multi-step data problems by nesting queries inside one another.
Real-world questions often require an answer to a preliminary question before the main question can be solved. This section teaches students how to break down complex problems into logical layers by embedding queries within other statements. Students will learn how to use the dynamic output of an inner query to feed, filter, or dictate the behavior of an outer query.
Learning Goal: Write highly readable, modular, and maintainable code for advanced data analysis.
As queries grow in complexity, they can become difficult to read and troubleshoot. This module introduces Common Table Expressions as a tool to create temporary, named result sets that act like virtual stepping stones. Students will learn how to break massive, tangled queries into clean, sequential blocks of code, improving both their development speed and the readability of their scripts for other team members.
Learning Goal: Abstract complex queries into reusable components and balance real-time data accuracy with analytical performance.
In this module, students will learn how to encapsulate massive, complex queries into simple, reusable virtual tables known as views. This allows developers to hide underlying database complexity and secure sensitive information without duplicating data. Students will then explore how to optimize performance with materialized views, learning when it is necessary to physically save pre-computed results to disk to drastically speed up dashboards and heavy analytical reports, while navigating the strategic trade-offs between processing speed and data staleness.
Learning Goal: Transition from writing single, static queries to developing logic-driven database programs that automate workflows and enforce business rules.
This section bridges the gap between standard SQL data management and full-fledged programming. Students will learn how to introduce procedural logic—such as variables, conditional statements (like IF/THEN), and iterative loops—directly into the database engine. By laying this programmatic foundation, students will be prepared to bundle complex, multi-step operations into reusable stored procedures and automated event triggers, empowering the database to actively manage and react to data changes on its own.
Learning Goal: Encapsulate complex business workflows and database operations into secure, high-performing, and reusable routines.
Building on foundational programming concepts, this section focuses on saving pre-compiled collections of database commands for repeated use. Students will learn how to transition from executing redundant, manual scripts to calling centralized routines that accept dynamic inputs. The module emphasizes improving overall system performance, reducing network traffic, and enhancing database security by granting applications controlled access to data through structured, easily maintainable code blocks.
Learning Goal: Protect data integrity and maintain system stability by proactively anticipating and managing database errors.
In this module, students will learn how to build safety nets directly into their database scripts. Instead of allowing unexpected errors to crash an application or leave data partially updated, students will explore how to intercept these issues in real-time. The focus will be on gracefully handling failures, undoing incomplete transactions to maintain absolute data accuracy, and capturing detailed, user-friendly error logs to aid in troubleshooting and system maintenance.
Course Overview
Whether you are building application backends or hunting for business insights, data is the lifeblood of modern technology. SQL (Structured Query Language) is the universal language used to communicate with that data.
With the explosive growth of Generative AI, many ask if learning SQL is still necessary. The answer is an absolute yes. AI understands syntax, but it does not understand your company's highly specific, undocumented business logic, nor will companies allow autonomous AI to execute potentially destructive database commands without strict human oversight. You have to know the data intimately to architect the solution.
This course is designed to take you from the absolute basics of database interaction all the way to advanced database programming and administration using PostgreSQL—the 100% free, incredibly robust, and industry-standard relational database system.
What You Will Learn
This curriculum is broken down into five core learning pillars, designed to build your skills sequentially:
Pillar 1: System Setup and Foundations: You will start by installing the PostgreSQL engine and the pgAdmin 4 interface. From there, you will learn the core mechanics of retrieving data and managing the lifecycle of your records through data creation, modification, and deletion (CRUD Operations).
Pillar 2: Data Wrangling and Cleaning: Real-world data is notoriously messy. You will learn how to handle missing information gracefully, dissect and standardize unstructured text using Regular Expressions, and accurately manipulate complex chronological timestamps.
Pillar 3: Relational Architecture and Modular Code: You will learn how to stitch disparate tables together using Joins and Set Operations. As your questions become more complex, you will learn to break your logic down into readable, step-by-step blocks using Sub-queries, Common Table Expressions (CTEs), and Views.
Pillar 4: Advanced Analytics: Moving beyond basic retrieval, you will learn how to summarize massive datasets. Using advanced filtering, aggregation, and Window Functions, you will learn how to rank data, calculate rolling averages, and compare individual records against high-level metrics simultaneously.
Pillar 5: Database Programming and System Reliability: In the final phase, you will transition from writing static queries to programming the database itself. You will learn PL/pgSQL to build Stored Procedures and automated Triggers, and protect your database from catastrophic failures using ACID-compliant Transactions and Exception Handling.
The Capstone Project: MobiFinance Risk Model
At the end of the course, you will take the training wheels off in a self-guided sandbox challenge. You will step into the role of a Data Analyst for MobiFinance, a global fintech startup that provides smartphone financing.
The Data Science team needs your help predicting whether customers will successfully pay off their second phone loan based on the behavioral patterns they exhibited during their first loan.
Using a synthetic, real-world dataset of thousands of loans and payments, you will be tasked with building a single, master SQL script that transforms raw, messy logs into a clean, aggregated "Risk Profile" dataset. You will have to utilize your entire toolkit to succeed, including:
Relational Joins to connect the overarching loan data with granular, day-to-day payment logs.
Data Wrangling to convert raw Unix timestamps into workable dates.
CTEs to neatly separate first loans from second loans.
Window Functions to find the absolute longest stretch of time a user went without making a payment.