Based on this, from the point of view of a formal data dictionary, I would call the data element invoice_ID . Typically, the name of the data item will be unique in the data dictionary and, ideally, will have the same name, although sometimes additional qualification conditions based on context may be required, for example. a data item named employee_ID can be used twice in the org diagram and therefore qualify as supervisor_employee_ID and subordinate_employee_ID respectively.
Obviously, naming conventions are subjective and share style. I find the recommendations of ISO / IEC 11179 to be a useful starting point.
For a DBMS, I see tables as collections of entites (except for those that contain only one row, for example, a cofig table, a constant table, etc.), for example. the table where my employee_ID is the key will be called Personnel . Therefore, immediately the TableNameID convention does not work for me.
I saw the TableName.ID=PK TableNameID=FK style TableName.ID=PK TableNameID=FK used for large data models, and I must say that I find it somewhat confusing: I prefer the identifier name to be the same in everything, i.e. did not change the name based on which table appears Something to note: the above style seems to be used in stores that add an IDENTITY (auto-increment) column for each table, avoiding the natural and complex keys in foreign keys. These stores, as a rule, do not have formal data dictionaries and do not build from data models. Again, this is just a matter of style and one to which I personally do not subscribe. So ultimately, this is not for me.
All that said, I see a case where sometimes the qualifier is dropped from the column name, when the table name provides context for this, for example. an element named employee_last_name can simply be the last_name in the Personnel table. The rationale here is that the domain is "people's last names" and most likely will be UNION ed with last_name columns from other tables, and not be used as a foreign key in another table, but then again ... I can just change my mind sometimes you can never tell. This is what: data modeling is part of art, part of science.
onedaywhen Oct 16 '08 at 19:32 2008-10-16 19:32
source share