专门用于订购的色谱柱的命名约定

发布于 2024-09-06 01:19:21 字数 110 浏览 4 评论 0原文

比如说,我们有一组记录,应该使用非平凡的排序方法进行排序,例如自然排序或仅按照用户定义的某些特定顺序。我们必须引入一个专门用于订购的栏目。

命名此类列是否有或多或少的通用约定?你用什么名字?

Say, we have a set of records that should be ordered with a non-trivial ordering method, e. g. natural sort or just in some specific sequence, defined by a user. We have to introduce a special column intended just for ordering.

Is there a more or less common convention for naming such columns? What names do you use?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

故乡的云 2024-09-13 01:19:21

我会使用 SortOrder 而不是 sequence,因为序列是由某些供应商(Oracle、PostgreSQL)提供自动增量/标识功能的。 SortOrder 对于列的用途更加明显/明确。

I'd use SortOrder over sequence, for the sake that sequences are by some vendors (Oracle, PostgreSQL) to provide auto increment/identity functionality. SortOrder is more obvious/explicit about what the column is being used for.

遮了一弯 2024-09-13 01:19:21

我见过使用 Sequence 以及 SortOrder。就我个人而言,我更喜欢Sequence,因为它意味着唯一性。

I have seen Sequence used as well as SortOrder. Personally I like Sequence better, as it implies uniqueness.

羅雙樹 2024-09-13 01:19:21

我使用 SortOrder 来表示相对但任意的排序方式,并使用 Sequence 来表示应该是连续且没有间隙的值。因此,SortOrder 的值可能为 10、20、99,但 Sequence 的值永远不会。我可能有一个 SortOrder 来表示货币列表,以便某些货币显示在顶部,但在订单或发票行项目上有一个名为 Sequence 的列。

I use SortOrder for columns that represent a relative, but arbitrary, means for ordering and Sequence for values that should be sequential and not have gaps. Thus, I might have values of 10, 20, 99 for SortOrder but never for Sequence. I might have a SortOrder for say a list of currencies so that certain currencies appear at the top, but a column called Sequence on order or invoice line items.

总以为 2024-09-13 01:19:21

正如其他人所指出的,命名此类列没有真正的标准。

我的偏好往往是“序数”(或排名),但我认为只要有人可以查看表定义并且他们可以弄清楚列代表什么数据,那么我认为你很好。

As others have indicated, there is no real standard for naming such columns.

My preference tends to be "Ordinal" (or rank), but I think as long as someone can look at the table definition and they can figure out what data a column represents, then I think you are good.

久夏青 2024-09-13 01:19:21

虽然我们尽力避免此类构造,但正如您有时会发现的那样,这是最短且最佳的解决方案。

我们通常将其称为 SortSequence 或 UserSortOrder 但我没有看到有关命名法的任何特定约定(通常是因为排序通常是从其他数据派生出来的,而不是明确的事情......)只要名称有意义并且(如果您在其他地方这样做) )是一致的,这就是我所努力的目标。

While we try to avoid these kinds of constructs, as you're finding sometimes it's the shortest and best solution.

We usually call it SortSequence or UserSortOrder but I haven't seen any particular convention around nomenclature (generally because ordering is generally derived from other data and not an explicit thing...) Long as the name makes sense and (if you do it elsewhere) is consistent that's what I'd be striving for.

指尖凝香 2024-09-13 01:19:21

我个人对字段使用任何逻辑名称。我没有在任何地方看到特定字段的名称应该是什么,但是,我尝试确保该名称不是 mysql 保留关键字之一,这样我就不会使用 周围反引号 字符`

另外,MySQL 通常不区分大小写。所以“mytable”和“MyTaBlE”对于MySQL来说是一样的。在某些平台下,我相信您可以将 MySQL 配置为区分大小写,但如果您想将数据库移植到其他平台,这样做会产生潜在的可移植性问题。

命名约定资源:

http://www.interaktonline.com/Support/Articles/Details/Design+Your+Database-Database+Naming+Convention.html?id_art=24&id_asc=221< /a>

I personally use any logical name for the fields. I have not seen anywhere what the name should be for a particular field, however, I try to make sure that name is not one of the mysql reserved keywords so that I don't to use backtick characters ` all around.

Also, MySQL isn't case-sensitive normally. So "mytable" and "MyTaBlE" are the same to MySQL. Under some platforms, I believe you can configure MySQL to be case sensitive, but doing so creates a potential portability problem if you ever want to port your database to other platforms.

Resource to naming convention:

http://www.interaktonline.com/Support/Articles/Details/Design+Your+Database-Database+Naming+Convention.html?id_art=24&id_asc=221

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文