patternMinor
What are sensible/rational character limits in a database e.g. for a persons name
Viewed 0 times
whatarecharacterpersonsrationalsensiblelimitsdatabasenamefor
Problem
This is a general question about database admin.
Is there some kind of standardization for character limits on fields in a DB? It makes sense to specify character limits on the database end for names, phone number etc where you know the sort of data being entered and you want the data entered to be rational so you restrict the character limit. But how do you know what a sensible limit is in this crazy world there could a lot of exceptions.
In my case it is a system for a local company here in the UK with only 10-15 employees. So I could go back and change it if needed but I'd rather enter a rational limit to start with.
Sorry if this question has already been asked. If it has I couldn't find it through Google or on similar Questions.
Is there some kind of standardization for character limits on fields in a DB? It makes sense to specify character limits on the database end for names, phone number etc where you know the sort of data being entered and you want the data entered to be rational so you restrict the character limit. But how do you know what a sensible limit is in this crazy world there could a lot of exceptions.
In my case it is a system for a local company here in the UK with only 10-15 employees. So I could go back and change it if needed but I'd rather enter a rational limit to start with.
Sorry if this question has already been asked. If it has I couldn't find it through Google or on similar Questions.
Solution
I think some of it goes back to requirements. How much of a name are you storing? Do you ever want to keep the "names" separate (like first, middle, last)? Do you want to handle multiple middle names?
I'd say 50 characters should be fairly sufficient for each name if you wished to separate them out. (That will be way more than enough for most names, but will also cover names that are larger.) I'd also probably go with VARCHAR than CHAR for names since they vary so much.
If you were going to put the full name in one field, I'd go with 150 - 200 characters then.
Again....it all goes back to requirements...what do you need?
I'd say 50 characters should be fairly sufficient for each name if you wished to separate them out. (That will be way more than enough for most names, but will also cover names that are larger.) I'd also probably go with VARCHAR than CHAR for names since they vary so much.
If you were going to put the full name in one field, I'd go with 150 - 200 characters then.
Again....it all goes back to requirements...what do you need?
Context
StackExchange Database Administrators Q#22992, answer score: 3
Revisions (0)
No revisions yet.