开发者

Find out the Product Sold

开发者 https://www.devze.com 2023-01-25 22:16 出处:网络
I have a query regarding a table structure.We are using single SQL SERVER 2008 Database for two online selling websites.i.e.,The products which the two websites uses are same,but the description about

I have a query regarding a table structure.We are using single SQL SERVER 2008 Database for two online selling websites.i.e.,The products which the two websites uses are same,but the description about the products are different.For example,we will sell a "Toy" of same price and model on both websites but with different description.At present I used two different id for websites say,Id "1" for Website 1 and Id as "2" for website 2.And also populated the Product table with diiferent Id's for same product along with the description and website id. Now the problem is I need to find out how man开发者_StackOverflow社区y "Toy" has been sold out in both websites together. Can any one help me out?Should I introduce a separate table structure to relate the Productid?


It seems to me your choices are

  • minimal change to achieve your purpose
  • produce a properly normalised design

A minimal change might be that table you propose

A normalised design might be

product
  code
  standard_description
  standard_price

website
  code
  description

website_product
  website_code
  product_code
  description
  price

order
  id
  website_code
  ...

order_line
  order_number
  line_number
  product_code
  quantity
  ...

That way the same product has the same code on both websites but you can have differing descriptions (and prices if necessary)

0

精彩评论

暂无评论...
验证码 换一张
取 消