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.

founded 1 year ago
MODERATORS
286
submitted 1 year ago* (last edited 1 year ago) by [email protected] to c/[email protected]
 

Jesus died at 33, so that can't get returned in the query response lol

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 16 points 1 year ago (1 children)

Realistically you wouldn't store age, you'd store birthdate or possibly a datetime value, and calculate it from there

[–] [email protected] 6 points 1 year ago

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.