Sobes.tech
Middle

Database design for an MVP mortgage bank: tables, keys, fields, relationships considering co-founders.

sobes.tech AI

Answer from AI

For an MVP bank with a mortgage and co-borrowers, you can design a database with the following main tables:

  • Customers: CustomerID (PK), FirstName, LastName, DOB, ContactInfo
  • Loans: LoanID (PK), LoanType, Amount, InterestRate, StartDate, EndDate
  • Properties: PropertyID (PK), Address, EstimatedValue
  • LoanApplications: ApplicationID (PK), CustomerID (FK), LoanID (FK), Status
  • CoBorrowers: many-to-many relationship between LoanApplications and Customers

Relationships:

  • One customer can have multiple applications.
  • An application can have multiple co-borrowers (including the primary borrower).
  • Each application is linked to a specific loan.
  • A loan can be secured by one or multiple properties.

Example table for co-borrowers:

CREATE TABLE CoBorrowers (
  ApplicationID INT,
  CustomerID INT,
  PRIMARY KEY (ApplicationID, CustomerID),
  FOREIGN KEY (ApplicationID) REFERENCES LoanApplications(ApplicationID),
  FOREIGN KEY (CustomerID) REFERENCES Customers(CustomerID)
);

This design allows flexible accounting for multiple co-borrowers and linking them to specific mortgage applications.