Results 1 to 4 of 4
  1. #1
    jsinger is offline Novice
    Windows 8 Access 2013
    Join Date
    Jan 2015
    Posts
    6

    Buyers and sellers - one table or two?


    Not sure if this is a newbie question or not. I used to be pretty good at Access but it has been many years, so....
    I need to set up an application to match up buyers and sellers.
    Each buyer has a list of things he wants to buy, and each seller has a list of things he wants to sell.
    I want to match up buyers and sellers based on how many items they have in common - for instance, seller #17 wants to sell cats, dogs, hamsters and guinea pigs. Buyer #6 wants to buy guinea pigs, turtles, hamsters, goldfish and cats. They have 3 items in common so they are a pretty good match.
    For some reason I can't decide conceptually how to set up the database - should buyers and sellers be in the same table? It seems as though they should be in two different tables, but I can't figure out what the relationship between the tables should be.
    Ideas?
    TIA

  2. #2
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    You have a many-to-many relationship here. I think you need 5 tables:

    tblSeller
    tblSellerProduct ' each seller has one or more products
    tblBuyer
    tblBuyerProduct ' each buyer is looking for one or more products

    The fifth table is the join table, where you would join tblSellerProduct and tblBuyerProduct on product name or code

    You could have a separate table for products, where you list product details, and use product code in the others.

    Determining best matches on multiple products will require some thought, but it is certainly possible.

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,850
    I'm not sure of the details, but here is a draft model that may be helpful.
    Adjust as necessary to meet your requirements. This model has a common product table which may not be realistic.

    Good luck
    Attached Thumbnails Attached Thumbnails BuyersAndSellers.jpg  

  4. #4
    jsinger is offline Novice
    Windows 8 Access 2013
    Join Date
    Jan 2015
    Posts
    6
    Yup, this is definitely the right direction. The multiple match-ups will require some thought, though. Thanks to both of you.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 06-28-2013, 01:59 PM
  2. Replies: 4
    Last Post: 08-30-2012, 07:58 PM
  3. Replies: 8
    Last Post: 03-22-2012, 08:48 AM
  4. Replies: 2
    Last Post: 08-01-2011, 11:35 PM
  5. Replies: 2
    Last Post: 10-27-2009, 07:09 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums