MySQL datatype INT(11) whereas UNSIGNED INT(10)?

后端 未结 3 1826
傲寒
傲寒 2021-02-02 05:45

in MySQL if we create a field dataType of INT and does not specify any length/values then it automatically became int(11) and if we set the attribute

3条回答
  •  北海茫月
    2021-02-02 06:13

    Just incase anyone doesn't quite understand Shakti's answer (as I didn't). Here's a visual representation of why:

     Signed minimum:
     - 2 1 4 7 4 8 3 6 4  8
     1 2 3 4 5 6 7 8 9 10 11
    
     Unsigned max (also the signed max):
     4 2 9 4 9 6 7 2 9 5
     1 2 3 4 5 6 7 8 9 10
    

提交回复
热议问题