• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

many to many relationship - design

 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Starting with an example, say, a customer can open many account and at the same time an account can be opened by many customer. So it is many to many relationship.

Now how do you design the tables?

What did I do is, three tables: Customer, Account and Opens. Opens is connecting table has two column: cutomerId and accountId.

Hope it is clear.

But then I read somewhere, table name should be noun and not the verb.

What to do in that case?
First of all, is my design correct?
Second, what name I can give for connecting table?

Thanks.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your design is correct. You can name it something like "Customer_Account_Owners". This clearly shows what relationships are involved.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic