Second Normal Form (2NF)
2008-05-09 09:39
246 查看
Definition: In order to be in Second Normal Form, a relation must first fulfill the requirements to be in First Normal Form. Additionally, each nonkey attribute in the relation must be functionally dependent upon the primary key.
Example: The following relation is in First Normal Form, but not Second Normal Form:
In the table above, the order number serves as the primary key. Notice that the customer and total amount are dependent upon the order number -- this data is specific to each order. However, the contact person is dependent upon the customer. An alternative way to accomplish this would be to create two tables:
The creation of two separate tables eliminates the dependency problem experienced in the previous case. In the first table, contact person is dependent upon the primary key -- customer name. The second table only includes the information unique to each order.
Example: The following relation is in First Normal Form, but not Second Normal Form:
Order # | Customer | Contact Person | Total |
1 | Acme Widgets | John Doe | $134.23 |
2 | ABC Corporation | Fred Flintstone | $521.24 |
3 | Acme Widgets | John Doe | $1042.42 |
4 | Acme Widgets | John Doe | $928.53 |
Customer | Contact Person |
Acme Widgets | John Doe |
ABC Corporation | Fred Flintstone |
Order # | Customer | Total |
1 | Acme Widgets | $134.23 |
2 | ABC Corporation | $521.24 |
3 | Acme Widgets | $1042.42 |
4 | Acme Widgets | $928.53 |
相关文章推荐
- 数据库范式(normal form NF)
- Database normal form
- First Normal Form (1NF)
- Normalizing Your Database: First Normal Form
- Third Normal Form (3NF)
- 霍夫变换的标准形式--The Hough Transform: Normal form
- 数据库应用-NF^2 Modell(Non First Normal Form)
- 数据库三大范式(Normal Form)
- TaskManager开发中遇到的问题 (Form不可见时,最小化切换为Normal,内部控件不见)
- 数据库 - 范式(Normal Form, NF)
- 数据库范式随笔NF(normalForm)
- 关系数据库 范式(NF: Normal Form) 说明
- 了解数据库最基本的三个范式(normal form)
- 命题范式(propositional normal form)
- 关系数据库 范式(NF: Normal Form) 说明
- 关系数据库 范式(NF: Normal Form) 说明
- 关系数据库 范式(NF: Normal Form) 说明
- PyQt: “AttributeError: 'Form' object has no attribute 'exec_'” when opening second window
- sharepoint使用Form认证文档库功能不能正常使用的解决方法
- AJAX提交与FORM提交的区别