Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I have a pet project where I am making a Grade Book Application to better teach several different topics in DB, OOP and Planning. Im running into some issues with the database planning of things. For the record I am learning all of this by using online resources, books and trial and error in no way am I professional.

I have 3 Tables (Teachers, Courses, and Assignments).

1) Many Teachers can Teach Many Courses - So this would be a M2M Relationship where I would need a third table to cross reference Teachers and Courses by their PK. Is it okay to have that third table have extra columns to show unique data about the courses like Title of the course or should that go into the course table? And if it depends how would you know which is the best way?

2) One Course can have Many Assignments or is it Many Courses can have Many Assignments? I feel this is a stupid question but I can not grasp on which would be a correct fact statement?

3) Does anyone know of any Database Diagrams that shown an example of a very simple gradebook layout, I have been looking on google but couldn't find anything that was not in my realm.

share|improve this question

closed as too localized by Jarrod Roberson, Jim G., Walter, Yusubov, Dynamic Sep 20 '12 at 10:29

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

Sorry, no reference for a full design. You're going about it the right way by working on it piece by piece and asking questions as they come up. –  JeffO Apr 26 '12 at 16:37

1 Answer 1

up vote 3 down vote accepted
  1. Course specific data goes in the Course table. Any meta-data about the actually Many to Many relationship would go in the Join table, nothing else should go there.

  2. The first is a One to Many, the second is Many to Many, which way do you want to do it? If assignments are shared among Courses, it would be Many to Many.

  3. Very unlikely you will find anything that shows exactly what you want to do specifically. For example, this is in the domain, but I highly doubt it will be very useful. This is what you want to Google; gradebook er diagram

share|improve this answer
1) Okay that makes sense. 2) By Shared you mean the same assignment would be for two or more courses. Which I dont see the case happening and if so not very very often. One to many would be the better way to go –  Jon H Apr 26 '12 at 16:09
@JonH: Most likely you want 1 Course : Many Assignments, unless you expect two (or more) independent courses to have a common assignment between them. In my experience, I don't think that actuall happens - but maybe it just never happened to me. –  FrustratedWithFormsDesigner Apr 26 '12 at 16:13
Silly question how does one come up with a correct fact statement? Seems like I can say a fact about something many different ways before and they all seem correct. –  Jon H Apr 26 '12 at 16:25
Facts can be expressed in different ways that are exactly equal, and they prove each other in that way. So multiple proofs can prove a single fact/statement. None are less or more correct than any of the others. –  Jarrod Roberson Apr 26 '12 at 16:35

Not the answer you're looking for? Browse other questions tagged or ask your own question.