char, varchar belong to String type
1, char is a fixed length, can know exactly the length of the column value, that is, how many characters. When specifying char (5), it means that only 5 characters can be saved, such as 5 English ' a ', 5 kanji ' i ', 5 symbols ' & ' and so on, the part will be truncated, the insufficient part will be added after the string with a space, remove the following space to remove. Occupies 5 bytes.
2, varchar is indefinite length, when the designation varchar (5), indicates that only 5 characters can be saved, such as 5 English ' a ', 5 kanji ' i ', 5 symbols ' & ' and so on, the outside part will be truncated, the insufficient portion is not filled, the original value of the saved. Occupies 5 + 1 bytes.
int, tinyint is a numeric type, for integer int (1), int (10) They occupy the same storage space, can store values allowed by the int type, for decimals, the specified length means that the total number of digits after the decimal point can be stored, such as decimal (5, 2) Can save 369.26, 369.00, can't save 12345.00
In MySQL for char, varchar, int, tinyint, decimal