Files
second-brain/knowledge/skills/sql.md
T
kiskaadee bd069cc275 docs(knowledge): reorganize knowledge base and add new guides
Restructure the knowledge/ directory by sorting guides into
domain-specific subdirectories to improve vault organization and
scannability:

- devenv/: environments and shell configurations
- dsa/: data structures and algorithms (hashmaps)
- python/: language features (enumerate, zip)
- tools/: containerization and utilities (docker, tmux)
- skills/: backend competencies (auth, sql, testing, and new pydantic
  guide)

Update relative links in SKILLS.md and knowledge guides to track
unpacking and, track Obsidian vault configurations.
2026-07-09 03:10:40 -05:00

920 B

SQL & Relational Databases Notes

ACID Properties

  • Atomicity: All operations in a transaction succeed or all fail.
  • Consistency: Database transitions from one valid state to another.
  • Isolation: Concurrent transactions don't interfere with each other.
  • Durability: Once committed, changes survive system failures.

Indexes

  • An index speeds up data retrieval operations (SELECT) at the cost of slower writes (INSERT, UPDATE, DELETE) and extra storage.
  • When to use: Columns frequently queried in WHERE clauses, JOIN keys.
  • When NOT to use: Columns with low cardinality (e.g. booleans), tables with very few rows, columns frequently updated.

Joins

  • INNER JOIN: Returns records with matching values in both tables.
  • LEFT JOIN (or LEFT OUTER JOIN): Returns all records from the left table, and matching records from the right. If no match, right-side columns are NULL.