Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2005
    Posts
    3

    Unanswered: SQL Server Design Issue

    Hi Folks,

    First post here so hope somebody can be of some help.

    I have a table of product information from manufacturers, which has a number of child tables etc. It's basically a collection of tables, related, that contain product information for around 100,000 products.

    We also have a table with a list of products that are for sale. Of course, every row isn't going to match so I can't create a PK->FK relationship.

    Does anybody have any ideas on a design solution? I'm pretty sure the solution is very simple and I've just overlooked it.

    Kind Regards

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    i think the solution is to set up a PK-FK relationship
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    follow the link below

    http://weblogs.sqlteam.com/brettk/ar...5/25/5276.aspx

    You have a table that has the items for sale?

    Why not just have an indicator on the other table?
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  4. #4
    Join Date
    Sep 2005
    Posts
    3

    Solved

    Hi There,

    Thanks for your reply. I solved the problem, was pretty much staring me in the face; by setting up an intermediate entity between the items for sale, and the table with the product information that had the 2 FK columns. Thereby the searches commence on the product catalogue and if additional information is needed an INNER JOIN can be used through the intermediate entry which contains the corresponding rows. I'm not over-joyed about adding another relation but as every search on the products table won't result in the join being used (e.g. this tuple will only ever be used when additional information is needed) it's not so bad.

    Thanks again,

    Shaun


    Quote Originally Posted by Brett Kaiser
    follow the link below

    http://weblogs.sqlteam.com/brettk/ar...5/25/5276.aspx

    You have a table that has the items for sale?

    Why not just have an indicator on the other table?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •