A good naming habit is a virtue, the following is a personal collation of the database naming conventions:
Database naming specification: 1. Database name: 1.1) name of the product or project; 1.2) Pascal case, such as adventurework; 1.3) Avoid using special characters, such as numbers, underscores, spaces, etc. 1.4) avoid using abbreviation 2. Table name 2.1) Use the plural, Pascal case, and the complex number is only added on the last word as: Products,users,userroles 2.2) Avoid using special characters such as numbers, underscores, spaces, etc. 2.3) avoid abbreviations 3. Column name 3.1) Use Pascal case 3.2) to avoid duplication with the table name, avoid data type prefixes such as: Int 3.3) Avoid using abbreviations or special characters
4. Stored procedure 4.1) Use verb plus table name to describe operation type 4.2) using prefix: sp+{"Insert", "Update", "Delete", "Get", "Validate",...}
5. View 5.1) Reference table name rule
5.2) prefix with "VW"
6. Triggers 6.1) prefix with "TRG" 6.2) Use the action type + table name, such as: Trg_productsinsert
7. Index7.1) Use format such as: idx_{table name}_{index column name}_{unique/nonunique}_{cluster/noncluster}
8. Primary key 8.1) use format such as: pk_{table name}_{primary key column name}
9. Foreign key 9.1) Use the format such as: fk_{Main Table name}_{the column name of the primary table}_{the reference table name}_{the column name of the reference table} 10. Default 10.1) Use format such as: df_{table name}_{column name}
11. Constraint 11.1) Use format such as: ck_{table name}_{column name}
12. Variable 12.1) refer to the column name rule
SQL Server database Naming conventions