Вопрос

I am trying to understand how exactly normalization works and apply it in some specific project I have. I saw in several videos that the first step is to define a candidate key.

I want to ask, what happens if none of the fields that I have (or a combination of these fields) is unique? For example, I have a field called Receiver. But I know it is repeated. I thought of combining it with the field named Time_Of_Week but this field also is repeated weekly. Lastly I thought to combine it with the field Week_Number but this field also is repeated yearly.

Is the only solution to define an auto increment primary key?

Thanx d.

Это было полезно?

Решение

If the table don't have a column, or a logical group of columns that are unique, there's not a natural key. In this case you should create a surrogate key, using a new column that could be simple an auto increment.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top