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
Depends on how you want to represent the phone number, do you need area codes, country codes and stuff like that, and do you want to save it as a single column or do you want to split it up?
Personally, I would choose to represent area codes, country codes, and the phone number as 3 columns with the datatype int
, as this would make it easier to find all phone numbers in one area, and so on. But if it's only purpose is to be a like a string value, the char would be sufficient, however i would consider using the varchar
instead, if you have phone numbers for several countries.`