Relationship between maintable and subtable

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mseo
    New Member
    • Oct 2009
    • 183

    Relationship between maintable and subtable

    hi
    I have two tables and I have not assigned any PK or FK yet because I need any suggestion
    tbl_salesreturn s

    ReturnreceiptNo
    Customer_ID
    Date

    tbl_salesReturn sdetail

    ReturnreceiptNo
    Product_ID
    Quantity
    UnitPrice

    I need to make the relationship to be like:
    suppose that I have 2 customers and they returned products, the first customer has return receipt No 1052, and after a period of time the second customer returned products with receipt No 1052

    in tbl_sales returns: More than one customer may has the same ReturnReceiptNo (the number of the receipt), that means that the ReturnReceiptNo could be entered into the table for each customer, so the ReturnReceiptNo couldn't be as PK.
    in tbl_sales Returns detail: each ReturnReceiptNo has more than one product, but I want to prevent the duplication in the products within the same receipt.
    I appreciate your help
Working...