开发者

Getting a database to 1NF or 2NF - mysql

开发者 https://www.devze.com 2023-02-18 05:05 出处:网络
How do I get this mysql database in better 1NF or 2NF form? I tried my best to rem开发者_开发百科ove redundant data. It appears there is redundant data still in \"Prof_Dept\"The schema looks strang

How do I get this mysql database in better 1NF or 2NF form?

Getting a database to 1NF or 2NF - mysql

I tried my best to rem开发者_开发百科ove redundant data. It appears there is redundant data still in "Prof_Dept"


The schema looks strange. How can a Department by a child of Professor_Dept (with the Professor_DeptID FK in it)? That means there is no "Science faculty". You would be storing

professor john's science department
professor john's physics department
professor tom's physics department
etc

I think the tables should be

Professor
Department
   <bridge between the two> (Professor_Dept)
Course
   (this hangs off the bridge table, since the combination
    defines the Course instructor [professor] and department)

Professor: id, name, e.g. "John"
Department: id, name, e.g. "COM"
Professor_Dept: id, professor_id (FK), department_id (FK), modified_date
Course: Professor_Dept_id (FK), number, course_modified

From a course, you already know through the FK which professor and dept it relates to.

0

精彩评论

暂无评论...
验证码 换一张
取 消