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

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

    Personally, on the 'user' table, my column would just be 'id'.

    But any foriegn key columns on different tables pointing to that column, I'd call the column 'user_id'.

    so you might end up with something like this :

    select  *
    from    order
            inner join user
                on user.id=order.user_id
    

提交回复
热议问题