Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I use 0/1 or True/False boolean? [duplicate]

0/1 can be flexible and can add options such as "2, 3, 4" in the future.

Does TINYINT in MySQL take up more space than boolean?

Personally, I use 0 and 1 for everything.

You can answer this question in the context of regular programming (or MySQL, whichever you like).

like image 296
TIMEX Avatar asked Oct 19 '25 15:10

TIMEX


1 Answers

Any good database system worth its salt will convert boolean to and from something appropriate for the database, and using an actual boolean type makes programming against it much nicer.

like image 128
Robert Harvey Avatar answered Oct 21 '25 04:10

Robert Harvey