1 Replies - 347 Views - Last Post: 24 September 2013 - 11:06 AM Rate Topic: -----

#1 teyrebaz  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 19
  • Joined: 14-January 12

Different properties of categories

Posted 24 September 2013 - 10:18 AM

img : http://prntscr.com/1t7eeu

Posted Image

as an example i've got two different ss from an ecommerce site. if you check the image there is two different category ( notebook, LED TV ) and different properties of categories. i.e;

notebook(category)
-memory (property)
-processor type (property)
-brand (property)
-brand of processor (property)

led tv(category)
-screen size (property)
-brand (property)
-type (property)

How we can implement such as structure on db? i've implement like this;

category(table)
-id

properties(table)
-id
-name

category.property(table)
-id
-catid(fk)
-propid(fk)

product(table)
-id

product.property
-category.propertid(fk)
-productid(fk)
-value( this is value of property)

tough my approach is seeming awkward.

thanks in advance.


* img's language is not english but you can see differences, i also translated some of them.

Is This A Good Question/Topic? 0
  • +

Replies To: Different properties of categories

#2 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 9204
  • View blog
  • Posts: 34,582
  • Joined: 12-June 08

Re: Different properties of categories

Posted 24 September 2013 - 11:06 AM

I would figure you would have a 'product' table. From there you would have a table product properties.. then you would have a table matching up products to properties and supplying a numeric/varchar value.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1