Naming specification (Oracle database)

Source: Internet
Author: User

1. Table naming

L name best words too literally, avoid using database keywords

L Name all uppercase letters (or lowercase, do not write large mix)

L The singular name of the English word. Example: FACTORY

L NAME the English word abbreviation. Example: DEPT

L Use an underscore link between English words, and each word is singular. Example: Task_result

L used to store historical data, named after the history of the end. Example: Task_history

L used to store log data, named with Log end. Example: Task_log

L is used to store class data, and the name ends with type. Example: Task_type

2. Table field

L name best words too literally, avoid using database keywords

l English word singular name. Example: MAIL

L NAME the English word abbreviation. Example: dept_id

L Use an underscore link between English words, and each word is singular. Example: user_name

The L field is used to store the serial number, and the name ends with an ID. Example: task_id

The L field is used to store the code, and the name ends with NO. Example: Task_no

The L field is used to store the date, and the name ends with a date. Example: Create_date

The L field is used to store the quantity, and the name ends with QTY. Example: Plan_qty

The L field is used to store the category, and the name ends with TYPE. Example: Station_type

The L field is used to store the name, which is named End with name. Example: Enduser_name

The L field is used to store the description, with the name ending in DESC. Example: Station_desc

The L field is used to store the code, and the name ends with code. Example: Error_code

The L field is used to store flags, and names begin with flag. Example: Debug_flag

3. Index

Named with the table name + index+ Two-bit serial number (01~99). Example: enduser_index01

4. Key value

L primary Key name +pk+ a serial number (1~9) with the table name. Example: DEPT_PK1

L Key Name +ak+ a serial number (1~9) with the name of the table. Example: DEPT_AK1

L foreign Key name +fk+ a serial number (1~9) with the name of the table. Example: DEPT_FK1

L Check Condition +ck+ a serial number (1~9) with the name of the table. Example: Dept_ck1

5. View

L named with v_ opening example: v_dept

L Other Rules reference table naming rules

6. Trigger

Name +tr+ a serial number (1~9) with the name of the table. Example: DEPT_TR1

7. Stored Procedures

L name starts with PC

L Implement a single table trading function, named after the pc+ table name. Example: Pc_line

L Implement the related table trading function, named after the pc+ function. Example: Pc_getdata

L naming requires people to understand their main functions

8. Functions

L Check function to is+ check the project name. Example: BOOL Ischarvalid (char)

L Gets the function of the data function, named after the get+ data item. Example: String Getlineno (char)

L Set the function of the data function to name the set+ data item. Example: Int Setlineno (char)

9. Sequence

L name starts with SEQ

L NAME the field name of the table. Example: seq_line_id

L NAME the table name + field name if the field name is the same as the other table. Example: seq_code_type_id

10. Table Space

L The name of the stored data is the project. Example: CRM

The storage index is named +IDX the project name. Example: Crmidx

The name of the storage history is named +old for the project. Example: Crmold

L store temporary naming for project name +log. Example: Crmlog.

11. Data Files

Name begins with the owning table space + two-bit serial number (01~99) +. ORA. Example: CRM01. ORA

12. Package

The name begins with the function abbreviation +pkg+ serial number (1~9). Example: CRMPKG1

13. Users

L project managers are named after the project name. Example: CRM

L Developer generic name developer

L Beginners General Name Beginner

Naming specification (Oracle database)

Related Article

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.