M
M
Maxim Zolotoy2020-01-22 11:51:52
MySQL
Maxim Zolotoy, 2020-01-22 11:51:52

How do you name columns in MySQL tables?

Often you need to name something there key, order and especially name.
But these are reserved names. And how to be?
Name with some kind of prefix or what? It just turns out ugly that type

Article
  - id
  - article_name
  - description
  - author

And if you write a prefix to all fields, then it greatly lengthens everything later

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
FanatPHP, 2020-01-22
@spacenear

1. Reserved words can be used by enclosing them in back quotes, `key`
2. name is a keyword, not a reserved one. And keywords are permitted as identifiers without quoting

R
Roman, 2020-01-22
@Terran37

There was a similar question. MySQL Link
- Table and Column Naming Recommendations?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question