help with FOREIGN KEY

  • hello friend, i get 3 tables,

    T1 with fields a and b

    T2 with fields c,d and a1 references to a in T1

    T3 with fields e,f references to c in T2, another field g references to a in T1, my question: do i need to create the constraint in T3 in the field g? because T3 reference to T2 and T2 to T1 with the field a, so T2 checks the values of the field a in T1, T3 does not need checks these values, is true?

    thank you

  • Does your business logic require that g in T3 only contain values that match those in T1 field a?

    Or is it OK to have values in g in T3 that do not match the values in a in T1?

    With the references you describe, it seems that:

    T1

    A - Primary Key

    B - Data Field

    T2

    A1 - Foreign Key (To A in T1)

    C - Primary Key

    D - DataField

    T3

    E - Data Field

    F - Foreign Key (To C in T2)

    G - possible Foreign Key to A in T1

    Is this correct?

    If your not gonna help, Please move to the side, because if your not helping the situation, your hurting it....

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply