Tuesday, August 30, 2011

Telling the cardinality of a relationship between two tables

I was wondering: how the hell do some data modeling tools to figure out the kind of cardinality existing between two tables out of just looking just to the table structures. Well, I don't think that's the case, they have to perform some sort of query on the data. I found some insights in this forum:

http://www.tek-tips.com/viewthread.cfm?qid=1105439&page=103

With one to one relationships the issue is very straightforward, just looking for uniqueness in foreign keys does the trick, but if such uniqueness doesn't exist there's no other choice, you've got a one to many relationship as many to many relationships cannot be represented directly with the relational model, you need a "cross reference" table to achieve this.

So, I wonder why took me so long to realize how to resolve this rather basic issue. I wish I could sleep a little more or a little better!

No comments:

Post a Comment