DER for student, discipline and course

Asked

Viewed 2,262 times

2

  • A student can only have one course.
  • A course has several disciplines.
  • The student can take several courses of the course.

My only doubt is what it would look like on the DER?

DER

Would really look that way?

Since the student has only one course, the table would be disciplinaAlunoCurso? Or just disciplinaAluno?

Will the student change course later, so the best option would be this? Put the three keys of each table as foreign in the link table?

  • 1

    What if he takes 2 courses? If he is solving addiction? I find it more interesting to have a relationship table with classes of subjects. you create the classes, and add an entry.

  • An example to be clearer: Let’s assume that the discipline "Neurology II" has a "night class B of the 1st semester of 2015". In this case, the student is enrolled in this class specifically, and not simply in "Neurology II". Next semester, there will already be other classes of Neurology II, and if this student becomes dependent on this discipline, will have to enroll in this new class. The student relates to the class. The class relates to the subjects.

  • Take a look at [tour]. You can accept an answer if it solved your problem. You can vote on every post on the site as well. Did any help you more? You need something to be improved?

1 answer

3

I’ll give you an answer to give you some guidance. If this is not what you need, complicated, because we can not stay debating here until you get where you want, would be a question and an answer.

You did not specify the problem well. Of course, when specifying the model is practically ready. But without specifying it is difficult to help you. I will have to speculate. Mainly because you said you do not want something more complex. To make everything correct something more complex is necessary. But if you accept that everything is not "right", what is the acceptable limit? Only you know.

In fact this correct is well between quotation marks because it is difficult to say that there is right or wrong in modeling. The correct from an academic point of view is not always very practical. Often to optimize the database it is necessary to do the "wrong".

When you want simple solutions that just work, doing everything the books tell you can be an exaggeration.

But only you know the inflection point.

I’ll give you some tips on what I would do by looking over and making some speculations.

Considerations

The field cursoID of aluno can even be used, but if you want to do the right thing you should have a table that ties the student to the course. It may be too much to create a table just for this but it makes more sense (it’s what I said that you can’t know the limit). A student does not have as a characteristic a course, course is something transitory, it is something external and independent of the student.

For this there is the relationship 1:1. Interestingly people think that if it is 1:1 can always ignore the creation of a table and put everything together. But if you think it’s too much and you should be on the same table, I agree. It’s up to you. And who can say it will give some problem?

I imagine that the student can have zero or a course and not just one. So it is to think about. Of course the null exists for cases like this. There is much controversy whether or not to use nulls for this (eliminate a relationship).

A discipline only exists for that course? Part of the modeling says yes, part says no.

No matter how you relate, the table is missing disciplina with curso somehow.

If the discipline only exists for those courses is a 1:1 ratio, then you can choose whether to make a table to tie the discipline to the course or will use a field as you did. Which is the most certain is hard to say. A discipline can go without a course?

If the subject is linked to only one course, if the student changes course he is no longer attending that discipline.

But if the discipline can exist in several courses there are two things to consider: it needs to have a tie between courses and discipline; and then it doesn’t matter (?!? depends) which course the student is taking, he takes the discipline.

And then the field cursoId of disciplinaAlunoCurso would not be necessary.

You raised this possibility of the student changing course and still continuing to attend the course, so the discipline can not simply belong to the course, but rather several courses can be related to the disciplines.

Then you will use the available information of all disciplines he has completed and all necessary for the course to know if he has completed the course. But we’re already going beyond modeling.

Since there has been so much talk about classes in the comments, consider creating a class table and relating the student and discipline to the class. This doesn’t solve every possible situation in a school, but it already solves an important one. And then obviously the mooring will be student X discipline X class. Eventually course too. I am a living example that this is necessary because I changed shifts and had to take several courses in other courses (which I sometimes found out that the course was not quite the same).

Completion

If you look at everything that can happen, thinking that a course change probably needs to be recorded properly keeping track of what he did, that there could be different classes, and that there are a lot of other elements and factors involved, it’s going to be very complex. If you put all this aside ultimately you can have a single table that takes care of everything.

But I don’t guarantee any of this, it may need to be different. It’s easier to model real situations. Or at least of well-specified hypothetical situations.

  • This + what Bacco commented about the classes should already give a great help to the user, +1.

  • I almost talked about the classes but I don’t know, it can be a short course that has none of this :) Of course ideally I would have because no one enrolls in a class but in a class. The discipline is not inactive when the students finish it. The class yes. But it is what I said, to do right, think about everything, it becomes complex.

  • Exactly, if you fail to associate to a class you lose not only the "name" of the class, but the year and semester, which will probably be necessary when associating a grade to the student. But, as you said, it’s up to the AP to decide whether or not the model needs to deal with this.

  • I wanted to not invent much more than he has already defined but it is certainly something interesting to add. I would do so. Alias I did for a school in one of my first systems when I was 17 :) Initially in dBase :P and then Clipper. Good memories. Too bad I don’t have the sources to remember.

  • Excellent explanation, I’m going through a similar problem, I’m still needing to understand the logic behind, to model the database and make the right calls.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.