【发布时间】:2012-05-19 23:56:32
【问题描述】:
我必须在 3NF 中规范化以下内容:
Service (Service_ID, Service Item, service item cost, date of service)
Customer (customer ID, customer name, customer telephone number, customer address)
Vehicle (Vehicle ID, vehicle make, vehicle model, vehicle year)
Parts (Parts ID, part code, part describtion, part cost)
标准化后得到的结果:
Service (Service_ID (PK), Service Item, service item cost, date of service, Vehicle_ID (FK))
Customer (customer ID (PK), customer name, customer telephone number, customer address)
Vehicle (Vehicle ID (PK), vehicle make, vehicle model, vehicle year, Customer_ID (FK))
Parts (Parts ID (PK), part code, part describtion, part cost, Vehicle_ID (FK))
你认为我完全走错了吗?
【问题讨论】:
-
我假设这是家庭作业?规范化是基于函数依赖的——你还没有向我们展示任何东西。您的分组看起来合乎逻辑,但可能并不“正确”。
-
规范化通常是将表划分为较小的表,您将外键添加到表中。问题不是很清楚,编辑也很无奈。但是,规范化后的表看起来是正确的,并且不包含冗余数据。
-
嗯 - 它似乎没有保存冗余数据,但这取决于功能依赖性。如果两辆不同的汽车可以有相同的零件,那么他/她建议的表结构将不是 3NF,因为我们将有重复的零件记录——每辆车都有一个记录。
标签: database database-design 3nf