Finding functional dependency

十年热恋 提交于 2021-02-20 04:38:20

问题


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

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 .....

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....

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?


回答1:


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 ...".

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, ...).

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.



来源:https://stackoverflow.com/questions/26796963/finding-functional-dependency

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!