Question

In the miniworld, we have a course called General Science. It has three modules named Module1, Module2, Module3.

(Each module is covered in 2 months, and then there is an exam, and a final exam in the end of the semester - this is not relevant here, but I am just telling for context.)

In each module, roughly 30% of the course content consists of chapters from physics, 30% from biology and 40% from chemistry. So Physics, Biology and Chemistry are kinda parts (please suggest if you have a better word) of the course.

Each Course_Part is taught by different teachers. So teachers are specialized in one or more of those Course_Parts (i.e. Physics, Biology, Chemistry).

There are several courses like General Science.

........................................................

I have two options. Please suggest which one will be a better design:

  1. Make a table/entity type named COURSE_PART ( CoursePartName, Module, Course, (Chapters) ) and relate it to TEACHER by Teach, a N:M relationship.

    This kinda worries me because there will be a lot of redundant data in the table. Imagine 20 chapters from the same Course_Part in the same module, i.e. same CoursePartName repeating 20 times in the CoursePartName column, same module name repeating for 20 times in the Module column, and same course name repeating for even so many more times in the Course column. It doesn't appear good to me.

    And yes later I will have to make a separate table called CHAPTERS (because it is a multivalued attribute) and include the primary key of COURSE_PART in it as foreign key, and it, together with Chapter attribute will form a composite primary key for CHAPTERS. But I won't get rid of the kind of repetition I mentioned.

  2. Make an entity named COURSE with two attributes named ID and CourseName. Make its week entity named COURSE_PART with attributes named CoursePartName (same repetition in its column), Module (same repetition in the module column); and relate it to TEACHER by a N:M Teach relationship?

Is this kind of repetition bad or am I just feeling so? What will be the best way to get rid of this?

Was it helpful?

Solution

A better name for physics/chemistry/biology might be Topic.

Since a topic might be taught as part of multiple modules, it makes sense to have a Course table, a Module table, a Topic table, and a Content table to link modules with topics. Content would have a courseFk column and a topicFk column.

Same with the Teacher table: since each teacher can specialise in multiple topics, you can have a Teaches linking table.

The linking table strategy will prevent repetition when modelling many-to-many relationships.

With Chapter it's a different story: since each chapter belongs to a single topic, your Chapter table should have a topicFk column.

UMI diagram

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top