DEV Community

Discussion on: Database naming conventions.

Collapse
 
kspeakman profile image
Kasey Speakman

I only do this routinely when the same data could be found in other tables, to make it clear that it is from another table. The most common example would be naming ID columns as [Table]Id instead of just Id. I have used just Id in the past as the ID column and regretted it.

I might also do this when the column name I want to use is a reserved word, either in SQL or the programming language. Sometimes I can find an alternative name, but other times it just makes sense to prefix the table name and move on.

Generally though, I try to stick to the shortest descriptive name I can come up with.