StudyNo | Name | Sex | Email | ClassNo | ClassAddress 01 john Male kkkk@ee.net 200401 A building 1 02 mary famale kkk@fff.net 200402 A building 2 HTML: StudyNo is the primary key,a friend of mine said the above is suit for the first normal form,but doesn't fit for the second.the reason is "ClassAddress" partial dependencies on the key ClassAddress, why?who can explain it to me! thanks very much.
StudyNo | Name | Sex | Email | 01 john Male 02 mary famale ClassNo | ClassAddress | StudyNo 200401 A building 1 01 200402 A building 2 02 is in the second normal form
since many rows in your table will have the same classno, they will also have the same classaddress.. therefore having both classno and classaddress provides redundant information. creating a second table to store classno's and classaddress's means you can look up classaddress's based on the classno
it's been a long time since i'v done proper normalisation, but as a hint in general you need more data in the base to see the to be normalized stuff in the beginning. every time you do have a repetition you need to take that 'out' in making as long new tables with lookups as you can. also you need to determine the connection between the two. you cannot have n:m relationships. starting with the example each student can have many classes, and every class can have many students - not allowed. there is a third one missing. this one stays, no repetition there: this one has doubles which you can see if you do add new entries you need to split them up as well: which makes your 'connecting one' this way, no where is any double information. students to "ClassNo | StudyNo" is 1:n - each student can have many classes, but each entry can only be one student. each entry can also be only one classroom - class room lookup to "ClassNo | StudyNo" is also 1:n; each classroom can have many entrys in "ClassNo | StudyNo" but each line in "ClassNo | StudyNo" goes back to only one class room