Associate two tables in a single field with a foreign key

Viewed 15

I am trying to create a relational database model in MySQL that will allow me to save a transaction record that will contain the origin and destination of the money. I have the income table (which will always be a source), I also have the expenses table (which will always be a destination) but I want the destination to be an expense or another income. I was thinking of using foreign keys but I can't associate the two tables to the same target field. What I can do? The idea is to have something like this: table example

0 Answers
Related