1. List the primary key.
TrackingNum(PK)
2. List all the FDs.
TrackingNum -> EmpID
TrackingNum -> EmpName
TrackingNum -> OrderNo
TrackingNum -> ShipToAddr
TrackingNum -> ShippedDate
EmpID -> EmpName
OrderNo -> ShipToAddr
3. List all the update anomalies and provide an example of each.
1)insertion anomaly : when you insert a new employee,there is no TrackingNum of this new employee,
you have to update multiple record.
For example,when you want to insert the Name of 1234,because an EmpID may has
multiple orderNo,you have to update multiple record about name.
2)modification anomaly : when you modify a EmpID,because an employee disposed an order,
you have to modificate all orders disposed by this employee.
For example,when you want to modify the EmpID "2134" ,the new ID is "5678",
ou have to modificate all orders disposed by "2134".
3)deletion anomaly : when you delete an order,you may delete all information of a employee.
because a employee may deals with one order or many orders.
For example,
4. What normal form is the relation in? Explain
1)1NF: First Normal Form
1NF Definition: A relation schema is in 1NF, if the domain of every attribute allows a single atomic value.
That is, every cell in the table contains one and only one value.
2)2NF: Second Normal Form
2NF Definition: A relation is in 2NF, if it is in 1NF and every non-primary-key attribute is fully functionally
dependent on the primary key.
In other words, in a relation that is in 2NF there are no partial dependencies on the primary key.
3)3NF: Third Normal Form
The 3NF is defined in terms of transitive dependencies and is associated with insertion and deletion anomalies.
3NF Definition: A relation is in 3NF, if it is in 2NF and does not contain a non-primary-key attribute that is
transitively dependent on the primary key.
5. Apply normalization to it incrementally, bringing the relation to 3NF. That is, if the relation is unnormalized, bring it to first normal form, then bring the first normal form you've just created to second normal form, and then bring the second normal form to third normal form.
1)simple string
The relation is 2NF.
TrackingNum(PK)¡úEmpID
TrackingNum(PK)¡úOrderNo
TrackingNum(PK)¡úShippedDate
EmpID(PK)¡úEmpName
OrderNo(PK)¡úShipToAddr
Eliminate partial dependencies:
add new form
Employee,Order
Employee
(EmpID(PK),EmpName)
EmpID(PK)¡úEmpName
Order
(OrderNo(PK),ShipToAddr)
OrderNo(PK)¡úShipToAddr
Shipment
(EmpID,OrderNo,ShippedDate,TrackingNum(PK))
TrackingNum(PK)¡úEmpID
TrackingNum(PK)¡úOrderNo
TrackingNum(PK)¡úShippedDate
2)combinatorial attribute
The relation is not 1NF,it's unnormalized.
add new attribute
ShipToAddr(state,city,street,bulding,num) TrackingNum(PK)
FD:TrackingNum -> EmpID
TrackingNum -> EmpName
TrackingNum -> OrderNo
TrackingNum -> state
TrackingNum -> city
TrackingNum -> street
TrackingNum -> bulding
TrackingNum -> num
TrackingNum -> ShippedDate
EmpID -> EmpName
OrderNo -> state
OrderNo -> city
OrderNo -> street
OrderNo -> bulding
OrderNo -> num
now it is 2NF,but there be partial dependencies.
2Nf¡ú3NF,add new form.
Employee
(EmpID(PK),EmpName)
EmpID(PK)¡úEmpName
Order
(OrderNo(PK),state,city,street,bulding,num)
OrderNo(PK)¡ústate
OrderNo(PK)¡úcity
OrderNo(PK)¡ústreet
OrderNo(PK)¡úbulding
OrderNo(PK)¡únum
Shipment
(EmpID,OrderNo,ShippedDate,TrackingNum(PK))
TrackingNum(PK)¡úEmpID
TrackingNum(PK)¡úOrderNo
TrackingNum(PK)¡úShippedDate
now the relation is 3NF.
ssd7-ex6.rar_SSD7-Exercise_4_ex6 ssd7_exercise6 ssd7_ssd7_ssd7 e
版权申诉
56 浏览量
2022-09-23
08:32:29
上传
评论
收藏 2KB RAR 举报
局外狗
- 粉丝: 64
- 资源: 1万+
最新资源
- java代码:java工具类-javaUtils多种工具类-正则工具-base64工具等
- 简单详细介绍了python爬虫基础.docx
- 详细介绍啦智能车图像处理去畸变教程.docx
- fortran代码:数值算法-人工智能算法-完整代码
- centos7中java8+mysql80+hadoop3.2.4集群+hive3.1.2从0开始搭建(仅供参考)
- 非常详细描述了大创项目进行流程.docx
- matlab代码:红尾鹰优化算法 Red‑tailed hawk algorithm RTH算法
- Unity游戏源码3D马里奥工程文件
- 详细介绍啦美赛Latx模板总结.docx
- 基于MATLAB的车牌识别系统源码使用传统算法实现.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈