没有合适的资源?快使用搜索试试~ 我知道了~
ssd7 EX6 答案
需积分: 9 3 下载量 135 浏览量
2014-12-17
17:20:32
上传
评论
收藏 2KB TXT 举报
温馨提示
试读
2页
数据库实验6答案,希望更多的人分享参考交流经验。
资源推荐
资源详情
资源评论
1.
PK: TrackingNum
2.
FDs: TrackingNum->EmpID, EmpName, OrderNo, ShipToAddr, ShippedDate
EmpID->EmpName
OrderNo->ShipToAddr
3.
(1) Insertion Anomaly:
If we want to insert a new employee ,and we only have her or his EmpID and EmpName.It will occour a insertion anomaly,because the new employee dose not have a shipment, and the tracking number will be null.
(2) Modification Anomaly:
If we want to change the EmpName of a employee, it will occour a insertion anomaly.Because EmpName in other rows which have the same EmpID will not be changed.
(3) Deletion Anomaly:
If there is a employee who just appears only one time, and we delete the order of this employee, it will occour a deletion anomaly. Because after we delete this order we will lose the information of this employee.
4.
The relation is in 2NF.Because in this relation the intersection of each row and column contains one and only one value, so it is in 1NF. And every non-primary-key attribute is fully functionally dependent on the primary key TrackingNum, so it is in 2NF. But there are some non-primary-key attributes such as EmpName and ShipToAddr are transitively dependent on the primary key TrackingNum, so it is not in 3NF.
5.
The relation is in 2NF,so we should change it from 2NF to 3NF. There are two non-primary-key attributes (EmpName and ShipToAddr) transitive dependent on the primary key TrackingNum. We should remove each of them by placing in a new relation. The result is:
Shipper (EmpID, OrderNo, ShippedDate, TrackingNum)
PK: TrackingNum
FK: EmpID references Employee(EmpID)
FK: OrderNo references Order(OrderNo)
FD: TrackingNum --> EmpID, OrderNo, ShippedDate
Employee (EmpID, EmpName)
PK: EmpID
FD: EmpID --> EmpName
Order (OrderNo, ShipToAddr)
PK: OrderNo
PK: TrackingNum
2.
FDs: TrackingNum->EmpID, EmpName, OrderNo, ShipToAddr, ShippedDate
EmpID->EmpName
OrderNo->ShipToAddr
3.
(1) Insertion Anomaly:
If we want to insert a new employee ,and we only have her or his EmpID and EmpName.It will occour a insertion anomaly,because the new employee dose not have a shipment, and the tracking number will be null.
(2) Modification Anomaly:
If we want to change the EmpName of a employee, it will occour a insertion anomaly.Because EmpName in other rows which have the same EmpID will not be changed.
(3) Deletion Anomaly:
If there is a employee who just appears only one time, and we delete the order of this employee, it will occour a deletion anomaly. Because after we delete this order we will lose the information of this employee.
4.
The relation is in 2NF.Because in this relation the intersection of each row and column contains one and only one value, so it is in 1NF. And every non-primary-key attribute is fully functionally dependent on the primary key TrackingNum, so it is in 2NF. But there are some non-primary-key attributes such as EmpName and ShipToAddr are transitively dependent on the primary key TrackingNum, so it is not in 3NF.
5.
The relation is in 2NF,so we should change it from 2NF to 3NF. There are two non-primary-key attributes (EmpName and ShipToAddr) transitive dependent on the primary key TrackingNum. We should remove each of them by placing in a new relation. The result is:
Shipper (EmpID, OrderNo, ShippedDate, TrackingNum)
PK: TrackingNum
FK: EmpID references Employee(EmpID)
FK: OrderNo references Order(OrderNo)
FD: TrackingNum --> EmpID, OrderNo, ShippedDate
Employee (EmpID, EmpName)
PK: EmpID
FD: EmpID --> EmpName
Order (OrderNo, ShipToAddr)
PK: OrderNo
资源评论
qq_23262099
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功