0

Im very new to mysql, and any help would be much appreciated!

I have my main table with product information. (9000+ products)

    id       name          size     color
    9809355  product one   small    blue
    0109425  product two   large    black

I also have cron script that that gets the following data of each product every hour (from ebay or amazon):

    id       price     timestamp
    9809355  $672.00   07/26/2012 @ 2:00pm
    0109425  $82.00    07/26/2012 @ 2:00pm

(prices are allways changing)

What is the best way to store this data?

my options seem to be creating a table for each product, or placing all my data into one table for product prices.

4

1 回答 1

-1

为每个产品创建一个表格很少是正确的方法。这会不必要地使连接复杂化——如果您想获得所有产品的列表,您将如何使用单独的表来实现呢?

如果您想将价格数据与价格明细分离,您可以创建一个与产品信息表具有一对一关系的价格表。我一般不提倡一对一的关系,但有时这是正确的方法。

于 2012-07-26T19:00:42.103 回答