Data type for an ID field (int or varchar)

左心房为你撑大大i 提交于 2020-01-05 01:33:35

问题


What is advisable data type of an ID field (such as state ID or web_form_id or employeeID)? Is it best to use an int data type of varchar (and why) ?


回答1:


For an Id, which is going to be unique to each user, its recommended to go with int, and as this sounds more like an sql question, in the auto_increment mode.



来源:https://stackoverflow.com/questions/6554630/data-type-for-an-id-field-int-or-varchar

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!