I have three tables –
Transaction:
ID TimeStamp
Discount:
Code Amount
Transaction_Discount:
ID Code
It’s almost as basic as you can get.
Is there a more ‘efficient’ way to link these tables together?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you are modelling a transaction can have 0 or more discounts and a discount can be applied to 0 or more transactions then this 3 table approach is the standard way to go.
The only change I would make would be to give discount a numeric primary key in addition to the code field and use this as the foreign key in Transaction_Discount.