CREATE TABLE TiberDM.CategoryFact (
    id                  MEDIUMINT   NOT NULL AUTO_INCREMENT,
    SchoolDimId         MEDIUMINT   NOT NULL,
    AcademicYearDimId   MEDIUMINT   NOT NULL,
    ExamDimId           MEDIUMINT   NOT NULL,
    StudentDimId        MEDIUMINT   NOT NULL,
    CategoryDimId       MEDIUMINT   NOT NULL,
    PercentPoints       Decimal(10,2),
    CorrectCount        Int,
    PRIMARY KEY (id)
);

Create Unique Index CategoryFact_Uidx01
On TiberDM.CategoryFact (SchoolDimId, AcademicYearDimId, ExamDimId, StudentDimId, CategoryDimId);
;

Create index CategoryFact_ExamDim_Idx
On TiberDM.CategoryFact (ExamDimId)
;

