查找功能依赖性 [英] Finding functional dependency

查看:53
本文介绍了查找功能依赖性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何根据此案例研究确定功能依赖性和候选键?

How do I determine the functional dependency and the candidate key based on this case study?

课程模块,可由讲师,学生或访客执行用户.课程模块由学科代码和学科名称组成.什么时候管理员创建课程,它将存储课程ID,主题代码,讲师ID,课程名称和.....

Course module and it can be performed by lecturer, student or visitor user. Course module consist of subject code and subject name. When admin creates course, it will store course ID, subject code, lecturer ID, course name, and .....

学生必须报名参加课程和课程注册包括注册ID,学生信息,注册日期,完成日期和....

Students are required to enroll in the course and the course enrollment consist of registration ID, student information, date of enrollment, date of completion and....

根据我的假设,课程ID->{主题代码,主题名称} ,但同时

Based on my assumption, Course ID -> {subject code, subject name} but on the same time

Admin ID -> (Course  ID, subject code, lecturer ID, course name, course description, course category)

这是正确的吗,因为我将被要求在管理模块上编写另一个功能依赖项?

Is this somehow correct since I would be required to write another functional dependency on admin module?

推荐答案

首先,我们确定我们感兴趣的应用程序关系.例如,用户[用户ID]具有角色讲师"或用户[用户ID]具有名字[名]和密码[密码]和....

First we determine what application relationships we are interested in. Eg "user [user ID] has role lecturer" or "user [user ID] has first name [first name] and password [password] and ...".

每个获取一个基本关系,该关系包含以这种方式相关的值的行.关系的应用程序关系的参数是其属性.例如讲师(用户ID)或用户(用户ID,名字,密码等).

Each gets a base relation that holds the rows of values that are related that way. The parameters of a relation's application relationship are its attributes. Eg Lecturer(user ID) or User(user ID, first name, password, ...).

对于每个关系,其应用程序关系的含义为每个列确定其在功能上依赖于哪些列集.例如:给定用户[用户ID]有名字[名字]和密码[密码]和...,如果您知道用户ID,那么您知道名字吗?如果是这样,则有FD {用户ID}-> {名字}.如果您知道用户名和密码,您知道名字吗?对于每个关系和每个(可能确定的)属性集以及每个(可能确定的)属性,依此类推.

For each relation the meaning of its application relationship determines for every column what sets of columns it is functionally dependent on. Eg: Given user [user ID] has first name [first name] and password [password] and ..., if you know user ID then do you know first name? If so there is FD {user ID} -> {first name}. If you know user ID and password do you know first name? And so on for every relation and every set of (possibly determining) attributes and every (possibly determined) attribute.

然后,我们为此找到了一个最小的掩护.这确定了候选键.

Then we find a minimal cover for that. This determines candidate keys.

因此,如果您想对这些步骤提供一些反馈,请执行这些操作.

So if you want some feedback on these steps, do them.

这篇关于查找功能依赖性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆