Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Database Design

Database Design

Scheduled Pinned Locked Moved Database
databasedesignhelptutorial
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    Gjm
    wrote on last edited by
    #1

    I am developing an ecommerce website, aimed at selling electronic products. So for storing the product details I use a product table in which I have the fields for storing the product specifications. My problem is how to include the specifications of different products like motherboard, mouse, Monitor in a single table (product table). How should I design the product table to hold the specifications of different products. Suggest me a good database design for this problem.

    D R 2 Replies Last reply
    0
    • G Gjm

      I am developing an ecommerce website, aimed at selling electronic products. So for storing the product details I use a product table in which I have the fields for storing the product specifications. My problem is how to include the specifications of different products like motherboard, mouse, Monitor in a single table (product table). How should I design the product table to hold the specifications of different products. Suggest me a good database design for this problem.

      D Offline
      D Offline
      dan sh
      wrote on last edited by
      #2

      You can have two tables like this: In product table: ProductId ProductName ProductType and in ProductTypeCodes: ProductTypeCode ProductType

      50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!

      1 Reply Last reply
      0
      • G Gjm

        I am developing an ecommerce website, aimed at selling electronic products. So for storing the product details I use a product table in which I have the fields for storing the product specifications. My problem is how to include the specifications of different products like motherboard, mouse, Monitor in a single table (product table). How should I design the product table to hold the specifications of different products. Suggest me a good database design for this problem.

        R Offline
        R Offline
        riced
        wrote on last edited by
        #3

        You need to think about the data - I'd get plenty of examples and see how they look - what attributes define a particular product for example. A possible suggestion is two tables: one to hold products and the other to hold attributes. This is a simplified example of this approach.

        Product Table

        ProductID
        ProductName
        ProductType

        Attribute Table

        AttributeID
        ProductID
        Attribute
        Value

        Examples:
        Products
        1, LG XYZ, TFT Monitor
        2, AX-999, Motherboard

        Attributes
        1, 1, Screen Size, 22
        2, 1, Colour, Black
        3, 2, CPU Type, AMD
        4, 2, PCI Sockets, 3

        You need to link the tables. Also this is probably too simplistic - think about the units for attributes. Some will numeric others strings.

        Regards David R --------------------------------------------------------------- "Every program eventually becomes rococo, and then rubble." - Alan Perlis

        G 1 Reply Last reply
        0
        • R riced

          You need to think about the data - I'd get plenty of examples and see how they look - what attributes define a particular product for example. A possible suggestion is two tables: one to hold products and the other to hold attributes. This is a simplified example of this approach.

          Product Table

          ProductID
          ProductName
          ProductType

          Attribute Table

          AttributeID
          ProductID
          Attribute
          Value

          Examples:
          Products
          1, LG XYZ, TFT Monitor
          2, AX-999, Motherboard

          Attributes
          1, 1, Screen Size, 22
          2, 1, Colour, Black
          3, 2, CPU Type, AMD
          4, 2, PCI Sockets, 3

          You need to link the tables. Also this is probably too simplistic - think about the units for attributes. Some will numeric others strings.

          Regards David R --------------------------------------------------------------- "Every program eventually becomes rococo, and then rubble." - Alan Perlis

          G Offline
          G Offline
          Gjm
          wrote on last edited by
          #4

          thanks

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups