- All names used throughout the database should be in lowercase.
- Name parts are separated by underline not by a space. As underline is an alphanumeric character, database will be platform independent. Because sometimes space is not allowed.
- Numbers should not use for names
- (.) should not be used for names as separator, because (.) is used as field name in queries. Ex: tablename.columnname
- Must not use reserved words
- Should keep the names simple. Must not use long , complex names
- Database name should contain projectname
- Prefix should be company name or owner's name
- Ex: cmpn_invoice
Table Names
- Should contain name of entity followed by 3 letter acronym. Acronym is created with table name. Ex: manufacturer_prd
- Also we can use prefix for table names same as database prefix for all the tables in that specific database Ex: cecb_manufacturer_prd
- Should not use prefix like tbl_
- Should use simple short clear names for tables. Should not use doubtful names
- Should use singular names
- Group tables with same prefix as master table Eg: user_type, user_status
- Field Names
- For the primary key columns we can use id as name. For product_prd table id_prd is the primay key field name
- Foreign key can be named as idctg_prd. Here this foreign key belongs to product table product_prd. And it reffers to category table category_ctg
- Each column name should include 3 letters acronym of table name, Ex: name_prd
- date_ prefix shold use for date columns and is_ prefix should use for boolean type columns. Eg: date_expire, is_confirmed
No comments:
Post a Comment