List of standard lengths for database fields

后端 未结 13 1782
日久生厌
日久生厌 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条回答
  •  旧时难觅i
    2020-12-02 03:43

    I would say to err on the high side. Since you'll probably be using varchar, any extra space you allow won't actually use up any extra space unless somebody needs it. I would say for names (first or last), go at least 50 chars, and for email address, make it at least 128. There are some really long email addresses out there.

    Another thing I like to do is go to Lipsum.com and ask it to generate some text. That way you can get a good idea of just what 100 bytes looks like.

提交回复
热议问题