Jahanzaib Niazi
Jahanzaib Niazi

Reputation: 95

Which data type is more suitable for fixed length of data in mysql

I have fixed length data in MYSQL Database.

So my question is that which data type among the VARCHAR and CHAR is more suitable to be used with respect to performance, Space, Time and speed?

Upvotes: 0

Views: 128

Answers (1)

deepakbhavale67
deepakbhavale67

Reputation: 347

since you have data is of fixed length you should use the CHAR.

For example:

The following statement creates a table with a CHAR column having the fixed length. i.e. CHAR(3) fixed length is 3.

CREATE TABLE mysql_char_test ( status CHAR(3) );

Upvotes: 1

Related Questions