gpt4 book ai didi

sql-server - 数据库名称约定 : DATETIME column

转载 作者:太空狗 更新时间:2023-10-30 01:38:11 25 4
gpt4 key购买 nike

DATETIME 列的命名约定是什么(在我的例子中,使用 MS SQL Server)

对于存储行创建时间的列,CreatedDatetimeLastModifiedDatetime 是有意义的。

但是对于一个简单的表,假设一个名为 Event 的表,您会创建名为的列吗:

EventID,                 // Primary key
EventDatetime, // When the event is happening
EventEnabled // Is the event is on

ID,                      // Primary key
Datetime, // When the event is happening
Enabled // Is the event is on

如果您既不使用约定:请提供您要使用的列名。

最佳答案

我通常将 DATETIME 列命名为 ACTION_WORD_on:created_on、completed_on 等

ACTION_WORD定义了该列代表什么,后缀(_on)表示该列代表时间。

其他后缀(甚至前缀)可用于指定数据类型(_at_UTCwhen_ 等)。

具有描述性。保持一致。

关于sql-server - 数据库名称约定 : DATETIME column,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1379543/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com