table relationships

J

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!
 
B

Bob Barrows [MVP]

John said:
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
 
J

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top