Get the App
SLTechnology News&Howtos  ›  Database  › 

Summary of the naming of databases, data tables and fields of database design

Shulou Source: shulou.com Published: 2022-06-01 18:35:31 10月03日 Update

Database naming rules:

Name it according to the actual meaning of the project.

Data table naming rules:

1. The names of data tables are mostly in the plural of nouns and are lowercase

two。 Try to use the prefix "table_"

3. If the table name of the data table consists of multiple words, try to connect it with an underscore; but no more than 30 characters, and once it exceeds 30 characters, use abbreviations to shorten the length of the table name.

Field naming rules:

1. First of all, the naming field should be lowercase as much as possible, and meaningful words should be used.

two。 Use prefixes, prefixes as far as possible with the "first four letters + underscores" of the table.

3. If the field name consists of multiple words, use an underscore to connect, and once it exceeds 30 characters, use an abbreviation to shorten the length of the field name.

View naming rules:

1. Try to use the prefix "view_"

two。 If you create a view that involves multiple data tables, be sure to list all the table names. If the length exceeds 30 characters, you can simplify the table name and connect it with an underscore in the middle.

Primary key naming rules:

1. The primary key begins with "pk_", followed by the name of the table where the primary key is located

two。 No more than 30 characters, try to use lowercase English words

Tags: Data characters rules fields data tables underscores prefixes words lowercase length multiple abbreviations views databases nouns plural multiple most letters actual Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Huawei vpn Shulou Information Shulou Technology