MySQL Forums
Forum List  »  Newbie

Re: would like to make primary key the product of two indices, 2 questions...
Posted by: Paul Kagan
Date: April 15, 2021 07:42AM

Also as far as the word product I believe I mean it in the usual math sense of the word. My diction comes from England, I base my english on the Oxford English Dictionary.

I do not have permission to copy the dictionary verbatim but I will give a summation in my own words.

product - noun, the primary broad definition: derived from Mathematics - derivation of data sets obtained by process of combination (copyright Oxford English dictionary).

Thus by taking a table of SKUs that contains the Item Name, Manufacturer, etc. and combining it with a table of product orders, it is the product of the two tables in a sense that derives a third table of inventory.

For example:

Item Names:

Sku : Water-500ml 500 ml of your favorite brand of water that is a house brand with parameters that you decide.

Purchase Orders:
Order #123 on Monday from store ABC
Order #456 on Tuesday from store DEF

Product of the two tables is:
Item Names Purchase Order Number
Water-500ml 123
Water-500ml 456

Now with this new table resulted from the product we can apply addition information to the resultant table: Inventory.

Item Names Purchase Order Number Quantity Purchased
Water-500ml 123 3 cases
water-500ml 456 1 case

if you want to determine how many cases were purchased on Tuesday for example.

Select Quantity Purchased from Inventory
where Purchase Order Number IN (Select Purchase Order Number from Purchase Orders where Date = "Tuesday");

something like this, hopefully my understanding is correct or thereabout , nevertheless I feel my command of the English language is strong and native.

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.