Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I have database which that store the sold products in Orders Table and another table called Transaction to set the time and the total price for the individual order ,my question is: How to combined more than one order with only one Transaction number , If there is any tables that I should to create or any thing to do to achieve the desired result. Thanksenter image description here

share|improve this question

1 Answer 1

It looks like you're most of the way there, but the Foreign Key should go the other way around. The Orders table should have a FK reference to Transaction. This allows a Transaction to be connected to 1 or more Orders.

share|improve this answer
    
How I can use Transaction P.K. as a F.K. at Orders programmatically, Orders Table is filled first then will Transaction Table! –  user3423060 Apr 24 at 12:10
    
The FK can be nullable, and then when the Transaction is created, it can be updated. –  AlwaysLoadingData Apr 24 at 13:06
    
I will try this , thanks for reply me –  user3423060 Apr 24 at 13:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.