Timeline for Datatype for phone number: VARCHAR, INT or BIGINT?
Current License: CC BY-SA 3.0
9 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Dec 25, 2015 at 13:12 | comment | added | Vérace | With MariaDB you could use a computed field to extract just the digits for an auto-dialer. Maybe in MySQL 5.7 (not sure). | |
Dec 24, 2015 at 23:19 | comment | added | Rick James |
Then make it VARCHAR(30) CHARACTER SET ascii . (Note that Max's first example is more than 20 characters.)
|
|
Dec 24, 2015 at 19:46 | vote | accept | ReynierPM | ||
Dec 24, 2015 at 19:45 | comment | added | Hannah Vernon♦ | I'd want at least 20 digits. | |
Dec 24, 2015 at 19:44 | comment | added | Hannah Vernon♦ | INT is certainly not big enough if you store the full number with country code. BIGINT is probably big enough. | |
Dec 24, 2015 at 19:29 | comment | added | ReynierPM |
I would keep the human-recognizability only if I show you those numbers later and that will not happen, at least for a common public, I will show them to system administrator that doesn't care about this. Anyway that's good for anyone to remember but when you dial up you ended up with numbers based on letters. Now, having this clear if you use INT or BIGINT what qty will you set them?
|
|
Dec 24, 2015 at 19:25 | comment | added | Hannah Vernon♦ | It really depends on your requirements. If you need to retain human-recognizability I would certainly want to keep the text-based numbers somewhere, probably in a text field. If you don't care about the text part, then don't store them. | |
Dec 24, 2015 at 19:22 | comment | added | ReynierPM |
Yes, they will be critical so I wont make any mistake in the future, based on that I would only allow numbers, what is your suggestion? Is easy to add a new column that hold the extension number or I want to make people enter numbers as 1-800-DBA-HELP by it's digits
|
|
Dec 24, 2015 at 19:19 | history | answered | Hannah Vernon♦ | CC BY-SA 3.0 |