Another fun one -- there are many columns defined as follows:
`checked_out_time` datetime NOT NULL default '0000-00-00 00:00:00',
Two problems here:
- 1. DATETIME is not a part of standard SQL; SQL92 defines DATE, TIME, and TIMESTAMP. TIMESTAMP in MySQL is a special column that automatically inserts the current date and time when a row is inserted, which explains why they use DATETIME instead. Most other databases use special registers to request a special value, such as CURRENT TIMESTAMP.
- 2. Second problem is that TIMESTAMP's string signature of YYYY-MM-DD hh:mm:ss should not accept all zeros -- what date and time is pure zeros? And in the context of the application, this special value does not actually help the data; a NULL value would be just as useful in identifying rows without a timestamp.