Database naming specification

xiaoxiao2021-03-06  41

Database naming specification

One. Named of entities and properties

1

.

Common words have been abbreviated, in the naming process, according to semantic patchwork abbreviation. Note that due to

ORCAL

The database will unify the field name into one of the uppercase or lowercase, so it is required to add a next line.

Example:

Definition abbreviation

Sales: Sal

Sales;

Order: ORD

Order;

Detail: DTL

Detail;

Then the sales order name is named:

SAL_ORD_DTL; 2

.

If the table or the name of the field has only one word, it is recommended not to use abbreviations, but use a complete word.

Example:

Definition abbreviation

Material Ma

article;

The name of the item is:

Material,

Instead of

MA.

But the field item coding is:

MA_ID;

Instead of

Material_id3

.

All stored value lists are prefixed in front of the table

Z

The purpose is to sort these values ​​list in the database.

4

.

Named of all redundancy

(

Mainly a cumulative table

)

Front add prefix

X

Redundant categories are in order to improve the database efficiency, and add in the non-standardized database. Or table

5

.

Association class After connecting two basic classes with underscore, add prefix

R

Mail name

,

The abbreviation of two table names or table names are listed in the alphabetical sequence.

Association tables for saving multiple pairs of relationships.

If the name of the associated is greater than

10

A letter must abbreviate the original table name. If there are no other reasons, it is recommended to use abbreviations.

Example: Table

Object

Multi-to-many relationships with itself

,

Then save a multi-fold table name:

R_Object

;

table

Depart

with

EMPLOYEE;

There are many-to-many relationships; the association table is named

R_DEPT_EMP6

.

Every table will have an automatic

Id

Active

,

Logical maintenance is defined as the first group of candidates

,

If it is an encoding generated by the database, the unified name is:

Id;

If it is a custom logical code, use abbreviations. "

Id

"Method naming.

Example: Name field named sales order:

SAL_ORD_ID

If there is still a database generated automatic number, named:

Id

.

Seduce

.

All attributes plus the type of suffix, an abbreviation definition of the type suffix, see the file "Type Handfix Self-definition", note that if other suffixes are required, they are placed before the type suffix.

two. Relationship naming

The naming of the relationship is basically followed

;

If there is a special case

,

Can be flexible.

[MUST / May / CAN / SHOULD] [VERB / ​​VERB PREP] [A / MANY / EXATLY NUM] [OR A / MANY]

Structure naming

three. Domain naming

four. Naming of the trigger

Fives. Related to the default description

1

.

Strictly dependent the main table, the suffix of the main table

Main

Can not write.

2

.

The data type is the field of the text, the type suffix

TX

Can not write.

3

.

Some types are more obvious fields, and they can write the type suffix.

4

.

Very obvious relationship

,

Not write

转载请注明原文地址:https://www.9cbs.com/read-63167.html

New Post(0)