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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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 '14 at 12:10
The FK can be nullable, and then when the Transaction is created, it can be updated. – AlwaysLoadingData Apr 24 '14 at 13:06
I will try this , thanks for reply me – user3423060 Apr 24 '14 at 13:23
A Nullable FK almost certainly indicates that the FK relationship is backward. To make a blanket statement such as you did, with out an indication of which business rules that model supports and which it doesn't, is way out of line. – Pieter Geerkens Sep 2 '14 at 2:08

Your Answer


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.