Welcome Guest, Not a member yet? Register   Sign In
Database naming conventions
#2

[eluser]Dam1an[/eluser]
General:
Exactly the same as yours
Tables:
- short, unambiguous names
- tables storing 'Objects' are plural, eg users, messages, comments etc
- avoid abbreviated, concatenated, or acronym-based names
- many to many relationship tables are [singular of table 1]_[plural of table 2] eg account_users, message_comments
Fields:
- no table name prefix, I rarely get any ambiguous fields, and if so, just do table.field, I also prefer to do $user->first_name instead of $user->user_first_name
- PK is always id (auto increment)
- FK is always [foreign table name]_id (Assuming I'm linking to the PK, which I always do)
- Booleabs, is_[name]


Messages In This Thread
Database naming conventions - by El Forum - 05-13-2009, 09:34 AM
Database naming conventions - by El Forum - 05-13-2009, 09:45 AM
Database naming conventions - by El Forum - 05-13-2009, 11:19 AM
Database naming conventions - by El Forum - 05-13-2009, 11:31 AM
Database naming conventions - by El Forum - 05-13-2009, 12:01 PM
Database naming conventions - by El Forum - 05-13-2009, 12:02 PM
Database naming conventions - by El Forum - 05-13-2009, 12:10 PM
Database naming conventions - by El Forum - 05-13-2009, 12:16 PM
Database naming conventions - by El Forum - 05-13-2009, 12:17 PM
Database naming conventions - by El Forum - 05-13-2009, 05:05 PM
Database naming conventions - by El Forum - 05-13-2009, 06:58 PM
Database naming conventions - by El Forum - 05-14-2009, 12:56 AM
Database naming conventions - by El Forum - 05-14-2009, 01:17 AM
Database naming conventions - by El Forum - 05-14-2009, 02:02 AM
Database naming conventions - by El Forum - 05-14-2009, 02:16 AM
Database naming conventions - by El Forum - 05-14-2009, 02:20 AM
Database naming conventions - by El Forum - 05-14-2009, 10:39 AM
Database naming conventions - by El Forum - 05-14-2009, 01:17 PM
Database naming conventions - by El Forum - 05-14-2009, 10:01 PM
Database naming conventions - by El Forum - 05-14-2009, 11:10 PM
Database naming conventions - by El Forum - 05-14-2009, 11:20 PM
Database naming conventions - by El Forum - 05-15-2009, 02:12 AM
Database naming conventions - by El Forum - 05-15-2009, 05:26 AM
Database naming conventions - by El Forum - 05-15-2009, 05:39 AM
Database naming conventions - by El Forum - 05-15-2009, 05:43 AM
Database naming conventions - by El Forum - 05-15-2009, 05:50 AM
Database naming conventions - by El Forum - 05-15-2009, 05:50 AM
Database naming conventions - by El Forum - 05-15-2009, 05:57 AM
Database naming conventions - by El Forum - 05-15-2009, 06:15 AM
Database naming conventions - by El Forum - 05-15-2009, 06:20 AM
Database naming conventions - by El Forum - 05-15-2009, 06:22 AM
Database naming conventions - by El Forum - 05-15-2009, 06:53 AM
Database naming conventions - by El Forum - 05-15-2009, 06:56 AM
Database naming conventions - by El Forum - 05-15-2009, 08:36 AM
Database naming conventions - by El Forum - 05-15-2009, 08:42 AM
Database naming conventions - by El Forum - 05-15-2009, 08:46 AM
Database naming conventions - by El Forum - 05-15-2009, 08:49 AM
Database naming conventions - by El Forum - 05-15-2009, 09:02 AM
Database naming conventions - by El Forum - 05-15-2009, 09:23 AM
Database naming conventions - by El Forum - 05-15-2009, 10:00 AM
Database naming conventions - by El Forum - 05-15-2009, 12:10 PM
Database naming conventions - by El Forum - 05-15-2009, 01:10 PM
Database naming conventions - by El Forum - 05-15-2009, 01:36 PM
Database naming conventions - by El Forum - 05-20-2009, 05:03 PM
Database naming conventions - by El Forum - 09-28-2009, 05:46 PM
Database naming conventions - by El Forum - 09-30-2009, 05:30 PM
Database naming conventions - by El Forum - 11-29-2009, 07:17 AM
Database naming conventions - by El Forum - 11-29-2009, 08:29 AM
Database naming conventions - by El Forum - 11-29-2009, 12:46 PM
Database naming conventions - by El Forum - 07-12-2011, 01:42 AM



Theme © iAndrew 2016 - Forum software by © MyBB