Naming specification database naming conventions for database tables
- Data files
- Database tables
- Only one system
- There are multiple systems
- Association table name
- database field Naming conventions
- Other
- View Name
- Stored Procedure Name
- SQL statements
Original link
Data files
The data file name takes the system name _ file type, for example the system name is Kupage, the database file is named Kupage_database.mdf, some database files have several, for example SQL Server has 2, one is the database file, the other is the log file, Then their files are named Kupage_database.mdf,kupage_log.log, respectively. Filenames are all lowercase.
Summary: System name _ file type
Database tables have only one system
Length cannot exceed 30 characters
Words are all in singular form
Capitalize the first letter of the word
No connection symbols between multiple words
E.g:userinformation
There are multiple systems
System name + table name when a single system
The system name is abbreviated and all lowercase letters are used
Do not use any connection symbols
E.g:bbsuserinformation
Association table name
The Guan Lianqua naming convention for re_ Table A_ table B,re is an abbreviation for relative, such as: Re_user_articletype, Re_user_formtype.
database field Naming conventions
database field names are all lowercase English words, separated by "_" between the words
Naming rules are table aliases + words, such as: User_name,user_pwd.
Table alias rules
If the table name is a word, the alias takes the first 4 letters of the word;
If the table name is two words, the first two letters of each of the two words are composed of 4 letters long aliases;
If the name of the table consists of 3 words, you may want to take one from the first two words and then remove the two letters from the last word, and the result is a 4-letter long alias.
Other view names
The view name takes the rule view_ table A_ table B_ Table C,view represents the view. This view is generated by several tables and joins the names of several tables with "_", and if you have too many tables you can simplify the table names appropriately, but be sure to list all the table names.
Stored Procedure Name
Stored procedure naming rules P_ the name of the Access procedure (abbreviated), such as P_user_del,p_articletype_adddata.
SQL statements
SQL statement Writing rules, keywords must be uppercase, other writing according to the above naming rules, such as:
SELECT user_id, user_name from user WHERE user_id = ' Tom '
Naming conventions for database tables