Oracle 命名约定

发布于 2024-12-04 20:47:56 字数 1432 浏览 3 评论 0 原文

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

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

发布评论

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

评论(3

最舍不得你 2024-12-11 20:47:56

您正在寻找诸如表命名之类的东西吗?

http://ss64.com/ora/syntax-naming.html

you are looking for something like table naming?

http://ss64.com/ora/syntax-naming.html

野鹿林 2024-12-11 20:47:56

寻找相同的内容,我发现这个Oracle的数据库对象命名约定...这在我看来并没有真正的帮助:
https://docs.oracle.com/cd/E18727_01/doc.121/e12897/T302934T458266.htm#4164876

谷歌会给你很多其他的。以下是一些示例:

http://www.toadworld.com/platforms/oracle/w/wiki/4844.variables-best-practices-naming-conventions#assessment-clear-variable-naming-conventions

< a href="https://oracle-base.com/articles/misc/naming-conventions" rel="nofollow">https://oracle-base.com/articles/misc/naming-conventions

http://ss64.com/ora/syntax-naming.html

就我个人而言,从我的观点来看,最重要的事情是保持正确的大小写一致性。

要么将所有SQL KEYWORDS IN CAPITALSbusiness_vocabulary拼写为lower_case,或者相反,但避免混合两者:它只是使一切变得不那么可读。

当然,采用一些约定是好的,但我想它们通常是主观选择,并且这种选择的相关性取决于数据库的目的。对于 10 个表的数据库来说,好的约定并不是真正必要的:)

在我个人使用的约定示例中,我为视图添加了 v_ 前缀,为所有 PK 名称添加了 id_ 前缀>,以及我的 FK 与 fk_...另外,我的 PK 始终是我的第一列(我现在避免多列 PK),并且我所有的 FK 都放在它后面(表末尾没有 FK )。

请记住,这些示例是的个人选择

Looking for the same, I found this Oracle's naming convention for DB objects... which imo doesn't really help :
https://docs.oracle.com/cd/E18727_01/doc.121/e12897/T302934T458266.htm#4164876

Google will give you many other other. Here are a few examples :

http://www.toadworld.com/platforms/oracle/w/wiki/4844.variables-best-practices-naming-conventions#establish-clear-variable-naming-conventions

https://oracle-base.com/articles/misc/naming-conventions

http://ss64.com/ora/syntax-naming.html

Personally, the most important thing from my pov is to have a correct case consistency.

Either you spell all your SQL KEYWORDS IN CAPITALS and your business_vocabulary with lower_case, or the opposite, but avoid mixing both : it just makes everything less readable.

Then, of course, it's good to adopt some conventions, but I guess they are often subjective choices, and the relevancy of such choices depends on the database's purpose. Good conventions won't be really necessary for a 10 tables DB :)

Among the examples of conventions I personally use, I prefix views with v_, prefix all my PK names with id_, and my FK with fk_... also, my PK is always my first column (I now avoid multiple columns PK), and all my FK are placed after it (no FK at end of table).

Keep in mind that these examples are my personal choices

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