![]() ![]() The name of the stored procedure should reflect its function. After that, multiple words are connected with an underscore _. The name of the stored procedure starts with sp, which means the stored procedure (storage procedure).If there is no special need, developers are strictly prohibited from creating views. ![]() Abbreviations are used for more than 30 characters. If the view is associated with several tables, use v+underscore _to connect several table names, and the view name should not exceed 30 characters as much as possible. If the view only comes from a single table, it is v+table name.The view name starts with v, which means view, and the complete structure is the abbreviation of v+ view content meaning.If (a,b,c) is established, it is equivalent to establishing (a), (a,b), (a,b,c). Understand the leftmost prefix principle of the combined index and avoid repeated index construction.For the column name composed of multiple words, take the abbreviation that represents the meaning as much as possible, such as the combined index on the member_id and friend_id of the test_contact table: idx_mid_fid.The combination of index fields should not be too many, otherwise, it will not be conducive to the improvement of query efficiency. The index name should not exceed 50 characters as much as possible.Multiple words are separated by an underscore _.The non-unique index is named using idx + field name: create index_idx_uname_mobile on t_user_basic(uname,mobile).The unique index is named using the uni + field name: create unique index uni_uid on t_user_basic(uid).The field name should not exceed 30 characters as much as possible, and the name should be in lowercase.For example, A table and the B table has a creation time, which should be unified as create_time, and the inconsistency will be very confusing. Fields with the same meaning between the tables must have the same name.The field name requires English words or abbreviations that represent its actual meaning, and the words are connected with underscores _, such as service_ip, service_port.The temptable and the bak table should be as short as possible, and the name should be in lowercase. The table name of the regular table should not exceed 30 characters as much as possible.Multiple words separated by an underscore _.The tables of the same module should use the same prefix as much as possible, and the table names should express the meaning as much as possible.Backup table (used to save and archive historical data or data for disaster recovery) naming rules, bak prefix + module + table + date suffix: bak_user_eduinfo_20220101.Temporary tables (tables used by RD, QA, or DBA for temporary data processing), naming rules: temp prefix + module + table + date suffix: temp_user_eduinfo_20220101.The naming rule is t + module (including the abbreviation for the meaning of the module) + table (including the abbreviation for the meaning of the table), such as the education information table of the user module: t_user_eduinfo. The table name of a regular table starts with t_, and t represents the meaning of the table.The default character set is UTF8 (dumbo has been migrated to use utf8mb4). The default character set and collation clause must be added when the database is created.The database naming is generally the project name + abbreviation representing the meaning of the library, such as the workflow database of the IM project, which can be im_flow.The database name should not exceed 30 characters as much as possible.In order to ensure uniformity, we standardize all lowercase representations here. In fact, it is possible to set case sensitivity in MySQL. All database objects use lowercase letters.Avoid using MySQL reserved words such as backup, call, group, etc.The name can only use English letters, numbers underscores, and start with English letters.Use meaningful English words for naming, and the words are separated by underscores.1.2 Database Object Global Naming Convention The naming convention refers to the naming convention of database objects such as SCHEMA, TABLE, INDEX, CONSTRAINTS, etc. Photo by Arnel Hasanovic on Unsplash Database Object Naming Conventions 1.1 Database objectÄatabase objects are the components of the database, and the common ones are as follows: Tables, Indexes, Views, Charts, Default-values, Rules, Triggers, Stored-Procedures, Users, etc. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |