Example: tinyint (1) description: I understand that the maximum positive number of the Tinyint type is 255. What I don't understand is the purpose of setting 1 here. In fact, even if the length is set to 1, you can store any number greater than one digit. Q: Does it make sense to set the length limit without zero padding? Or... example: tinyint (1)
Note: I understand that the maximum positive value of the Tinyint type is 255. What I don't understand is the purpose of setting 1 here. In fact, even if the length is set to 1, any number greater than 1 can be saved.
Q: Does it make sense to set the length limit without zero padding? Or are there any other settings necessary?
Reply content:
Example: tinyint (1)
Note: I understand that the maximum positive value of the Tinyint type is 255. What I don't understand is the purpose of setting 1 here. In fact, even if the length is set to 1, any number greater than 1 can be saved.
Q: Does it make sense to set the length limit without zero padding? Or are there any other settings necessary?
Mysql specifies the width of the integer type, for example, int (11). This is meaningless for most applications: it does not limit the valid range of values, it only specifies the number of characters used by some mysql interaction tools (such as the mysql command line client. For storage and computing, INT (1) and int (20) are the same.