• 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