Best name for a column in a SQL Server table

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

  • YearToDateWages
  • YTDWages
  • Ytdwages

Following actions:

  • PLA
  • Ssn
  • SocialSecurityNumber
+3
source share
6 answers

For the first, I would use

WagesYTD

since YTD is a modifier in Wages.

For the second,

SSN, or
SocialSecurityNumber

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

+3
source

, . (, SSN YTD), , , , .

PascalCase, .

: , , YTD , . , , , ; .

+2

ISO-11179, , 5

5: , . - . , . , ; ( , ); , , .

+1

, . - , . "YearToDate", "Ssn".

0

, . SocialSecurityNumber, (, , , where order by), . , . SSN, , , WagesYTD. , , , . WagesOvertime.)

0

, / . , - , , , . SQL , , wages_ytd user_ssn .

, , . , , . , : " ?" - , .

The usual reason I shorten or use shorter variable names is because I'm tired of repeatedly typing or referencing it (Intellisense helps, but it's not always available), or if my code overlaps the entire widescreen monitor, and I have a problem due to long variable names, for example DiagnosticsWidgetFailureCount.SpecificWidgetProperty.FilterBySomeOption.

0
source

Source: https://habr.com/ru/post/1746487/


All Articles