• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How amazon handle product variant ?

 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

would like to know how amazon handle product variant such as :

a product like shirt based on size & color
a product like tv based on inch

or what is the best modelisation up to now for this problem ?
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not sure I understand what you're asking, but each product will have variables. In a relational DB, those might be modeled as attributes.
 
Ivan Krasic
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:I'm not sure I understand what you're asking, but each product will have variables. In a relational DB, those might be modeled as attributes.



i'am trying to modeling something that can handle different product variant but stuck on a complete solution

here what i have done now :

OptionGroups (ID , Name) such (1, size) , (2 , color)
Options (ID , Name , IDOptionsGroups) such (1, Medium , 1) , (2 , Large , 1) , ( 3, Blue, 2)
Product(ID , SKU , ParentSKU , Title , Attriboptions1 , Attriboptions2, price , qte ) such
(1, 20 , null , tshirt , null , null , null , null )
(2, 20_1 , 20 , tshirt , 1 , 3 , 15 , 50 ) #tshirt blue medium

but problem some product can have only one attribut like color or size or so

Thank you
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Use the relation in Relational Database.

Store variants in a table that relate the variants to another table with the base product.
 
Ivan Krasic
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:Use the relation in Relational Database.

Store variants in a table that relate the variants to another table with the base product.



like that ?

OptionGroups (ID , Name) such (1, size) , (2 , color)
Options (ID , Name , IDOptionsGroups) such (1, Medium , 1) , (2 , Large , 1) , ( 3, Blue, 2)

 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you know how to use foreign keys in database tables? The idea is that a column in one table uses the primary key of a row of another table to relate the records. This is why it is called a relational database.

The reference in the column to an id in another table is called a foreign key because it is the id of a different (foreign) table.

For example, your shirt size variants would have a column that contains the id of the base shirt product that it is qualifying. You would have many of these variant rows each relating to the same base product row. This is a many-to-one relationship.
 
Ivan Krasic
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:Do you know how to use foreign keys in database tables? The idea is that a column in one table uses the primary key of a row of another table to relate the records. This is why it is called a relational database.

The reference in the column to an id in another table is called a foreign key because it is the id of a different (foreign) table.

For example, your shirt size variants would have a column that contains the id of the base shirt product that it is qualifying. You would have many of these variant rows each relating to the same base product row. This is a many-to-one relationship.



Hello Bear ,

i think you misunderstand me : i'am 2 years in SQL database : MySQL , Oracle , SQLServer...
i worked with C# , PHP and many others langage

but here it's no problem of primary or foreign key but the concept of how to make variant look like to work with stock

example tshirt medium blue : so when you order that should have to reduce that prduct from stock

my main headache is how to work with product variant which have one unique variant like color , other product which have 2 variant like color & size , others which have 3 variant

how to handle that in database with 1NF

hope you understand me ?
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, that's a complex model because there are interdependencies. For example, blue shirts might not be available in all sizes. This pushes things into a level of modeling that's likely beyond one-to-many relationships. I'd approach this by using a schema modeling notation to understand the relationships.
 
Ivan Krasic
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:Yes, that's a complex model because there are interdependencies. For example, blue shirts might not be available in all sizes. This pushes things into a level of modeling that's likely beyond one-to-many relationships. I'd approach this by using a schema modeling notation to understand the relationships.



Yes i have been trying 4 days alone to solve that as i'am familiar with database design

but seem to be more advanced for me this case

any idea ?

i also was looking for that explanation but not 100% luck to get final answer

http://www.amazon.com/gp/help/customer/display.html/?nodeId=200779220
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic