4 ms·
Wikipedia is imprecise in this passage. First normal form is defined in terms of domains, not values. Domains is basically the data type of a column. So the que
by goto11 5y ago
Wikipedia is imprecise in this passage. First normal form is defined in terms of domains, not values. Domains is basically the data type of a column. So the question is what the type of the column is.
If the column type is string (or VARCHAR as in SQL) then it is not in violation of 1NF, since a string/varchar is not a relation, it is atomic with regards to the relational operators. Packing multiple conceptual values into a single string is probably not a great idea, but the issue is unrelated to the 1NF.
If the database allowed nested tables, then a phone number field could contain a table where each row were an individual phone number. But this would be in violation of 1NF.
- CRConrad 5y agoLogical, not physical, someone said: https://news.ycombinator.com/item?id=27569106 https://news.ycombinator.com/item?id=27569106 String is physical implementation. Logically, the domain is telephone number.
- goto11 5y agoRelations, attributes, and domains all exist on the logical level. The relational model deliberately does not say anything about the physical level. Domains are the data types of columns. If a column has the type VARCHAR, then the domain is varchars. If a column has the type "phone number", then the domain is phone numbers. They exist on the same level. If the database does not support user defined domains, then you can be forced to store phone numbers as varchars rather than use a phone number type. But then the domain is varchar, not phone number.