I am working on a Class Registration database design. Courses have multiple sections. Each section is offered at a certain time. For example, a section’s times are MWF 9-9:50 and another section’s time are TTH 2:30-3:45. To handle this requirement, I decided to create a timeslot table and now I would have many-many relationship between section and timeslot
course(id(PK), course_no, credits, title, description)
section(id(PK),section_no,course_id(FK),instructor_id)
timeslot(id(PK),day,start_time,end_time)
section_times(section_id(PK,FK),timeslot_id(PK,FK))
Is this how it should be handled?
Thanks,
Nishant
That looks fine.
Some things you might need to think about:
Some constraints
The classroom assignment might need to be stored and there might be a question of whether the classroom is on a section basis or section_times basis
Are there exceptions (i.e. a holiday on a Thursday or some other kind of exception where just one class is rescheduled) where you want the database to fully represent the real world?
If there are multiple instructors or assistants, you need to refactor that out from the section to a section_instructor table (this turns out to be more important for scheduling the teaching resources than for information for the students)