db with loan types and matrix