问题
I have two database tables "Users" and "Transactions" where the "Transactions" table looks like below. The "Transactions" table has a record of each transaction between two accounts where the differentiator is "senderAccount" and "recipientAccount" columns.
id | transactionId | senderAccount | recipientAccount | Amount |
—--+---------------+---------------+------------------+--------+
1 | ijiej33 | A | B | 100 |
The relationship between "Users" and "Transactions" is one to many since every user can have multiple transactions, but is the relationship between "Transactions" and "Users" table also many to many since a single record is owned by two users which are the sender and recipient?
来源:https://stackoverflow.com/questions/65870087/sql-database-relationships-unable-to-determine-between-manytomany-and-onetomany