Naming conventions for tables and columns when plural and singular forms are odd or the same

In my search, I have found mostly arguments for using plurality in database naming conventions and how they handle them anyway. I've decided that I prefer multiple table names, so I don't want to argue about that.

I need to represent an animal species and genus, etc. in the database. The plural and singular forms for “species” are the same, and the plural for “genus” is “genus”.

I am using Microsoft Data Entity Data Model by the way. My concern is mainly about whether I will have problems later, depending on my naming options.

I think I can get by: Table: Childbirth | Column: Rod

But I'm not sure how I should handle: Table: Views | Column: Views

If I really wanted to be lazy about this, I would call them "species> specie" and "genuses" genus ", but I would rather read them in their correct forms.

Any advice would be appreciated.

+2


a source to share


2 answers


I would go for childbirth / childbirth and species / species. How do you say it in English, so why use the wrong form of the word?



+4


a source


I usually avoid having a column name that is the same as the table name because it can be confusing to readers. The database engine knows if it expects a table name or a column name in any context, I don't remember what the problem was. (Is there some context in which either would be valid? I can't think of it.)

However, if you encounter this problem, it indicates that you have a poorly chosen name for one or the other. Views are meaningful as a table name: this table contains data about a view. So if a field in this table is called "view" ... how about a view? Everything in the table is presumably related to the view. I would guess that this is probably some kind of identifier and not, say, the number of chromosomes or the way of reproduction. But is this an identification number? Abbreviation? Common name? Name of binomial nomenclature? Etc. If it is, say, a common name, I would call it "common_name" rather than "species".



By the way, another naming convention you must decide is whether the column names, which can be ambiguous if taken out of context, must have names that indicate the context, or use the table name to disambiguate. For example, you may have many things that have a "name". You can call any such field simply "name", and if there is ambiguity, qualify it, for example, "species.name", "laboratory.name", etc. Or you can give each field a unique name like "output_name", lab_name, etc. That is one of those questions that I don't think have a definitively correct answer, just pros and cons, and take solution and agree.

0


a source







All Articles