I have seen this convention in many databases, but it is redundant. A few answers say it is to reduce confusion during complex joins, but this isn’t a sufficient reason. If you are making complex joins, make aliases.
Do joins really represent such a common task that we should make standard tasks like selects, inserts, and updates redundant?
Why is prefixing column names with the table name a convention?
I don’t think there is actually a convention of prefixing column names with the table name.
As Philippe Grondier details, the ‘proper’ approach to data modelling is to first create a dictionary of data element names. Following the international standard ISO 11179 guidelines:
[Object] [Qualifier] Property RepresentationTermyou end up with data elements that are fully qualified. Here the qualifier elements
Object,Qualifierand sometimesPropertyare in combination what you consider to be the ‘prefix’.On implementation of the data model in SQL, the table name can provide the context and leads the designer to drop the qualifying terms from the column name. I think this is convention you prefer.**
In other words, in the convention you are questioning it is not that the table name has been prefixed to the column name, rather it is that the qualifying terms have been retained.
** whether or not yours or any other is a good convention is subjective and Stackoverflow is not the place for such discussion. However, I will mention in passing that retaining qualification terms does have a practical benefits (as well as being theoretically sound) e.g. consider that SQL’s
NATURAL JOINlends itself to columns that are named consistently throughout the schema.