
Как разработать структуру для БД?
Практиковаться
Выделение сущностей и их атрибутов
Атомизация сложных атрибутов на более простые.
Определение уникальных идентификаторов (первичных ключей)
Определение отношений между таблицами с помощью внешних ключей
Нормализация базы данных
восходящий
нисходящий
комбинированный
Primary key value must be unique
Primary key cannot be NULL
Primary key values cannot be changed
The original key must be assigned a value when inserting a new entry

A foreign key may have a different name from its primary key
It ensures that rows in one table have corresponding rows in another
Unlike the primary key, they do not have to be unique. Most often they are not
Foreign keys may be null, although primary keys cannot
One to one (Один к одному)
One to many (Один к многим)
Many to many (Многие ко многим)



Database normalization is the process of restructuring a relation database



It should only have single(atomic) valued attributes/columns
Values stored in a column should be of the same domain
All the columns in a table should have unique names
And the order in which data did store, does not matter

It should be in the First Normal form
It should not have Partial Dependency





It is in the Second Normal form
It doesn’t have Transitive Dependency


