Table relationships in Access database design-


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Table relationships in Access database design-

  1. #1
    Marcus Koontz Guest

    Table relationships in Access database design-


    I'm trying to design a database for a daycare, I keep running into problems
    with the relationship part of the development. I'm trying to have four fields
    in one table that have a relationship with the primary key in another table,
    say for example the table is called "Family" and it has four fields name
    respectivly "parent1ID, parent2ID, parent3ID, parent4ID" and then four other
    fields named "child1ID, child2ID, child3ID, child4ID" with an identifying
    primary key "familyID". I want the four "parentID" keys to relate to another
    tables primary key "ParentID" and the four "childID" to relate to another
    tables primary key "ChildID". I'm having a problem because i don't know how
    to directly relate four keys with the same relationship to another tables
    primary key. I'm kind of confused. I'm in the database design phase... so
    please email me with ANY help you can .. spotalk@spokanewebtalk.com .. PLEASE
    HELP!!??!!??!!

  2. #2
    Marcus Koontz Guest

    Re: Table relationships in Access database design-


    Also.. how can i relate the tables so that the primary keys automatically
    put the information in the related tables?
    "Marcus Koontz" <spotalk@spokanewebtalk.com> wrote:
    >
    >I'm trying to design a database for a daycare, I keep running into problems
    >with the relationship part of the development. I'm trying to have four fields
    >in one table that have a relationship with the primary key in another table,
    >say for example the table is called "Family" and it has four fields name
    >respectivly "parent1ID, parent2ID, parent3ID, parent4ID" and then four other
    >fields named "child1ID, child2ID, child3ID, child4ID" with an identifying
    >primary key "familyID". I want the four "parentID" keys to relate to another
    >tables primary key "ParentID" and the four "childID" to relate to another
    >tables primary key "ChildID". I'm having a problem because i don't know

    how
    >to directly relate four keys with the same relationship to another tables
    >primary key. I'm kind of confused. I'm in the database design phase... so
    >please email me with ANY help you can .. spotalk@spokanewebtalk.com .. PLEASE
    >HELP!!??!!??!!



  3. #3
    Douglas J. Steele Guest

    Re: Table relationships in Access database design-

    I'm afraid you have a misconception about how relational databases work.

    Relationships don't "put the information in the related tables": they're
    there to enable you to have relational integrity.

    And having repeating groups in a table (parent1ID, parent2ID, parent3ID,
    parent4ID or child1ID, child2ID, child3ID, child4ID) is a sure sign that
    your database hasn't been properly normalized.

    First, I don't believe that Parents and Children are really two separate
    entities. Don't forget that every parent is also a child (even if you don't
    care about that particular relationship in your application). I'd have a
    single entity for both (call it Person, with PersonID as the PK. Include a
    ParentFG in it if you want)

    You should have a Family table that has FamilyID as its PK. You should then
    have a FamilyMembership table that has two columns: FamilyID and PersonID.
    You end up with one row in the FamilyMembership table for every person in
    that family.

    Of course, this is only one approach. However, I'd suggest you get a good
    book on database design, or check out some of the following references to
    learn more about database normalization:

    http://www.webmasterbase.com/article.php/378
    http://www.jpmartel.com/bu12_c.htm

    ACC2002: Database Normalization Basics (Q283878)
    http://support.microsoft.com/default...;EN-GB;q283878
    ACC2000: Database Normalization Basics (Q209534)
    http://support.microsoft.com/default...;en-us;Q209534
    ACC: Database Normalization Basics (Q100139)
    http://support.microsoft.com/default...;en-us;Q100139

    HTH

    --
    Doug Steele, Microsoft Access MVP
    http://I.Am/DougSteele


    "Marcus Koontz" <spotalk@spokanewebtalk.com> wrote in message
    news:3ca550ab$1@10.1.10.29...
    >
    > Also.. how can i relate the tables so that the primary keys automatically
    > put the information in the related tables?
    > "Marcus Koontz" <spotalk@spokanewebtalk.com> wrote:
    > >
    > >I'm trying to design a database for a daycare, I keep running into

    problems
    > >with the relationship part of the development. I'm trying to have four

    fields
    > >in one table that have a relationship with the primary key in another

    table,
    > >say for example the table is called "Family" and it has four fields name
    > >respectivly "parent1ID, parent2ID, parent3ID, parent4ID" and then four

    other
    > >fields named "child1ID, child2ID, child3ID, child4ID" with an identifying
    > >primary key "familyID". I want the four "parentID" keys to relate to

    another
    > >tables primary key "ParentID" and the four "childID" to relate to another
    > >tables primary key "ChildID". I'm having a problem because i don't know

    > how
    > >to directly relate four keys with the same relationship to another tables
    > >primary key. I'm kind of confused. I'm in the database design phase... so
    > >please email me with ANY help you can .. spotalk@spokanewebtalk.com ..

    PLEASE
    > >HELP!!??!!??!!

    >




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center