MySQL data type to keep negative number

I have a rating system that ranges from -1 to 5 to 0.

Therefore, I need to save the following values

-1 0 1 2 3 4 5 

What is the best data type, given that I want to get the total of each value (not the sum)?

+4
source share
1 answer

I would go with TINYINT registered here . It occupies 1 byte of memory, and its range is from -128 to 127.

+6
source

Source: https://habr.com/ru/post/1481462/


All Articles