Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the naming conventions of MySQL

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces what MySQL naming conventions have, which can be used for reference by interested friends. I hope you can learn a lot after reading this article.

MySQL naming convention

1. Library names, table names and field names must be in lowercase letters and separated by underscores.

A) MySQL has a configuration parameter lower_case_table_names, which cannot be changed dynamically. The default value of Linux system is 0, that is, the database table name is stored in the actual situation and is case-sensitive. If it is 1, it is stored in lowercase and is case-insensitive. If it is 2, store it in reality, but compare it in lowercase.

B) if the case is mixed, multiple tables such as abc, Abc, ABC and so on may coexist, which can easily lead to confusion.

C) the field name display is case-sensitive, but actually makes it indistinguishable, that is, it is not possible to create two fields with the same name but different case.

D) for uniform specification, library names, table names, and field names are in lowercase letters.

2. Library name, table name and field name are prohibited from exceeding 32 characters.

Library names, table names, and field names support up to 64 characters, but more than 32 characters are prohibited in order to standardize, easy to identify and reduce the amount of transmission.

3. MySQL reserved words are prohibited for library names, table names and field names.

When attributes such as library name, table name, field name, etc., contain reserved words, the SQL statement must refer to the attribute name in reverse quotation marks, which will make the writing of SQL statements and the escape of variables in SHELL scripts very complicated.

Thank you for reading this article carefully. I hope the article "what are the MySQL naming conventions" shared by the editor will be helpful to you? at the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report