I always have problem choosing the correct data type for my tables for example. What should I use for store an url, an address or a phone number?
Can you share your recommendations?
I always have problem choosing the correct data type for my tables for example. What should I use for store an url, an address or a phone number?
Can you share your recommendations?
For further actions, you may consider blocking this person and/or reporting abuse
Techcreator USA -
Nandani Sharma -
Samuel Rouse -
HitBlast -
Top comments (2)
For email, I would suggest a varchar of 255. I think that would work for almost all domain names and usernames.
For addresses, I would again go for varchars but a shorter length.
Like for city it would be 100. Same for state. Country code can be 2 depending upon your setup.
And for Address line 1 and 2, you can go for varchar 255
For phone numbers, I would use BIGINT considering that you already have the country code. But, your phone number should be be in the range of BIGINT in this case.
Thanks Aditya