RogerCooper
Registered User.
- Local time
- Today, 06:09
- Joined
- Jul 30, 2014
- Messages
- 284
I have a business requirement that poses an interesting design question. My company makes dyes that detect leaks in fluid systems. All chemicals require an SDS (Safety Data Sheet) that specifies safety information about that chemical. The SDS is produced by specialized software, so I need to do is keep track of the link to where it is stored on our drive. The typical use of this information is to print out all the SDS's required for a specific order.
The complication is that sometimes we sell products which are kits containing multiple dyes, each with its own SDS. So the question is what is the best way to keep track of this.
Approach #1 Create a double-keyed table called PRODUCT_COMPONENT which relates the product numbers with the individual components for the kits only. To print the SDS I would need to combine 2 queries, one for the kits and another for non-kit products
Approach #2 Create a double-keyed table called PRODUCT_COMPONENT for all products, kits or not. If the product is not a kit, the value of COMPONENT will be the same the value of PRODUCT. To print the SDS's I would have query that links PRODUCT_COMPONENT with the table that stores information fields about our products,
Approach #1 has less data entry.
Approach #2 avoids need for left joins and iif's. It also easier to validate as I can easily test that all saleable products have at least 1 entry in PRODUCT_COMPONENT.
Which approach is better. I am leaning towards approach #2 as in most cases I can identify automatically non-kits by their description and populate PRODUCT_COMPONENT.
The complication is that sometimes we sell products which are kits containing multiple dyes, each with its own SDS. So the question is what is the best way to keep track of this.
Approach #1 Create a double-keyed table called PRODUCT_COMPONENT which relates the product numbers with the individual components for the kits only. To print the SDS I would need to combine 2 queries, one for the kits and another for non-kit products
Approach #2 Create a double-keyed table called PRODUCT_COMPONENT for all products, kits or not. If the product is not a kit, the value of COMPONENT will be the same the value of PRODUCT. To print the SDS's I would have query that links PRODUCT_COMPONENT with the table that stores information fields about our products,
Approach #1 has less data entry.
Approach #2 avoids need for left joins and iif's. It also easier to validate as I can easily test that all saleable products have at least 1 entry in PRODUCT_COMPONENT.
Which approach is better. I am leaning towards approach #2 as in most cases I can identify automatically non-kits by their description and populate PRODUCT_COMPONENT.