Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Gosy_nepolnostyu_7v1.doc
Скачиваний:
2
Добавлен:
01.07.2025
Размер:
3.7 Mб
Скачать

11. [Done] Содержательная трактовка первой нормальной формы бд

First normal form (1NF) is a property of a relation in a relational database. A relation is in first normal form if the domain of each attribute contains only atomic values, and the value of each attribute contains only a single value from that domain.[1]

Edgar Codd, in a 1971 conference paper, defined a relation in first normal form to be one such that none of the domains of that relation should have elements which are themselves sets.[2]

First normal form is an essential property of a relation in a relational database. Database normalization is the process of representing a database in terms of relations in standard normal forms, where first normal is a minimal requirement.

The following scenario illustrates how a database design might violate first normal form.[3][4]

Domains and values[edit]

Suppose a designer wishes to record the names and telephone numbers of customers. He defines a customer table which looks like this:

Customer ID

First Name

Surname

Telephone Number

123

Robert

Ingram

555-861-2025

456

Jane

Wright

555-403-1659

789

Maria

Fernandez

555-808-9633

The designer then becomes aware of a requirement to record multiple telephone numbers for some customers. He reasons that the simplest way of doing this is to allow the "Telephone Number" field in any given record to contain more than one value:

Customer ID

First Name

Surname

Telephone Number

123

Robert

Ingram

555-861-2025

456

Jane

Wright

555-403-1659

555-776-4100

789

Maria

Fernandez

555-808-9633

Assuming, however, that the Telephone Number column is defined on some telephone number-like domain, such as the domain of 12-character strings, the representation above is not in first normal form.

A design that complies with 1NF[edit]

In the first normal form, the previous table can be represented in the following way.

Customer ID

First Name

Surname

Telephone Number

123

Robert

Ingram

555-861-2025

456

Jane

Wright

555-403-1659

456

Jane

Wright

555-776-4100

789

Maria

Fernandez

555-808-9633

However, this database design does not meet the more stringent requirements of second normal form.[5]

A design that also complies with higher normal forms[edit]

Another design for the same data makes use of two tables: a Customer Name table and a Customer Telephone Number table.

Customer ID

First Name

Surname

123

Robert

Ingram

456

Jane

Wright

789

Maria

Fernandez

Customer ID

Telephone Number

123

555-861-2025

456

555-403-1659

456

555-776-4100

789

555-808-9633

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]