Notes — Module 01: Introduction to PostgreSQL¶
These are your personal study notes. Write freely and honestly. Incomplete notes are fine — they show where your understanding still needs work. Return to this file to add insights as they develop over time.
Module: [[modules/01_introduction]] Topic: [[postgresql]] Date started: Fill in when you start Status: Not started
Concept Map¶
Sketch how the concepts in this module relate to each other.
mindmap
root((PostgreSQL Intro))
Relational Model
Relations / Tables
Tuples / Rows
Attributes / Columns
Primary Keys
psql Client
Meta-commands
SQL statements
Database navigation
Data Types
TEXT vs VARCHAR
TIMESTAMPTZ
NUMERIC
BOOLEAN
CRUD Operations
INSERT
SELECT with WHERE
UPDATE with WHERE
DELETE with WHERE
Alternative: draw this on paper, photo it, and link the image here.
Key Insights¶
The "aha moments" — the things that, once understood, made the rest clear.
- Fill in as you study
- Fill in as you study
My Understanding¶
Explain the core concepts in your own words, as if teaching them to someone else.
The Relational Model¶
Your explanation here
What I'm still unsure about: Fill in
Why SQL is Declarative¶
Your explanation here
What I'm still unsure about: Fill in
NULL Behavior¶
Your explanation here
Connections to Other Topics¶
| This module's concept | Connects to | How |
|---|---|---|
| SQL query language | [[django-fastapi-flask]] | Django ORM generates SQL; understanding it helps debug ORM behavior |
| Data types | [[async-python]] | asyncpg maps Postgres types to Python types |
| Schema design basics | [[systems-architecture]] | Database schema is part of overall system architecture |
Questions That Arose¶
Log questions as they appear. Don't stop to answer them now — just capture them.
- Add questions here as you study
Code Snippets Worth Remembering¶
Template for Creating a Table¶
CREATE TABLE entity_name (
id BIGSERIAL PRIMARY KEY,
name TEXT NOT NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
Why I'm saving this: good starting point for any new table
Safe Update / Delete Pattern¶
-- Always test with SELECT first using the same WHERE clause
SELECT * FROM table WHERE condition;
-- If the results look right, run the UPDATE or DELETE
UPDATE table SET column = value WHERE condition;
Why I'm saving this: prevents accidental full-table updates
What Tripped Me Up¶
Mistakes I made, misconceptions I had, things that confused me more than they should have.
- Fill in as you study
Summary in My Own Words¶
Write a 3–5 sentence summary of this entire module without looking at any notes.
Fill in after completing the module.
Last updated: Fill in date