Skip to main content
Formatting.
Source Link
MDCCL
  • 8.5k
  • 3
  • 32
  • 65

How is tinyintTINYINT(1) converted to BOOL/BOOLEAN?

I can understand that if you updateUPDATE a tinyint(1)TINYINT(1) column in a database and pass a value of 11 or 00 it will convert it to trueTRUE or falseFALSE, respectively. 

I'm just confused on what happens when you updateUPDATE the column with a different numbervalue, say 22. In other words, if you updateUPDATE a tinyint(1)TINYINT(1) column with the value 22, will this be trueTRUE or falseFALSE? Or, is this even doable?

How is tinyint(1) converted?

I can understand that if you update a tinyint(1) column in a database and pass a value of 1 or 0 it will convert it to true or false, respectively. I'm just confused on what happens when you update the column with a different number, say 2. In other words, if you update a tinyint(1) column with the value 2, will this be true or false? Or is this even doable?

How is TINYINT(1) converted to BOOL/BOOLEAN?

I can understand that if you UPDATE a TINYINT(1) column and pass a value of 1 or 0 it will convert it to TRUE or FALSE, respectively. 

I'm just confused on what happens when you UPDATE the column with a different value, say 2. In other words, if you UPDATE a TINYINT(1) column with the value 2, will this be TRUE or FALSE? Or, is this even doable?

Source Link
Alex Diaz
  • 23
  • 1
  • 1
  • 3

How is tinyint(1) converted?

I can understand that if you update a tinyint(1) column in a database and pass a value of 1 or 0 it will convert it to true or false, respectively. I'm just confused on what happens when you update the column with a different number, say 2. In other words, if you update a tinyint(1) column with the value 2, will this be true or false? Or is this even doable?