I'm currently having problems in designing a database for a loan project. This is my current design:

[IMG]http://img264.imageshack.us/img264/4396/coopdbjx7.png[/IMG]

("member_int" is supposed to be member_id. The software I'm using cropped it. :( )

Here is what the relationship should be:

  • A member can have 0 or more loans
  • A loan can be owned by one and only one member
  • A loan should have three and only three comakers
  • A comaker must be a member...
  • ..so a member may or may not be a comaker for a certain loan

I hope someone could help me. Thank you very much.

Just thinking about this real quick...
1) You need an Member entity
2) You need a Loan entity
3) There is one 1-many relationship from Loan to Member to support the Loan Owner relationship
4) There is one many-to-many relationship from Loan to Member to support the Loan Comaker relationship.
5) The short_term_loan_comakers entity you have is not necessary and, instead, the Member entity needs to be joined directly to short_term_loan_comakers_short_term_loan entity. You can determine if a Member is a comaker by seeing if there is any record of him in the short_term_loan_comakers_short_term_loan entity. There is nothing "wrong" with using short_term_loan_comakers entity, I just think it's not necessary. The only time I think it would be necessary is if you change a comaker and see that a member was once a comaker, but no longer is one; however, there are better ways of tracking that than by using a short_term_loan_comakers entity. I would recommend adding a start date and end date to the short_term_loan_comakers_short_term_loan entity if that is something you are trying to track.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.