Is prefixing each field name in a table with abbreviated table name a good practice?

后端 未结 14 2006
-上瘾入骨i
-上瘾入骨i 2020-12-16 19:26

Do you prefix each field in a table with abbreviated table name?

Example:

Table: User

Fields:
user_id
user_name
user_password

Or d

14条回答
  •  伪装坚强ぢ
    2020-12-16 20:19

    We also don't use abbreviated table prefixes normally and I wouldn't advice it either.

    There's however one situation where we do: reserve fields.

     e.g. OH_Reserve_Field_Alpha3 in table ORDER_HEADER
    

    Short background: Our database has 250+ tables and we put in most of them reserve columns to use them for future feature implementations. As you can imagine, without prefixing you would end up having 50 Reserve_Field_Alpha3's with totally different meaning but same name throughout your code. It's already hard as it's now, but without prefixes it would be worse.

提交回复
热议问题