Files
kiskaadee 8a59b093b8
Brain Structural Validation / Validate Markdown Structure & Links (push) Failing after 8s
infra(validator): add DirectoryContract validation and migration manifest
2026-09-28 15:58:11 -05:00

23 lines
989 B
Markdown

---
type: knowledge
status: draft
topics: ['sql', 'postgresql']
---
# 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.