2011-03-20 63 views
0

如何獲得更好的1NF或2NF形式的這個MySQL數據庫?獲取數據庫到1NF或2NF - mysql

enter image description here

我盡我所能,以刪除冗餘數據。看起來有多餘的數據仍在「Prof_Dept」中

+0

我不相信任何文件託管,不公開文件名稱。即使這樣也不可靠。如果您需要幫助,請在問題中發佈相關信息。 – 2011-03-20 23:29:01

+0

這實際上不是家庭作業,它是我正在努力的一個項目。 – Jshee 2011-03-20 23:39:39

回答

1

模式看起來很奇怪。一個由Department_Dept的孩子(與其中的Professor_DeptID FK一起)的部門如何?這意味着沒有「科學能力」。你會被存儲

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

我認爲表應

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 

從課程中,您已通過FK知道哪個教授和DEPT它涉及到。

+0

所以你說(4)表格:教授,部門,Prof_Dept和課程? – Jshee 2011-03-20 23:37:00

+0

@woopie是的。例如course_modified屬於正當程序。 – RichardTheKiwi 2011-03-20 23:41:12

+0

@理查德 - 我原本有這樣的,但後來實現了冗餘,一旦我輸入了虛擬數據的課程表,例如:課程:COM 310然後爲第二個記錄** COM ** 420等COM部分重複並結束。無論如何擺脫這一點?這是我將DeptName放入單獨表格(例如COM部分)的推理的一部分。 – Jshee 2011-03-20 23:51:16