Answer the question
In order to leave comments, you need to log in
How to correctly name fields in a database?
Good day!
I read somewhere the rules for naming fields in the database, it says the following:
For example, there is a table named Nomenclature, and it has the following fields Id and Type, but they need to be named NomenclatureId and NomenclatureType.
To what extent is this the right decision?
And another question, but if the name of the field is long, for example TypeMaterialCloth, the field will have to be named as NomenclatureTypeMaterialCloth, isn't the name long?
Although it seems to me that the answer to this question would be a more thoughtful name for the field (not so long), I would like to hear your opinion!
PS Thank you all very much!
Answer the question
In order to leave comments, you need to log in
const index = arr.findIndex(n => n.id === id);
if (index !== -1) {
arr.splice(index, 1);
}
const newArr = arr.filter(n => n.id !== id);
for (let i = arr.length; i--; ) {
if (arr[i].id === id) {
arr.splice(i, 1);
}
}
arr.reduceRight((_, n, i, a) => n.id === id && a.splice(i, 1), null);
Look at the limitations of your database, there are allowed lengths for table names, columns, reserved words.
In general, long names are justified only in indexes and foreign keys, and it is better to name columns somehow shorter. And in joins, you can use aliases.
https://dev.mysql.com/doc/refman/8.0/en/column-cou...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question