Are there any good reasons why I shouldn't use - (dashes) in field names in MySQL?

I have the name of the category_id field in the product table.

And also I want the category identifier name field to be the category id.

Are there any good reasons I shouldn't use in the field name?

Where can I find which character I should not use in the MySQL field and table name?

+5
source share
3 answers

The main reason for using a hyphen is that most links must specify field names. Otherwise, they will look like a subtraction operator, both for MySQL and for people.

+9
source

You can see a list of reserved words

, , , , backquotes.

+1

The safest bet is to stick to the alphanumeric characters + _. This is pretty standard in terms of a “safe” name, since none of these characters can be distorted as operator characters.

+1
source

All Articles