r/DatabaseHelp • • Aug 12 '22

Designing school timetable database

I am working on a system for a local high school to create timetables, but I am not very confident in my database design skills so I would appreciate help.

App is going to have this functionalities:

  • CRUD functions (creating and editing all data, deleting selected data)
  • Assigning lesson to class, teacher(s) to lesson for that class (one lesson can be taught by several teachers at the same time)

Every week is going to have the same timetable and every period is 45 minutes. One lesson can last longer than one period and can be taught be more than one teacher.

What could be improved in my design to suit above functionalities?

My database design

Example schedule for one class

2 Upvotes

3 comments sorted by

View all comments

Show parent comment

0

u/[deleted] Aug 13 '22

Thanks for the tips. PK makes sense in my language (it is an acronym). App is not gonna deal with rooms and individual students only whole classes so it shouldn't be that complicated. Do you think it is a good idea to use composite primary key made from classId, day and period in the timetable table? Also I am gonna rename timetable table to lessons it makes more sense.

1

u/OisinWard Aug 14 '22

PK stands for primary key. This is a confusing thing to name a table given it has a better known meaning within databases. Expand out the acronym so that your table isn't badly named.