SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Schema Design - Product Packing Box


Schema Design - Product Packing Box

Author
Message
kiran 4243
kiran 4243
SSC-Enthusiastic
SSC-Enthusiastic (127 reputation)SSC-Enthusiastic (127 reputation)SSC-Enthusiastic (127 reputation)SSC-Enthusiastic (127 reputation)SSC-Enthusiastic (127 reputation)SSC-Enthusiastic (127 reputation)SSC-Enthusiastic (127 reputation)SSC-Enthusiastic (127 reputation)

Group: General Forum Members
Points: 127 Visits: 135
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.
Grant Fritchey
Grant Fritchey
SSC Guru
SSC Guru (236K reputation)SSC Guru (236K reputation)SSC Guru (236K reputation)SSC Guru (236K reputation)SSC Guru (236K reputation)SSC Guru (236K reputation)SSC Guru (236K reputation)SSC Guru (236K reputation)

Group: General Forum Members
Points: 236424 Visits: 33634
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

The Scary DBA
Author of: SQL Server Query Performance Tuning and SQL Server Execution Plans
Product Evangelist for Red Gate Software
Mike Good
Mike Good
SSCarpal Tunnel
SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)

Group: General Forum Members
Points: 4134 Visits: 1109
Sample 2



ChrisM@Work
ChrisM@Work
SSC Guru
SSC Guru (102K reputation)SSC Guru (102K reputation)SSC Guru (102K reputation)SSC Guru (102K reputation)SSC Guru (102K reputation)SSC Guru (102K reputation)SSC Guru (102K reputation)SSC Guru (102K reputation)

Group: General Forum Members
Points: 102994 Visits: 20820
kiran 4243 - Monday, January 8, 2018 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.


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.

“Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

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
Exploring Recursive CTEs by Example Dwain Camps
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search