Database design efficiency with 1 to many relationships limited 1 to 3

Posted by Joe on Stack Overflow See other posts from Stack Overflow or by Joe
Published on 2010-06-15T16:24:42Z Indexed on 2010/06/15 16:32 UTC
Read the original article Hit count: 207

This is in mysql, but its a database design issue. If you have a one to many relationship, like a bank customer to bank-accounts, typically you would have the table that records the bank-account information have a foreign key that keeps track of the relationship between account and customer. Now this follows the 3rd normal form thing and is a widely accepted way of doing it.

Now lets say that you are going to limit a user to only having 3 accounts. The current database implementation will support this and nothing would need to change. But another way to do this would have 3 coloms in the account table that have the id of the 3 respective accounts in them. By the way this violates 1st normal form of db design.

The question is what would be the advantage and disadvantages of having the user account relationship recored in this way over the traditional?

© Stack Overflow or respective owner

Related posts about database-design

Related posts about normalization