database design -> Class, level, topics. marks

萝らか妹 提交于 2020-01-07 03:07:09

问题


I'm designing a database for school. So far I have the following tables:

 course:        topic:        level         leveltopic_junc:  student: 
 courseID (PK)  topicID (PK)  levelID (PK)  levelID (fK)      studentID       
 date           topicname     levelname     topicID (fK)      studentname     
 level(fK)

 coursestudent_junc: 
 courseID (fK)
 studentID(fK)
 topicID (fK)
 mark

Now I'm at a dead point. What I need is: every student, at the end of the course pass an exam and gets a mark for every topic of the course and a final mark that is the average of the previuos marks.

Also, the leveltopic_junc can change: for instance, for this year topic1 can be in level1, but next year topic1 could be in level2. This shouldn't change topics assigned to the EDIT:courses for previous years. If courseID:564 (level1) this year has topic1, when next year I will modify the leveltopic_junc table, courseID:564 should maintain topic1, even if now level1 it's not anymore in level1. So the leveltopic_junc table it's just a reference table so that (later, when writing php) I can populate the coursestudent_junc table with topics, without have to manually search or write topics.

Would be better to break the coursestudent_junc in two tables (or this will break the one of normalization rules?)

coursetopic_junc:     mark:
courseID (fK)        courseID (fK)
topicID (fK)         studentID (fK)
                     topicID (fK)
                     mark

What is the best database design in this scenario?

Hope I was clear, it isn't to easy to explain in words :)! Thanks!!

来源:https://stackoverflow.com/questions/34981660/database-design-class-level-topics-marks

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