数据库,表和列命名约定? [英] Database, Table and Column Naming Conventions?

查看:159
本文介绍了数据库,表和列命名约定?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我设计一个数据库,我总是想知道是否有一个最好的方式来命名一个项目在我的数据库。我常常问自己以下问题:

Whenever I design a database, I always wonder if there is a best way of naming an item in my database. Quite often I ask myself the following questions:


  1. 表名是否为复数?


  2. 我应该在命名项目中使用任何案例吗?

在数据库中命名项目时,是否有建议的指南?

Are there any recommended guidelines out there for naming items in a database?

推荐答案

我建议查看Microsoft的SQL Server示例数据库:
http://codeplex.com/SqlServerSamples

I recommend checking out Microsoft's SQL Server sample databases: http://codeplex.com/SqlServerSamples

AdventureWorks示例使用非常清晰和一致的命名约定,使用模式名称组织数据库对象。

The AdventureWorks sample uses a very clear and consistent naming convention that uses schema names for the organization of database objects.


  1. 表格的奇异名称

  2. 列的奇异名称

  3. 表格前缀的模式名称.TableName)

  4. Pascal肠衣(aka上骆驼壳)

  1. Singular names for tables
  2. Singular names for columns
  3. Schema name for tables prefix (E.g.: SchemeName.TableName)
  4. Pascal casing (a.k.a. upper camel case)

这篇关于数据库,表和列命名约定?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆