0

I need to find the maximum values of my stored integers in mysql, such as customer_id is int(8) how can i find the maximum number of customers that can be stored?

Thanks

Shadow
  • 33,525
  • 10
  • 51
  • 64
kannastor
  • 13
  • 2
  • 3
    Note that the number in parentheses following an integer declaration is fairly meaningless, and probably best omitted – Strawberry Dec 07 '20 at 19:06

2 Answers2

1

based on mysql doc maximum value unsigned for int datetype is : 4294967295

eshirvana
  • 23,227
  • 3
  • 22
  • 38
1

How can I find the maximum value of an int(x) in MySQL?

By looking at the documentation obviously: an unsigned INT ranges from 0 to 4294967295. A signed INT ranges from -2147483648 to 2147483647.

Note that, counter-intuively enough, the size of the datatype (8 in INT(8)) has no impact whatsoever on the range of values it can store. That's just a hint to the database of how many characters should be padded when the data is displayed.

GMB
  • 216,147
  • 25
  • 84
  • 135
  • 2
    "As of MySQL 8.0.17, the display width attribute is deprecated for integer data types; you should expect support for it to be removed in a future version of MySQL." https://dev.mysql.com/doc/refman/8.0/en/numeric-type-syntax.html – ysth Dec 07 '20 at 19:06