MySQL naming conventions, should field name include the table name?

前端 未结 9 2318
梦谈多话
梦谈多话 2021-02-07 08:59

A friend told me that I should include the table name in the field name of the same table, and I\'m wondering why? And should it be like this? Example:

(Table)         


        
9条回答
  •  被撕碎了的回忆
    2021-02-07 09:29

    Sounds like the conclusion is: If the field name is unique across tables - prefix with table name. If the field name has the potential to be duplicated in other tables, name it unique.

    I found field names such as "img, address, phone, year" since different tables may include different images, addresses, phone numbers, and years.

提交回复
热议问题