Re: Choosing Primary and Foreign Keys
From: tina (nospam_at_address.com)
Date: 05/23/04
- Next message: John Nurick: "Re: Newbie help"
- Previous message: Joan Wild: "Re: Table relationships Access97"
- In reply to: rkc: "Re: Choosing Primary and Foreign Keys"
- Next in thread: tina: "Re: Choosing Primary and Foreign Keys"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 23 May 2004 20:12:36 GMT
personally, i never include a table name within a field name, too long and
confusing. i wouldn't want to have to type a name that long and hard to read
again and again - in code, in expressions, etc.
also, the most important element in using any naming convention, in any one
database, is consistency. if i used fktblShopsShopID for one foreign key
field, then i should use the same combination of "parts" for all foreign key
fieldnames in my database. the could lead to even longer, yuckier names.
to any developer who does a quick review of the table names, it's going to
be pretty apparent that fkShopID "probably" refers back to tblShops. that's
the important thing. you want clarity and consistency for yourself as a
developer (who may come back to the database 6 months later, not remembering
anything about it!). and just as importantly, for your customer, you want
some degree of clarity and consistency to help the *next* developer make
heads-or-tails of your design.
but you can name your tables and fields anything you want. naming
conventions are guidelines, not laws. :)
"rkc" <rkc@yabba.dabba.do.rochester.rr.bomb> wrote in message
news:Ip1sc.240685$M3.56694@twister.nyroc.rr.com...
>
> "tina" <nospam@address.com> wrote in message
> news:bTUrc.49484$hH.939413@bgtnsc04-news.ops.worldnet.att.net...
> > see the suggested tables below. note the standardized table and field
> names,
> > most importantly *removing the spaces in the names*. see the following
> link
> > for further info:
> > http://www.mvps.org/access/tencommandments.htm
> > btw, these tables are not fully normalized. i would probably break
> > tblPurchases into two tables, but i would have to know more about the
> > process the database is supporting before i would make a specific
> > recommendation.
> >
> > tblShops:
> > ShopID (primary key)
> > ShopName
> > ShopStreet
> > ShopCity
> > ShopState
> > ShopZip
> >
> > tblPurchases:
> > PurID (primary key)
> > fkShopID (foreign key from tblShops)
>
> <snip>
>
> Why not fktblShopsShopID?
>
>
- Next message: John Nurick: "Re: Newbie help"
- Previous message: Joan Wild: "Re: Table relationships Access97"
- In reply to: rkc: "Re: Choosing Primary and Foreign Keys"
- Next in thread: tina: "Re: Choosing Primary and Foreign Keys"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|