MySQL表名称中的下划线会引起问题吗? [英] Do underscores in a MySQL table names cause issues?

查看:888
本文介绍了MySQL表名称中的下划线会引起问题吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

表名中的下划线会影响性能还是在某些平台上引起问题?

Do underscores in table names affect performance or cause issues on some platforms?

例如user_profiles

使用userProfiles还是更好,还是仅出于个人喜好?

Would it be better to use userProfiles or is it just a matter of personal preference?

推荐答案

不是.下划线在表名中是完全合法的.

Nope. Underscores are perfectly legal in table names.

MySQL文档中的此处的页面告诉您有关允许使用什么字符.

This page here in the MySQL documentation tells you about what characters are allowed.

基本上:

未加引号的标识符中允许的字符:

Permitted characters in unquoted identifiers:

ASCII:[0-9,a-z,A-Z $ _]
扩展:U + 0080 .. U + FFFF

ASCII: [0-9,a-z,A-Z$_]
Extended: U+0080 .. U+FFFF

带引号的标识符中允许的字符:

Permitted characters in quoted identifiers:

ASCII:U + 0001 .. U + 007F
扩展:U + 0080 .. U + FFFF

ASCII: U+0001 .. U+007F
Extended: U+0080 .. U+FFFF

我个人倾向于使用小写字母a-z(偶数和下划线). 但是正如@Vince所说,这只是个人喜好.

Personally I tend to stick with lowercase a-z, the occasional number, and underscores. But as @Vince said, it's just personal preference.

这篇关于MySQL表名称中的下划线会引起问题吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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