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

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

问题描述

每当我设计一个数据库时,我总是想知道是否有一种最好的方法来命名我的数据库中的项目.我经常问自己以下问题:

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. 列名应该是单数吗?
  3. 我应该为表或列添加前缀吗?
  4. 我应该在命名项目时使用任何大小写吗?

是否有任何推荐的指南来命名数据库中的项目?

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

推荐答案

我建议查看 Microsoft 的 SQL Server 示例数据库:https://github.com/Microsoft/sql-server-samples/releases/tag/adventureworks

I recommend checking out Microsoft's SQL Server sample databases: https://github.com/Microsoft/sql-server-samples/releases/tag/adventureworks

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. 表前缀的模式名称(例如:SchemeName.TableName)
  4. Pascal 外壳(又名上驼色外壳)

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

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