SQL: Database structure -
i have little blackout.
in database have til following tables:
courses: id
students: id
coursesstudents: courseid, studentid
now have problems connecting marks students , courses.
the marks must connected school year. e. g.
- 1st year, 1st semester : 12 points
- 1st year, 2nd semester: 10 points
- 2nd year, 1st semester: 8 points
- 2nd year, 2nd semester: 5 points
i thought
studentscoursesmarksyear: studentid, coursesid, mark, year
but think not right/the best...
you're close. year doesn't sufficient; need semester, too.
studentmarks: studentid, courseid, mark, year, semester
primary key {studentid, courseid, mark, year, semester}. since it's key, it's in bcnf @ least.
in real-world academic application, you'd need several other tables. one, example, might have years , semesters particular course offered. (some of courses offered in even-numbered years.)
Comments
Post a Comment