我在设计一个数据库表,再一次问自己同样愚蠢的问题:How long should the firstname field be?
Does anyone have a list of reasonable lengths for the most common fields,比如名字、姓氏和邮箱地址?
我在设计一个数据库表,再一次问自己同样愚蠢的问题:How long should the firstname field be?
Does anyone have a list of reasonable lengths for the most common fields,比如名字、姓氏和邮箱地址?
W3C推荐:
如果设计一个表单或数据库来接受人们的名字
…请记住,在某些文化中,名字可能要长得多
https://www.w3.org/International/questions/qa-personal-names个
对于数据库字段,VARCHAR(255)
是一个安全的默认 Select ,除非您真的能想出一个很好的理由来使用其他字段.对于典型的Web应用程序,性能不是问题.不要过早地进行优化.