My database allows me to save different grades of the same subject in the same period

0

I have another question related to the database. I have the following relational database for rating control. However, I have a problem in the PeriodicPeriod table, which is that it is allowing me to place different grades for the same subject during the same period, but when they have different sections . That is to say, I have Pedro Pérez, who for the period 2018-01 I can place 60 and 70 points in sections 01 and 02 of Mathematics, respectively. This is incorrect, given that for a period I can only have one qualification for a subject and I must study it only in one section during that period.

I leave the relational model that I did to see if they can help me in the detection of the error.

Thank you very much in advance !!!

    
asked by Rossy 15.09.2018 в 05:14
source

2 answers

0

Add the respective fields as a composite primary key. In AssignmentPeriod would be the first 3 and the student's ID. The same adds pk in careerStudent and studiesEstudios. In itself, em primary key (pk) or primary key add the constraint or unique constraint. That does not allow it to repeat itself.

    
answered by 15.09.2018 в 06:26
0

I did what you told me @Jocksan Cruz, but I do not know if I missed something because everything is the same. I show you the definition I made of the tables:

    
answered by 15.09.2018 в 16:44