Are length/value of data types always required?

There’s not default, really.

In the case of CHAR fields, you set it up when you create it.

For the rest of fields, it is variable with those maximums. So you really don’t care about the default. The field will take as much as it needs till it reaches maximum capacity.

You do need to be careful with your encoding. When I made the analogy of 1 byte is likely to be 1 character, it is because most character encoding only need 1 byte storage. But for UTF-8, as an example, it is not true because it requires 2 bytes of storage for each character

You may find this information useful http://stackoverflow.com/questions/7755629/varchar255-vs-tinytext-tinyblob-and-varchar65535-vs-blob-text

1 Like