Skip to content
Advertisement

Tag: foreign-keys

A count of ForeignKey

I have class Team, which means a group of users. And the relation with User is One-to-Many. But Team may consist of 2 and N members. I think to write manually is not our way, because it depends on count of people which is always variable. How can I do it more elegant and rational? I mean to connect count

If a table has columns equal to columns in a second table insert values in a third table, python – mysql

I have 3 table in my database: Borrowers: amount of the loan, interest rate, borrower id (PK) Lenders: amount of the bid, interest rate and LenderID (PK) Contracts: ContractID PK, amount, interest rate and the two foreign key(borrowerID, lenderID) I create a loop in python with an input command in which I can insert new request of loan and new

Advertisement