Sql naming best practice

前端 未结 12 2761
春和景丽
春和景丽 2021-02-14 09:48

I\'m not entirely sure if there\'s a standard in the industry or otherwise, so I\'m asking here.

I\'m naming a Users table, and I\'m not entire

12条回答
  •  醉话见心
    2021-02-14 10:31

    I think table and column names must be like that.

    Table Name :
    User --> Capitalize Each Word and not plural.

    Column Names :
    Id --> If i see "Id" I understand this is PK column.
    GroupId --> I understanding there is an table which named Group and this column is relation column for Group table.
    Name --> If there is a column which named "Name" in User table, this means name of user. It's enaughly clear.

    Especially if you are using Entity Framework I suppose this more.

    Note: Sorry for my bad English. If somebody will correct my bad English i will be happy.

提交回复
热议问题