January 8, 2018 at 9:14 pm
Dear Experts,
I would to know your valuable suggestions for requirement as mentioned below.
Most of the products delivered using packing box and few without box (use wrapping).
Each packing box suites for few products but each product will have only one packing box only.
Which sample suites best?
/* Sample 1
Packing Box:
PackingBoxID (PK), BoxNumber (UQ), Length, Width, Height, Gross Weight
Product:
ProductID (PK), ProductNumber (UQ), ...,PackingBoxID
*/
/* Sample 2
Packing Box:
PackingBoxID (PK), BoxNumber (UQ), Length, Width, Height, Gross Weight
Product:
ProductID (PK), ProductNumber (UQ), ...,
ProductPackingBox:
ProductID, PackingBoxID
*/
Thank you.
January 9, 2018 at 6:36 am
Correct me if I'm wrong, but a given product will have multiple instances. Let's assume a can of oil. We can define all the properties about that can of oil, but, we don't have one can that we put into a shipping box. We have lots of cans that go into lots of shipping boxes. Based on that, you probably need some sort of Inventory table (or maybe just a counter on the Product table, disagreement can be had here) that defines what you're shipping. Then, the second design, multiple products to multiple shipping boxes, makes more sense.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
January 9, 2018 at 6:49 am
Sample 2
January 9, 2018 at 7:45 am
kiran 4243 - Monday, January 8, 2018 9:14 PMDear Experts,I would to know your valuable suggestions for requirement as mentioned below.
Most of the products delivered using packing box and few without box (use wrapping).
Each packing box suites for few products but each product will have only one packing box only.
Which sample suites best?/* Sample 1
Packing Box:
PackingBoxID (PK), BoxNumber (UQ), Length, Width, Height, Gross Weight
Product:
ProductID (PK), ProductNumber (UQ), ...,PackingBoxID
*//* Sample 2
Packing Box:
PackingBoxID (PK), BoxNumber (UQ), Length, Width, Height, Gross Weight
Product:
ProductID (PK), ProductNumber (UQ), ...,
ProductPackingBox:
ProductID, PackingBoxID
*/Thank you.
If a particular product is always delivered in the same box type, one product per box, then PackingBoxID is an attribute of the Products table.
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply