SQL Server表中列的最佳命名 [英] Best naming for a column in a SQL Server table

查看:166
本文介绍了SQL Server表中列的最佳命名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


  1. YearToDateWages

    li>
  2. YTDWages

  3. YtdWages

跟进: p>


  1. SSN

  2. Ssn

  3. SocialSecurityNumber


解决方案

对于第一个,我将使用

  WagesYTD 

因为YTD是工资的修饰符。 p>

对于第二个,

  SSN或
SocialSecurityNumber

我从来没有在数据库字段或表名中使用camelCase,而Ssn不是一个真正的单词,它是有效的缩写。


Which of the following three options would you choose for a column name in a SQL Server table, and why?

  1. YearToDateWages
  2. YTDWages
  3. YtdWages

Follow up:

  1. SSN
  2. Ssn
  3. SocialSecurityNumber

解决方案

For the first one, I would use

WagesYTD

because YTD is a modifier on Wages.

For the second one,

SSN, or
SocialSecurityNumber

I never use camelCase in database field or table names, and Ssn is not a real word, nor is it a valid abbreviation.

这篇关于SQL Server表中列的最佳命名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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