News for hackers. Stuff that matters.
Re:What does First Normal Form mean? by dragonwriter on Friday June 18, 2021 @06:50PM (#27555875)
Dates are natural keys in a calendar table. The composite of the foreign key values is a natural key in a join table expressing a unique relationship between entities in two or more other tables, perhaps with additional attributes, even if those values are surrogate keys in their own tables.
Re:What does First Normal Form mean? by jameshart on Saturday June 19, 2021 @11:08AM (#27561098)
Dates aren’t natural. I know of at least three different date keys in different calendars that refer to the same calendar day - choosing to use one particular date standard to refer to days is choosing a pre-existing synthetic key, not a ‘natural’ one.
Re:What does First Normal Form mean? by dragonwriter on Sunday June 20, 2021 @10:51AM (#27570578)
> I know of at least three different date keys in different calendars that refer to the same calendar day

Aside from the fact that you have very limited knowledge of calebdar systems, I’m not sure what this is supposed to prove. “Natural” in “natural key” doesn't mean “exists in nature outside of human invention”, it means “exists outside the database as part of the data in the data model, rather than being created solely to have a ubique key in the database ubder design".

The date in whatever particular calendar system is used in the data model is a natural key for a calendar table.

Re:What does First Normal Form mean? by mulmen on Saturday June 19, 2021 @03:42PM (#27563745)
Dates are natural keys.

You seem to be conflating format and value. 1,234,567 and 1234567 are the same number. 19-Jun-21 and 2021-06-19 are the same date. Databases already handle this.

Re:What does First Normal Form mean? by jameshart on Saturday June 19, 2021 @04:36PM (#27564243)
19 June 2021 is also known as:

Dhuʻl-Qiʻdah 9, 1442 AH

9 Tamuz 5781

Re:What does First Normal Form mean? by mulmen on Saturday June 19, 2021 @04:41PM (#27564284)
Great! Then if they are unambiguous they can be inserted directly or disambiguated and then inserted. At query time any format can be used to represent them to a user.
Re:What does First Normal Form mean? by jameshart on Saturday June 19, 2021 @04:54PM (#27564382)
Ah, so you're suggesting instead of storing 'what a person calls this date' as the key, you instead convert it to some underlying representation that you can then choose to present in different calendars - like a UNIX epoch-relative offset or something.

Congratulations, you just created another synthetic key for describing dates.

Re:What does First Normal Form mean? by goto11 on Monday June 21, 2021 @03:51AM (#27577164)
That is not what synthetic key means. A synthetic key is a key which does not carry any information, like an auto-incremented integer. A date is a natural key, regardless of the underlying representation.
Re:What does First Normal Form mean? by mulmen on Saturday June 19, 2021 @05:24PM (#27564586)
The date is a natural key. The format string is only a representation. Implementation details are irrelevant to the definition of a natural key.