Pros and cons of a table name with spaces

One of my projects needed a table with a space between them. Some suggest that I do not include spaces, because this is not a good technique.

we can still implement it using single-double quotes for the table name in queries. But I need solid support so as not to choose spaces. Please, help.

+4
source share
2 answers

It makes reading difficult, makes it difficult if you ever want to do dynamic SQL. Spaces in table names, on the other hand, do not add any meaning.

Mr. Anderson points out that this is tiring. This is true enough, but more importantly, it adds unnecessary fatigue.

+8
source

I would never use spaces (and other special characters) in table or column names.

From laziness - one point (therefore, entering SQL queries is much simpler because you do not need these terrible quotes)

Secondly, many tools have problems with non-standard table names.

Btw: the quote character for non-standard object names is a double quote (") If you really go this route, I would strongly recommend putting MySQL in" ANSI mode "to be compatible with the rest of the world (DBMS).

(Single quotes are for character literals, double quotes for "escaping" non-standard names)

+4
source

Source: https://habr.com/ru/post/1332076/


All Articles