Textbook: Isbn Title Price
Textbook: Isbn Title Price
The first thing that strikes me is the lack of key to the second table. Since we are talking about text books here, I thought maybe ISBN would be a good key. So the second table now has ISBN as its key. If that's done, then all the attributes about an exam are not functionally dependent on ISBN, but rather something else. The second thing that strikes me is that more than one author may write a text. Thus author is a multivalued column, so this table is not in first normal form. To put it in first normal form we need to make two new tables. Author and Book or TextBook. If you didn't see this, no problem it's pretty subtle. So here are the functional dependencies. Title and Price are functionality dependent on ISBN. Author is functionally dependent on ISBN With that all said I did the following on the second table. TEXTBOOK ISBN AUTHOR ISBN Now we have the following left in the second table. EXAMNAME SCORE GRADE MAJOR AUTHOR TITLE PRICE
If we look at MAJOR it has nothing to do with exams. It is more dependent on the student so probably belongs in the first table. So I added it to the first table for now. GRADE is probably computed for a specific class taken by the student. So I eliminated it. Now Score seems to be functionally dependent on a student not an EXAMNAME. And even more, on a specific test given in specific class. We also have a potential for EXAMNAME not being unique or being multivalued. EXAMNAME needs a new key to eliminate a potential duplication of keys if we use EXAMNAME as a key. So we need to do something here. The dependency looks like Score is dependent on student, course and class within that course. TestName is dependent on the TestID or TestType in this instance.
I chose to identify an ExamType. Thus is have a unique key for the ExamName and duplicate names will not create a problem. EXAMTYPE TYPEID EXAMNAME
Now we need to handle Score. I think something like a GRADE will do the trick. Here is my solution. GRADE COURSENO CLASSNO TYPEID SSAN SCORE
Notice that some of the attributes have been pulled from the first table to make the GRADE table work. We can see the SCORE is fully functionally dependent on the course, the specific class in that course, the specific test taken and the student that took the test. Hence the table. So here is what we have from the second table. TEXTBOOK ISBN AUTHOR ISBN EXAMTYPE TYPEID GRADE COURSENO CLASSNO EXAMNAME TYPEID SSAN SCORE AUTHOR TITLE PRICE
It looks like all the tables are fully functionally dependent on the keys. So the tables are in second normal form.
Now lets look at the first table. SSAN STUDENTN CLAS ROOMCOUR CREDIFACU SPEC DEPA PHON MAJO AME SNO NO SEDE TS LTYN ZN RTME E R SC AME NT Remember we added Major from the second table. Dependencies. 1.All attributes that refer to the faculty do not depend on any of the key, SSAN and ClassNO. So we need to make a new table. FACULTYNAME SPECZN DEPARTMENT PHONE Faculty Name probably will not be unique, so we need to add something like FACULTYID FACULTY FACULTYID FACULTYNAME SPECZN DEPARTMENT PHONE
Now all the attributes are fully functinally dependent on the FacultyID Here's what's left. SSAN STUDENTNAME CLASSNO ROOMNO COURSEDESC CREDITS
Roomno, coursedesc and credits an independent of student. They are functionally dependent on something like a class or course. So to eliminate the non dependent attributes we again need another table. COURSE COURSENUMBER . COURSEDESC CREDITS
Now the tables that follow are in Second Normal form. All the attributes are fully functionally dependent on the keys. Here is a summary. COURSE COURSENUMBER FACULTY FACULTYID TEXTBOOK ISBN AUTHOR ISBN EXAMTYPE TYPEID GRADE COURSENO CLASSNO EXAMNAME TYPEID SSAN SCORE AUTHOR COURSEDESC SPECZN TITLE CREDITS DEPARTMENT PHONE PRICE
FACULTYNAME
We still have to handle ROOMNO. A room is dependent on the class number. A specific class normally is assigned to a particular room and the class is about a Course. Hence I need a CLASS table. So RoomNo is dependent on the CLASSNO and the COURSENO. A specific faculty member is assigned to a specific class so the FACULTYID is dependent on the CLASSNO and COUSENO. CLASS CLASSNO COURSENO ROOMNO FACULTYID
If we check, we can see that all our attributes are fully functionally dependent on the primary keys. To put the tables in third normal form we need to eliminate any transitive dependencies. I think of Transitive dependencies as a non-key attribute being dependent on another nonkey attribute. In this case there don't seem to be any. So our tables are in third normal form.