sql - What database design philosophy is being violated when one table references another table via a non-prime field? -


suppose have 2 tables. 1 of tables contains thousands of customers indexed surrogate key, , customer name field (which non-prime). table tracks purchases references customers name opposed corresponding surrogate key.

if i'm trying justify why bad (as is), there nameable design philosophy that's being violated? since redundancy being created, intuitively you'd think tables somehow not normalized, since concerns relationship between 2 different tables it's hard me see how normalization applies.

it not normalized in 3rd normal form. 3rd normal form required references done based on candidate key (i.e. unique key).

in example, possible have multiple customers same name, means:

  1. you cannot enforce 1:1 relationship between 2 tables
  2. joins between 2 tables not perform unless index name column.

if working on large database present problems end duplicate names (e.g. john smith).


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -