A
A
Andrey Filippov2016-03-15 15:11:39
PHP
Andrey Filippov, 2016-03-15 15:11:39

How to choose a data type to store the year of publication of a book?

There is a table with books, for each book it should be possible to indicate the year in which the book was written. In the future, this field will be searched for (books written in such and such a year). The problem is that the date may be just a year, it may be a century, or it may not be at all (the year of writing is unknown). What data type is better to choose for storing the year of publication / writing? Thanks

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Evgeny Akhmetov, 2016-03-15
@andrysha-dev

Probably 2 fields are best for this, in one value, in the second unit of measurement (year, century, millennium, etc.), the search will be more complicated, but any filters can be done.

S
SSS 010101, 2016-03-15
@sanabek

Text? What was the same. And not either Roman or Arabic (for filtering).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question