Hacker News new | past | comments | ask | show | jobs | submit login

> Most relational database management systems do not support nested records, so tables are in first normal form by default. In particular, SQL does not have any facilities for creating or exploiting nested tables. [0]

“Not with that attitude.”

– frectonz

[0]: https://en.wikipedia.org/wiki/First_normal_form






Your link already points out that this isn't followed anymore since Json has been added as a default SQL feature

No? It says that SQL99 allows non-atomic types, and SQL16 allows JSON. That doesn’t mean that 1NF is dead, or even that JSON is allowed in 1NF, only that the standard (which RDBMS providers may choose to implement in part or whole) allows for their existence.

Atomicity of values has been debated for a long time. I’ve come around to the idea that flat arrays can be included in a 1NF table, because they don’t imply any additional structure to the schema. The problem with JSON is that it supports arbitrary K:V pairs as well as nesting, and so can introduce a schema within a schema, which is prone to referential integrity violations (not to mention generally poor performance in RDBMS).

Embedding an entire DB is of course beyond the pale, and my comment was an attempt at wit.


Allowing Json means that you're able to store any amount of data, this means you can effectively store full tables (plural!) in a single cell

I.e. { entities: {1: { id:1, name: "abc"}, 2: ... }




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: