this post was submitted on 26 Oct 2023
286 points (96.4% liked)
SQL - any and all
305 readers
1 users here now
For discussion about SQL and databases. All versions welcome.
- MSSQL
- PostgreSQL
- MariaDB
- SQLite
- etc...
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Realistically you wouldn't store age, you'd store birthdate or possibly a datetime value, and calculate it from there
First Normal Form users unite!
By the by, as someone who have used both NoSQL and SQL extensively (once in the same project), the trick of NoSQL is that you shouldn’t use FNF and compute that at write time. The idea is that it’s faster to MapReduce pre calculated values since that’s the operation you want to optimize in a NoSQL world. A lot of people get that wrong and just replace MySQL with Mongo without rethinking usage and schemas.
But even in a NoSQL context I’d rather use a Postgres jsonb column over MongoDB.