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

后端 未结 14 2026
-上瘾入骨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:21

    When I add the field "ordinal" to a table I like to add in a prefix so I don't have to alias ordinal fields from other tables in JOINS. It's handy for JOINS sometimes... not sure I have seen other benefits.

    MediaWiki (the Wikipiedia software) uses that convention. Download the source. They limit themselves to a two character prefix.

    I don't recommend the practice though. For most databases its not necessary.

提交回复
热议问题