Re: Relationship Question
- From: DavidB <jebva@xxxxxxxxx>
- Date: Wed, 31 Oct 2007 10:10:50 -0700
On Oct 31, 11:59 am, "Keith Wilby" <h...@xxxxxxxxx> wrote:
I have three tables with 1:M and M:M relationships:
tblSubSystem
ID (PK)
SubSysName (Text)
tblJoin
SSID
OPID
tblOperation
ID
OpName
A Sub-System can have many Operations and an Operation can be performed on
many Sub-Systems. This works OK. However, I have another table for
Actions:
tblAction
ID (PK)
ActionName (Text)
Each System/Operation combination can have many Actions. How do I achieve
this relationship? I have a hunch that I need to join to both fields in
tblJoin but I can't visualise it. Can anyone help?
Many thanks.
Keith.
Just a suggestion here. name your primary key fields uniquely across
tables so that in all tables a gievn field has the same name. In you
Operation table your PK should be OPID just as it is in the Join
table. It makes you code and relationships a LOT easier to read.
Perhaps its personal preference, just tthought I'd throw it out there.
More on a personal preference thing is the use of abbreviations. I
almost never use them. In your Operation table you have a field
called OpName. No harm in calling in OperationName, OperatorName,
OperatingName or whichever it is. It will make things much easier as
your databases get more complex and you start building SQL in code.
It will be even more of a help to the programmer that sits down afetr
you leave...
.
- References:
- Relationship Question
- From: Keith Wilby
- Relationship Question
- Prev by Date: Re: Reoccurring log D/W/M
- Next by Date: Query run and displayed in a form?
- Previous by thread: Re: Relationship Question
- Next by thread: Re: Relationship Question
- Index(es):
Relevant Pages
|