I'm designing a new database table for my project, and one of the columns (basically, the primary auto_increment index field) is going to be of type mediumint (n).
When adding the new column, MySQLFront asked for the length (n) of the data. Sometimes it will auto-fill the value with 6, other time it will auto-fill with the value 8. For INT() data type, the auto-fill value is 11.
A few of questions regarding this:
1. What does the length value means in this context?
2. In MySQL documentation, the (n) value is specified as 'number of bits per value'. Does this mean the amount of space it will take to store each number, or the maximum / largest number I can store in the column?
3. Is there any difference in the number range I can specify if I create MEDIUMINT(6) vs MEDIUMINT(8)?
4. Should I specify lower or higher number in the length?
Thank you in advance.
-stndn.
When adding the new column, MySQLFront asked for the length (n) of the data. Sometimes it will auto-fill the value with 6, other time it will auto-fill with the value 8. For INT() data type, the auto-fill value is 11.
A few of questions regarding this:
1. What does the length value means in this context?
2. In MySQL documentation, the (n) value is specified as 'number of bits per value'. Does this mean the amount of space it will take to store each number, or the maximum / largest number I can store in the column?
3. Is there any difference in the number range I can specify if I create MEDIUMINT(6) vs MEDIUMINT(8)?
4. Should I specify lower or higher number in the length?
Thank you in advance.
-stndn.