0

I have a database where the columns in one of the tables are:

UPC, SKU, AliasOf, Quantity

123456789123, 123456789123a, null, 6

123456789123, 123456789123b, 123456789123a, 0

123456789123, 123456789123c, 123456789123a, 0

123456789123, 123456789123d, 123456789123a, 0

First question ever, thanks in advance :)

How can I set up the table, where when the quantity "6" is inserted on the top sku, that the quantity is updated on the 3 aliased skus ...

really, I want to make them all a group, and for any inventory change on any of the group to change the inventory for the entire group.

I have no idea what to do :)

Pacifico
  • 1
  • 1
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community May 30 '23 at 05:17
  • Simply create an `aliases` table with 2 columns - primary ID and foreign key to the aliased SKU. Then each time you add or remove inventory - you will insert a positive or negative quantity in the `transactions` table which will use a foreign key to reference the `aliases` table. Thus, using this indirection through the `aliases` table your transactions can always be mapped to the original (leading/primary) SKU of the given group. – IVO GELOV May 30 '23 at 06:43

0 Answers0