4 ms·
> What are good schema examples? Anything that doesn't break the first normal form("1NF")[1]. > And what are some poor examples? Anything that breaks 1NF. Y
by iblaine 7y ago
> What are good schema examples?
Anything that doesn't break the first normal form("1NF")[1].
> And what are some poor examples?
Anything that breaks 1NF.
You break 1NF when...
* a column cannot be described by the key, ex. user.id describes user.name but not user.items_purchased.
* values in a column are repeated, ex. a user table that stores multiple addresses for the same user should be split into an addresses table.
Treat tables as classes and you'll be fine. Just like a method may not belong in a class, a column may not belong in a table.
[1](https://en.wikipedia.org/wiki/First_normal_form https://en.wikipedia.org/wiki/First_normal_form)
- iblaine 7y agos/1NF/3NF/g ...point here is that data good design comes from objects in 3NF...1NF is a good start, 3NF would be better...