I have a form for an invoice creation and my task is that I want a user to be able to limit a customer's selection of data from a database based on selections the user has previously made.
My constraints are that each company has access to all products but the price for the same product will be different for different companies. Also each product may come in different sizes, which will have different prices.
Need help understanding the logic behind creating the connections between these classes.
For instance my entities:
Company (attributes: CustID, Name, ShipTo, SoldTo, City, State, ZipCode)
Product (attributes: UN, Name, Hazard, Packing Class, Grade, Weight, Unit Type)
Now each product can come in many sizes, and each size has many products associated with it. So I created a junction table titled Type
with attributes Size
and UN
and linked in the Product and Type table together.
Then I created another junction because each company could have the same product and each product could be sold to many companies, and titled it CustProduct
with attributes CustID
and UN
and linked it to Product table and Company Table.
Now I'm getting confused, how and where do I create a relationship that will allow link a unique price to product
with a determinable size
sold to a specific Company
? Banging my head on this.
From what you're saying, here is what I think:
This means that each company can specify the price for each size of each product.
I hope that helps.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.