Complex systems often use a metadata repository. The metadata repository requires data items to be unique. So, having, say, 147 tables with the same data item name (id), but different data definitions (user ID, account ID, etc.) will not work.
From this point of view, the "user" part of "user_id" is not the name of the table in which "user_id" is located. Instead, "user" is an object class class, and "id" is one property of this object class. I use the object, class and property not in the sense of OO programming, but in the ISO 11179 Standard.
You can find ISO 11179 projects online. I think it is worth reading.
If you use multiple columns, all named "id", in one query, you should at least partially use an alias. What are the odds that 40 different programmers working for 10 or 15 years will use the same alias every time? On large systems, it is important to know that the user ID number will be called "user_id" wherever it appears. (With the possible exception of self-join.) I worked on systems where the user ID was "user_id", "usr_id", "u_id", "u_no", "u_uno", "u_n", "u", "uid " etc. Takes time. Time that could be better used.
source share