Results 1 to 1 of 1
  1. #1
    Join Date
    Aug 2011

    Unanswered: Relationship between tables


    I am totally confused how to make a relationship for the below mentioned scenario.

    The company is producing products on daily basis following by shift (2 shifts per day). After every shift all the produced pieces will be placed in a crate until the crate is full. once the crate is full then they will prepare a batch for the product so that the batch can proceed to some necessary tests (Bending, Electrical, X-Ray...).

    In some cases after the batch finish a few tests due to shipment the batch will be split as per the requested quantity.

    Production Details:
    Production Date - Shift - Qty
    01/10/2011 - Day - 10
    01/10/2011 - Night - 10
    02/10/2011 - Day - 10
    02/10/2011 - Night - 10
    03/10/2011 - Day - 10
    03/10/2011 - Night - 10

    Batch Details:
    ID Batch No Product StartDate Shift End Date Shift Qty Batch_ID
    1 B-X01 ABC 01/10/2011 Day 02/10/2011 Night 40 0

    Split Details:
    ID Batch No Product StartDate Shift End Date Shift Qty Batch_ID
    3 B-X01.01 ABC 01/10/2011 Day 02/10/2011 Night 20 1

    I created a Product_Batch (Batch_No->PK) where i store all the batch details related for a product with a quantity.

    After the batch is split i store the data in the same product_batch table.

    If i call the master batch as parent and split batch as child if the user accidentally delete the parent batch the child batch becoming orphan. so how i can avoid this.

    Please refer to the attachment for the database design and sample record.

    Please help me...
    Thank you.
    Attached Thumbnails Attached Thumbnails Slide1.JPG  

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts