again, this qn was from the practice qns in the mysql certification guide book ...
QUESTION
Here's the structure of a table typetest with three columns (number, string, and dates). As- sume the server is running in MySQL's “forgiving” SQL mode. mysql> DESCRIBE typetest; +--------+---------------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +--------+---------------------+------+-----+---------+-------+ | number | tinyint(3) unsigned | YES | | NULL | | +--------+---------------------+------+-----+---------+-------+ You perform the following INSERT operation on table typetest: INSERT INTO typetest VALUES (1000,'yoodoo','999-12-31'); What data values will actually be stored in the table? Provide a short explanation.
ANSWER
+--------+--------+------------+ | number | string | dates | +--------+--------+------------+ | 255 | yoodo | 0000-00-00 | +--------+--------+------------+ The inserted number 1000 is too big to fit in the TINYINT UNSIGNED column, so the highest pos- sible value (255) is inserted. 'yoodoo' is too long for a CHAR(5) column and is thus truncated to five characters. '999-12-31' is a date that is earlier than the earliest possible DATE value ('1000-01-01'). This is interpreted as an invalid date, so the “zero” date is stored.
when i tried inserting '999-12-31' into a date i get 0999-12-31. i read some where in the certification guide that mysql may be able to insert dates out of the range 1000-01-01 to 9999-12-31. but in the exam what do i answer?