table relationships

Discussion in 'ASP General' started by John, Mar 8, 2005.

  1. John

    John Guest

    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!
     
    John, Mar 8, 2005
    #1
    1. Advertising

  2. 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.
     
    Bob Barrows [MVP], Mar 8, 2005
    #2
    1. Advertising

  3. John

    John Guest

    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!

    "Bob Barrows [MVP]" <> wrote in message
    news:uSF$...
    > 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.
    >
    >
     
    John, Mar 10, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Steve
    Replies:
    0
    Views:
    718
    Steve
    Feb 29, 2004
  2. =?Utf-8?B?T3plcg==?=

    2 tables and 2 relationships in a datagrid

    =?Utf-8?B?T3plcg==?=, Jun 13, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    325
    Craig Deelsnyder
    Jun 14, 2004
  3. Darren Clark

    accessing typed dataset relationships?

    Darren Clark, Jun 17, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    2,465
    Darren Clark
    Jun 17, 2004
  4. cvchen
    Replies:
    1
    Views:
    369
    Cy Edmunds
    Oct 29, 2003
  5. et

    table relationships

    et, Dec 28, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    145
    Jason
    Dec 28, 2004
Loading...

Share This Page