I am currently working with PHP and MySQL database. I am currently building a course catalog page for my department. I have set up a table named Courses . I am running into an issue with the rest of the structure for my database table. There are classes that are taught during the fall and others during the spring. Also, among those classes, there are some that are taught every other year. I want to build a table which then I can use with PHP to automatically update according to the semester and scholarly year. More specifically, I would like to show the courses name, description, and if it’s either offered on the fall or semester of that year. Any course not offered that year will not show in the page.
How would I properly structure my table to fit the requirements mentioned above?
Example (Course number, Class name):
3210 Musical Theatre Styles I (Fall)
3220 Musical Theatre Styles II (Spring)
4500 Musical Theatre Showcase (Fall of year 2014)
I would create one table describing the courses, include course code, name and every other relevant information, then create another table linking those courses to when they will be taught.
Example of courses
Example of plan
So a poulated database could contain the following:
Table
coursesTable
course_dates(0 for spring 1 for fall)This way, you separate the dates when the couses are taught from the info on the course.