Database naming rules

Source: Internet
Author: User
The database uses 26 English letters (case-sensitive) and 0-9 natural numbers, with underscores (_), 63 characters in total. No other characters are allowed (except comments ). Database object naming rules database objects include tables, views (queries), stored procedures (parameter queries), functions, and constraints. Object Name By prefix

The database uses 26 English letters (case-sensitive) and 0-9 natural numbers, with underscores (_), 63 characters in total. No other characters are allowed (except comments ). Database object naming rules database objects include tables, views (queries), stored procedures (parameter queries), functions, and constraints. Object Name By prefix

Database character rules

It consists of 26 English letters (case-sensitive) and 0-9, and underlines (_), 63 characters in total. No other characters are allowed (except comments ).

Database object naming rules

Database objects include tables, views (queries), stored procedures (parameter queries), functions, and constraints. The object name consists of the prefix and actual name, and the length cannot exceed 30. Prefix: Use lowercase letters.

For example:

Table

Tb

View

Vi

Stored Procedure

Sp

Function

Fn

ACTUAL NAME

The actual name is used to describe the object content. It is composed of words or words. The first letter of each word is uppercase, And the other letters are lowercase. It does not start with a number or.

For example:

Table

User_Info

View

UserList

Stored Procedure

UserDelete

Therefore, valid object names are similar to the following.

Table

Tb_User_Info, tbMessage_Detail

View

Vi_MessageList

Stored Procedure

Sp_MessageAdd

Database Table naming rules

A field consists of a prefix and an actual name. The system tries its best to use the same word as the first word in the actual name.
Prefix: tb, a lowercase letter, indicates the table.
Example: tbMember
TbMember_Info
TbForum_Board
TbForum_Thread1

Field naming rules

Number, character, date/time, lob (large object), miscellaneous, the field is composed of the abbreviation of the table, underline, the actual name and suffix.
Suffix: lowercase letters are used to indicate the attributes of the field.
Example: User_Idint
User_Namestr
User_RegDatedtm

View naming rules

A field consists of a prefix and an actual name, and is connected by an underscore in the middle.
Prefix: Use the lower-case letter vi to represent the view.
Example: vi_User
Vi_UserInfo

Stored Procedure naming rules

A field consists of a prefix and an actual name, and is connected by an underscore in the middle.
Prefix: sp, a lowercase letter, indicates the stored procedure.
Example: sp_User

Database Design Document rules

All database designs should be written into documents, which are expressed in modular form. The general format is as follows:
'-------------------------------------------
'Table name: tbUser_Info
'Created by: UAM_Richard
'Date: 2004-12-17
'Version: 1.0
Description: save user information.
'Specific content:
'Useridint, automatic incremental user code
'Usernamechar (12) Username
'......
'--------------------------------------------

SQL statement rules

All SQL keywords are capitalized, such as Select, Update, FROM, ORDER, and.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.