BOOLEAN or TINYINT confusion

前端 未结 5 711
面向向阳花
面向向阳花 2020-12-07 14:47

I was designing a database for a site where I need to use a boolean datetype to store only 2 states, true or false. I am using MySQL.
While designing the database using

5条回答
  •  萌比男神i
    2020-12-07 15:10

    The numeric type overview for MySQL states: BOOL, BOOLEAN: These types are synonyms for TINYINT(1). A value of zero is considered false. Nonzero values are considered true.

    See here: https://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html

提交回复
热议问题