| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Database naming convention (yet another post of it, but a bit different)
Well, I've read some posts of naming conventions here in
comp.databases.theory but what I want of this post is to propose my
own naming convention and to see if someone can point out some concept
errors or may be propose some rules I didn't.
Table: employee section
Fields: id ,-------> id
name ,------------/ name
section -/ (foreign key, points to field 'id' of table
'section')
Imagine that you express a query in natural language, you would say "I want to know what's joe's section, as if the section was an attribute of joe. So, using the same naming convention as for object programming, you would have the object joe and would refer to it's section as joe.section, in DBs you would refer to it as "Select employee.name from employee where employee.section = 3"
4) Use underscore to replace spaces. like_this
5) Do not abreviate! it's not at all expensive to write some letters more, and it's more descriptive and readable. Copy & Paste will allways save you the effort. example: use Mortgage_index rather than mrtg_idx, using id for identification or identificator is ok, though. ;D
6) Do not try tu use prefixes refering to data types, or identifying fields, tables, etc. It can make a mess if you have to change a field's type. Besides, you want to know the logical data of a field and not the fisical attributes, if you don't know what type of data is a field, maybe you didn't choose a descriptive name for it. example: "age" id fully descriptive, and there's no need of "intAge".
7) Do not repeat the table name in a field's name, I've seen this many
times.
Example:
Table: employee client
fields: employee_id client_id
employee_name client_credit_card
Because when you refer to it, you can write "employee.id" and there won't be any name space problems.
Well, that's it, may be you can find more rules that would be handy? or point out why some of my rules are not usefull or incorrect? bye, thanks!
PS: Excuse my English. me not speak too good :D Received on Tue Oct 08 2002 - 18:59:48 CDT
![]() |
![]() |