CHARn
suggest changeCHAR(n) is a string of a fixed length of n characters. If it is CHARACTER SET utf8mb4, that means it occupies exactly 4*n bytes, regardless of what text is in it.
Most uses of CHAR(n) are short codes in English, so CHARACTER SET ascii fits. latin1 works just as well for those codes.
country_code CHAR(2) CHARACTER SET ascii,
postal_code CHAR(6) CHARACTER SET ascii,
uuid CHAR(39) CHARACTER SET ascii, -- more discussion elsewhere
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents