• I'm a big fan of using surrogate keys when designing databases, but they are not intended to enforce data integrity. They should be used to simplify joins and used solely to establish relationships to other entities in the database.

    Example 1 should never happen because any table with a surrogate key should also have a unique constraint placed on the natural key of the table to enforce data integrity.

    Example 2 should also never happen because it's not a good practice to use a surrogate key on a linking/intersection table. Those tables should always consist of the combination of the two surrogate keys from the two tables that you are establishing the relationship between.

    Thank you for the article. It was definitely a interesting read. I've just never encountered either of the issues that you describe because of the practices that I've listed above.

    Greg