1, the first paradigm 1NF
Definition: A field in a database table is a single attribute and cannot be divided.
Simply put, each attribute is an atomic term, indivisible.
1NF is the minimum condition that a relational pattern should have, and if the database design does not meet the first paradigm, it is not called a relational database. That is to say, as long as the relational database, it must satisfy the first normal form.
Let's start with a list of non-conforming 1NF 1-1
cardno |
studentno |
studentname |
sex |
department |
cardcash |
userid |
userlevel |
time |
001 |
< Span style= "color: #008080; font-size:16px; " >021101 |
xiaoming |
male |
School of Education, Department of Psychology, 1 class |
100 |
< Span style= "color: #008080; font-size:16px; " >operator |
operator |
2011/10/03,09: 00 |
The reason that this table does not conform to 1NFis because the Department and Time fields can be re-divided, so you should change to table 1-2:
Cardno |
Studentno |
Studentname |
Sex |
ACademy |
Major |
Class |
Cardcash |
Userid |
UserLevel |
Date |
Time |
001 |
021101 |
Xiao ming |
Man |
Faculty of Education |
Department of Psychology |
1 |
100 |
Operator |
Operator |
2011/10/03 |
09:00 |
--------------------------------
1 . First paradigm (ensuring that each column remains atomic)
The first paradigm is the most basic paradigm. If all the field values in a database table are non-exploded atomic values, the database table satisfies the first paradigm.
The rational follow-up of the first paradigm needs to be determined according to the actual needs of the system. For example, some database systems need to use the "address" attribute, the "address" attribute should be directly designed as a database table field. However, if the system often accesses the "city" part of the "address" attribute, then it is not to be the "address" attribute to be re-split into provinces, cities, detailed address and other parts of storage, so that in the address of a part of the operation will be very convenient. This design satisfies the first paradigm of the database, as shown in the following table.
The user information shown in the table above follows the requirements of the first paradigm, which makes it very convenient to classify users using cities, and also improves the performance of the database.
It is clear that the first table structure not only satisfies the requirements of a sufficient number of items, but also creates redundancy in the case of an item. Also does not conform to the first paradigm.
"Database Paradigm" analytic first paradigm