Results 1 to 7 of 7
  1. #1
    Join Date
    Feb 2008
    Posts
    120

    Unanswered: Database design question

    hi all...
    I have a database that runs my e-commerce site.
    I want to build similar sites running off the same database.
    Each site will pull the products from the same table, but not all sites will display all the products.
    I need some kind of checkbox in my admin to turn products on and off for each site.

    What would be the best database design method to achieving this?

    Thanks in advance
    Andy

  2. #2
    Join Date
    Jul 2011
    Location
    India
    Posts
    13
    Hi,
    if your products is belongs to some group then u need to take one table in which group id and url/id of url will be there .it will work like flag for on or off for url.

    all the best

  3. #3
    Join Date
    Feb 2008
    Posts
    120
    Hi pasthana@netlink
    My products table doesn't belong to any group! Im not sure what you mean by that.

    My Product table contains the following fields:
    ProductID
    CategoryID
    ManufacturerID
    Product_Title
    Description
    Price
    Image

    Andy

  4. #4
    Join Date
    Jul 2011
    Location
    India
    Posts
    13
    hi,
    groupid was just a exaple .u can use categoryid instead

  5. #5
    Join Date
    Feb 2008
    Posts
    120
    now im even more confused, sorry!
    I just need the logic on how to display or not display products on each site.
    Sorry if im confusing things

    Andy

  6. #6
    Join Date
    Apr 2008
    Location
    Iasi, Romania
    Posts
    561
    Provided Answers: 2
    You may:

    Add a GroupID column to the Product table

    Create a Group table: GroupID, GroupName
    Create a Site table: SiteID, SiteName
    Create a GroupSite table: GroupSiteID, GroupID, SiteID

    SELECT ... -- your columns
    FROM Product, Group, Site, GroupSite ... -- join conditions
    WHERE Site.SiteID = siteID
    Florin Aparaschivei
    DB2 9.7, 10.5 on Windows
    Iasi, Romania

  7. #7
    Join Date
    Nov 2004
    Posts
    1,427
    Provided Answers: 4
    Each site will pull the products from the same table, but not all sites will display all the products.
    I need some kind of checkbox in my admin to turn products on and off for each site.
    If the category of a product, like 'T-shirt', is enough to deduct if it is displayable on a site or not (e.g. On on a Clothes e-commerce, Off on a Food e-commerce), I'd go with the given solution of a cross table with the columns CategoryID and SiteID. (I think GroupID is a typo in the given solution.)

    If you need finer control, like only show 'XXXL'-size T-shirts on a Large-size e-commerce, you will have to use a cross table with the columns ProductID and SiteID. The price will be the extra work to maintain the lists, as there will be more products than categories, the gain is much finer control.
    With kind regards . . . . . SQL Server 2000/2005/2012
    Wim

    Grabel's Law: 2 is not equal to 3 -- not even for very large values of 2.
    Pat Phelan's Law: 2 very definitely CAN equal 3 -- in at least two programming languages

Posting Permissions

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