本文介绍了数据库规范化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想问一个与规范化有关的问题。



我有2个PK,VIN和Reg_no。
VIN是车号,注册号是车牌号码。
我有一个称为当前里程表的属性。
它是否具有部分依赖关系或完全依赖于2个PK?

解决方案

您有两个候选键。 VIN是独一无二的板号也可能是唯一的。 (但这取决于您的应用程序。)



任何键可以由多个列组成,但是您没有一个多列键,您有一个键VIN)或两个单独的键(VIN和板)。没有任何错误。

无论你是否只有一个键或在这个表中的两个,每个键只有一列。由于每个可能的键只有一列,所以不可能有部分键依赖。


I would like to ask about a question relating to normalization.

I have 2 PKs, VIN and Reg_no.VIN is the Vehicle ID Number and Registration number is the car plate number.I have an attribute called current odometer.Does it have a partial dependency or a full dependency on the 2 PKs?

解决方案

You have two candidate keys. VIN is unique; the plate number is also probably unique. (But it depends on your application.)

Any key can consist of multiple columns, but you don't have one multi-column key, you have either one key (VIN) or two separate keys (VIN and plate). And there's nothing wrong with that.

Regardless of whether you have only one key or two in this table, each key has only one column. Since each possible key has only one column, it's impossible to have a partial key dependency.

这篇关于数据库规范化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-03 22:17