【问题标题】:How to create stock management如何创建库存管理
【发布时间】:2012-09-18 20:55:59
【问题描述】:

我目前正在创建一个拍卖网站,应该可以在其中创建一种或多种产品的拍卖。这应该通过一些不同的产品变体来管理。

我的问题是,我不确定我是否构建了用于处理库存管理的最佳 MySQL 结构。这是我的数据库的外观:

属性 属性值 组合 组合零件

这里我会有以下连接:

Attributes is the "main" name of the attribute - e.g. "Size", "Colour" or so. This has a
ProductID (connecting it to a product).

AttributeValues is the value - e.g. "43", "44", "45"... 
I connect this to Attributes on a field called AttributeID.

然后我将创建一些组合 - 例如如果鞋子有更多的属性,就会进行组合。

Combinations has the name and stock of the product - connected 
to a product on ProductID
- e.g. "Nike shoe, red, 43" or "T-shirt, blue, Large".

CombinationParts is then connecting to a product with an AuctionID and then 
to a AttributeValue with AttributeValueID.

编辑:我将库存与每种产品联系起来的原因是,我需要将更多产品与拍卖联系起来

这个想法是,当您创建拍卖时,您输入每种类型的数量,即有库存。

我的问题是我是否可以让同样的事情变得更容易?换句话说:当我需要将我的网站扩展到可能包含 25,000 种产品时,这是否是最佳选择?

【问题讨论】:

    标签: mysql database-design stock


    【解决方案1】:

    当可能的属性集未知时,拥有一个键-键-值表(产品 X、“品牌”、“耐克”)是处理属性和值的好方法。有时查询时可能会很笨拙,但它更容易维护。

    【讨论】:

      猜你喜欢
      • 2017-05-05
      • 1970-01-01
      • 2014-07-06
      • 1970-01-01
      • 2012-08-26
      • 2012-02-23
      • 1970-01-01
      • 2014-01-13
      • 2012-03-12
      相关资源
      最近更新 更多