CHARn

suggest change

CHAR(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

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents