List of standard lengths for database fields

后端 未结 13 1764
日久生厌
日久生厌 2020-12-02 03:30

I\'m designing a database table and once again asking myself the same stupid question: How long should the firstname field be?

Does anyone have a li

13条回答
  •  温柔的废话
    2020-12-02 03:59

    I just queried my database with millions of customers in the USA.

    • The maximum first name length was 46. I go with 50. (Of course, only 500 of those were over 25, and they were all cases where data imports resulted in extra junk winding up in that field.)

    • Last name was similar to first name.

    • Email addresses maxed out at 62 characters. Most of the longer ones were actually lists of email addresses separated by semicolons.

    • Street address maxes out at 95 characters. The long ones were all valid.

    • Max city length was 35.

    This should be a decent statistical spread for people in the US. If you have localization to consider, the numbers could vary significantly.

提交回复
热议问题