A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Lookup table naming convention



 
 
Thread Tools Display Modes
  #1  
Old November 30th, 2004, 11:47 PM
Christopher Glaeser
external usenet poster
 
Posts: n/a
Default Lookup table naming convention

For design simplicity, all of my lookup tables have two fields, an autonum
for the primary key and text field for the value. Example:

tblPriority
PriorityID: Autonum
Priority: Text

where the priority is "ASAP", "Normal", and "Low".

Assume tblWorkOrder includes a link to tblPriority. What do you name this
field? Priority or PriorityID?

Best,
Christopher


  #2  
Old December 1st, 2004, 12:41 AM
Duane Hookom
external usenet poster
 
Posts: n/a
Default

I always name fields with the first three characters unique to each table.
For instance tblWorkOrder would have fields like:
worWOrID
worOrigDate
worTitle
worStatus
worPriID 'link to tblPriority.priPriID

This suggests that no two fields in an application have the same name. All
primary keys consist of the first three characters repeated followed by
"ID". This system has worked very well for me.

--
Duane Hookom
MS Access MVP
--

"Christopher Glaeser" wrote in message
...
For design simplicity, all of my lookup tables have two fields, an autonum
for the primary key and text field for the value. Example:

tblPriority
PriorityID: Autonum
Priority: Text

where the priority is "ASAP", "Normal", and "Low".

Assume tblWorkOrder includes a link to tblPriority. What do you name this
field? Priority or PriorityID?

Best,
Christopher




  #3  
Old December 1st, 2004, 05:12 AM
Armen Stein
external usenet poster
 
Posts: n/a
Default

In article ,
says...
I always name fields with the first three characters unique to each table.
For instance tblWorkOrder would have fields like:
worWOrID
worOrigDate
worTitle
worStatus
worPriID 'link to tblPriority.priPriID

This suggests that no two fields in an application have the same name. All
primary keys consist of the first three characters repeated followed by
"ID". This system has worked very well for me.



Hi Christopher,

Here's another standard that has worked well for us, for databases from
10 to 150 tables.

Name every field in a table with table name included, like this:

WorkOrderID
WorkOrderOrigDate
WorkOrderTitle

Sometimes we consistently shorten the table name if it's very long, but
we've found that "WorkOrder" is more easy than "wor" to recognize years
later. The field names seem long at first, but you get used to them,
and they are very easy to understand.

Foreign keys can be named exactly as in their Primary table. This sets
them apart visually from the "local" fields, and there's no question as
to where they refer:

PriorityID

If you have more than one foreign key reference to the same table's
primary key, or if you need some clarification, use a suffix:

CustomerID_Billing
CustomerID_Shipping

EmployeeID_ReportsTo

PriorityID_WorkOrderDefault

Just another opinion,

--
Armen Stein
Access 2003 VBA Programmer's Reference
http://www.amazon.com/exec/obidos/AS...jstreettech-20
J Street Technology, Inc.
Armen _@_ JStreetTech _._ com
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Get data from combo box to popluate the next box Lin Light Using Forms 4 December 30th, 2004 05:01 PM
transpose john Using Forms 1 November 24th, 2004 06:16 PM
Table Wizard Does Not Set Relationship if Foreign Key and Primary Key Name Do Not Match Exactly in Case. HDW Database Design 3 October 16th, 2004 03:42 AM
Complicated Databse w/many relationships Søren Database Design 7 July 13th, 2004 05:41 AM
COMPARE THE TWO TABLES Stefanie General Discussion 0 June 4th, 2004 04:36 PM


All times are GMT +1. The time now is 08:52 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.