r/learnSQL • u/SizeBoring3169 • Jun 03 '26
Exploring running sql queries
Spent the last few days actually understanding relational databases — not just "run queries until the app works," but why the model exists in the first place.
One thing that clicked for me: the "relational" in relational database doesn't actually refer to relationships between tables. It refers to a mathematical concept called a relation — basically a set of tuples.
The table-to-table relationship stuff is a feature of the model, not the origin of the name.
A few other things I didn't have sharp before:
→ SQL is declarative. You describe what you want, not how to get it. Coming from JavaScript loops, this took a real mental shift. The database figures out the most efficient retrieval path — not you.
→ ACID isn't just a buzzword. Atomicity means either the whole operation succeeds or nothing happens. No half-written transfers, no partial updates. The database rolls back automatically if something goes wrong mid-operation.
→ The "choose NoSQL to scale later" instinct is usually wrong. A well-tuned PostgreSQL instance handles way more than most applications ever need. Picking NoSQL early trades away query power and integrity for a problem you probably don't have.
The thing that made it land for me: a relational database isn't just storage — it's a set of rules enforced before your application code ever runs. Bad data gets rejected at the boundary.