什么规则适用于命名mysql列? [英] What rules apply to naming a mysql column?

查看:103
本文介绍了什么规则适用于命名mysql列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以在MySQL表中为列命名

In a MySQL table, naming a column, can I use

  • 空格
  • 大写字母
  • UTF8字符

我还应遵循哪些其他规则?

What other rules shall I follow?

(MySQL5)

推荐答案

是,是,是.

我喜欢在字段名之间加下划线,但不要大写,但我不想发火焰.

I like underscores between field names and no uppercase, but I don't want to start a flame war.

在列名中不使用特殊字符的另一个很好的理由是您,否则其他人最终将不得不在您的应用程序中一遍又一遍地键入该字符.我会坚持使用标准的英文字母.

Another good reason to not use special characters in column names is you, or others are eventually going to have to type that over and over in your application. I'd stick to the standard english alphabet.

好的列名:

account_id
user_id
first_name

列名错误:

Ȩ̬̩̾͛ͪ̈́̀́͘ ̶̧̨̱̹̭̯ͧ̾ͬC̷̙̲̝͖ͭ̏ͥͮ͟Oͮ͏̮̪̝͍M̲̖͊̒ͪͩͬ̚̚͜Ȇ̴̟̟͙̞ͩ͌͝
uraniumType☢☢☢☢

这篇关于什么规则适用于命名mysql列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆