Home All Groups Group Topic Archive Search About


Author
8 Mar 2005 4:05 PM
John
I'm trying to normalize my database the best I can this time around and I'm
running into some trouble.  I've been avoid normalizing for a long time now
because while I know how to normalize, I'm weak on SQL strings so populating
the database is a pain in the kee... but this is another story...

ok, first of all is this a many to many or no?

projMain (table)
projID (PK)
clientID (FK)
etc.........

ProjWebs (table)
webID (PK)
projID (FK)
stageID (FK) ***

SDLC (table)
stageID (PK) ***
stageName
stageDescr

*** is this a many to many relationship?  Rather than hard coding SDLC info
I'm putting it into a table.  Since many of the records in ProjWebs can
relate to many in SDLC and visa versa, this is many to many, yes?  If so,
how can I create One to Many without make a seperate table for ALL SDLC
stages?

cOnFuSeD!!!

Thanks!

Author
8 Mar 2005 7:20 PM
Bob Barrows [MVP]
John wrote:
Show quote
> I'm trying to normalize my database the best I can this time around
> and I'm running into some trouble.  I've been avoid normalizing for a
> long time now because while I know how to normalize, I'm weak on SQL
> strings so populating the database is a pain in the kee... but this
> is another story...
>
> ok, first of all is this a many to many or no?
>
> projMain (table)
> projID (PK)
> clientID (FK)
> etc.........
>
> ProjWebs (table)
> webID (PK)
> projID (FK)
> stageID (FK) ***
>
> SDLC (table)
> stageID (PK) ***
> stageName
> stageDescr

>
> *** is this a many to many relationship?

The asterisked relationship is a one-to-many relationship. The entire
3-table structure is a many-to-many relationship between projMain and SDLC.
A many-to-many relationship consists of two one-to-many relationships
combined via a "bridge" table.


> Rather than hard coding
> SDLC info I'm putting it into a table.  Since many of the records in
> ProjWebs can relate to many in SDLC and visa versa, this is many to
> many, yes?  If so, how can I create One to Many without make a
> seperate table for ALL SDLC stages?

You can't. The only way to implement a many-to-many relationship is to use a
bridge table. From what you are saying, it sounds as if it's the right thing
to do. Don't shy away because it's a little work. :-)


projMain (table)
projID (PK)
clientID (FK)
etc.........

ProjWebs (table)
webID (PK)
projID (FK)

WebStage (table)
webID (PK)(FK)
stageID (PK)(FK)

SDLC (table)
stageID (PK)
stageName
stageDescr

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Author
10 Mar 2005 5:16 AM
John
oh man, my SQL chops are about to get spanked.  I have no idea how I'm going
to write strings or procedures for all this, wow.  Well, I'll be back with
more questions I guess ;-P

Any recommendations for a solid SQL instruction-guide book?  I have to get
better chops.  Been cruising Amazon and SQL in a Nutshell "second edition"
( I guess the first was just so-so) looked fairly complete concise.  Anyone
agree/disagree?  Looks like I'm going to have to become "Captian
Join-Master".

Thanks!

Show quote
"Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
news:uSF$dPBJFHA.580@TK2MSFTNGP15.phx.gbl...
> John wrote:
> > I'm trying to normalize my database the best I can this time around
> > and I'm running into some trouble.  I've been avoid normalizing for a
> > long time now because while I know how to normalize, I'm weak on SQL
> > strings so populating the database is a pain in the kee... but this
> > is another story...
> >
> > ok, first of all is this a many to many or no?
> >
> > projMain (table)
> > projID (PK)
> > clientID (FK)
> > etc.........
> >
> > ProjWebs (table)
> > webID (PK)
> > projID (FK)
> > stageID (FK) ***
> >
> > SDLC (table)
> > stageID (PK) ***
> > stageName
> > stageDescr
>
> >
> > *** is this a many to many relationship?
>
> The asterisked relationship is a one-to-many relationship. The entire
> 3-table structure is a many-to-many relationship between projMain and
SDLC.
> A many-to-many relationship consists of two one-to-many relationships
> combined via a "bridge" table.
>
>
> > Rather than hard coding
> > SDLC info I'm putting it into a table.  Since many of the records in
> > ProjWebs can relate to many in SDLC and visa versa, this is many to
> > many, yes?  If so, how can I create One to Many without make a
> > seperate table for ALL SDLC stages?
>
> You can't. The only way to implement a many-to-many relationship is to use
a
> bridge table. From what you are saying, it sounds as if it's the right
thing
> to do. Don't shy away because it's a little work. :-)
>
>
> projMain (table)
> projID (PK)
> clientID (FK)
> etc.........
>
> ProjWebs (table)
> webID (PK)
> projID (FK)
>
> WebStage (table)
> webID (PK)(FK)
> stageID (PK)(FK)
>
> SDLC (table)
> stageID (PK)
> stageName
> stageDescr
>
> Bob Barrows
> --
> Microsoft MVP -- ASP/ASP.NET
> Please reply to the newsgroup. The email account listed in my From
> header is my spam trap, so I don't check it very often. You will get a
> quicker response by posting to the newsgroup.
>
>

AddThis Social Bookmark Button