TINYINT(size) A very small integer. Signed range is from -128 to 127. Unsigned range is from 0 to 255. The size parameter specifies the maximum display width (which is 255)
Does this mean that if I delcare the following: TINYINT(4) unsigned,
It can only store data if it is a number between 0 to 4; or
It can only store data that consists of 4 digits (0 to 9999)
I suspect it is the latter, so if that is the case, would making is signed (which I believe is the default) would then allow for a range from -9999 to 9999?
I think ChatGPT has now given me the required answer:
Therefore, a TINYINT(4) in SQL can still store values between -128 and 127 for a signed TINYINT, or 0 and 255 for an unsigned TINYINT, just like a regular TINYINT data type. The “(4)” only specifies how many digits should be displayed when the data is retrieved, and has no impact on the maximum value that can be stored.