Good naming habits are a virtue. Below are the naming rules for databases compiled by individuals:
Database naming rules: 1. Database Name: 1.1) Name the product or project; 1.2) Pascal case, such as adventurework; 1.3) Avoid special characters, such as numbers, underscores, and spaces; 1.4) Avoid abbreviations 2. Table Name 2.1) use the plural value, Pascal case, and the plural value can only be added to the last word, such as products, users, and userroles. 2.2) Avoid special characters, such as numbers, underscores, and spaces; 2.3) Avoid abbreviations 3. Column name 3.1) Use Pascal case 3.2) avoid repeated table names and avoid data type prefixes such as: int 3.3) avoid abbreviations or special characters 4. Stored Procedure 4.1) Add a table name to the verb to describe the Operation Type 4.2) prefix: SP + { "Insert", "Update", "delete", "get", "Validate ",...} 5. View 5.1) reference table name rules
5.2) prefix with "VW"
6. triggers 6.1) use the "Trg" prefix 6.2) use the operation type + Table name, for example: Trg_productsinsert
7. Index 7.1) The format is as follows:Idx _ {table name }_{ index column name }_{ unique/nonunique }_{ cluster/noncluster}
8. Primary Key 8.1) format used: pK _ {table name }_{ primary key column name} 9. Foreign key 9.1) The format is as follows: FK _ {name of the primary table }_{ name of the column in the primary table }_{ name of the referenced table }_{ name of the column in the referenced table} 10. Default 10.1) use format such as: DF _ {table name }_{ column name} 11. Constraints 11.1) The format is as follows: CK _ {table name }_{ column name}
12. Variables 12.1) refer to column name rules