Mysql – best thesql field type for temperatures

MySQL

I'm realising that this is the first time I've stored temperatures in a MySQL DB.

What do think the best mysql field type for temperatures (c) is?

Decimial (3,3) ?

Best Answer

This would depend on the the scale of the temperature

Since the lowest known written temperature of usable numbers on earth is -459.67, I would go with DECIMAL(5,2). This would easily accommodate absolute zero (0K = -273.15 C).

If you are recording temperatures for astronomical bodies (Sun's Surface is about 6,000 C - 11,000 C, Inner Core is 15,000,000 C), you will need a bigger scale like DECIMAL(10,2).