MySQL char vs. int

后端 未结 4 1402
情话喂你
情话喂你 2021-01-22 09:55

I\'m currently having a discussion in my class about the datatypes char and int in MySQL. We have a phone number of 8 individual numbers. However, we c

4条回答
  •  滥情空心
    2021-01-22 10:44

    Don't know about the US exactly, but in Europe the national access code is a leading 0 , and international access code is a leading 00 or +. So that's a con to using INT, as the leading 0's would be lost. Further more you also have phone numbers that contain names and even though these names can be converted to numbers, it would probably be nice to keep them as a name. That's a second con to using INT. Last con is you can also have extension numbers, etc. All goes into favor of VARCHAR.

提交回复
热议问题