Jay's Blog

Wednesday, December 21, 2005

Foreign and Primary Keys

Interesting perspective. Agree perfectly against the notion of multi-field primary keys. The notion of 'non-semantic' primary keys makes sense, though on rare occasions we end up using semantic primary keys. Really like the idea of calling the Primary key field {Table_Name}_Key instead of {Table_Name}_Id. There tends to be confusion on occasion with the '_Id' column (i.e. Company_Id or Product_Id), because they sometimes have real meaning in the business context and it may not be sequential numbers starting at 1.

"KEYS are only for relating tables. They aren't data items. They don't have to look good, or be sequential, or otherwise meaningful because PEOPLE don't ever see them.

There is NEVER a reason to design a database with compound keys or semantic data."

0 Comments:

Post a Comment



Links to this post:

Create a Link

<< Home