--
-- Table structure for table `student_subject_year_average`
--

DROP TABLE IF EXISTS `student_subject_year_average`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `student_subject_year_average` (
  `serial_sya` int(11) NOT NULL AUTO_INCREMENT,
  `serial_lop` int(11) DEFAULT NULL,
  `serial_sbc` int(11) DEFAULT NULL,
  `serial_csb` int(11) DEFAULT NULL,
  `serial_crs` int(11) DEFAULT NULL,
  `serial_std` int(11) DEFAULT NULL,
  `serial_spt` int(11) DEFAULT NULL,
  `serial_lvl` int(11) DEFAULT NULL,
  `serial_scy` int(11) DEFAULT NULL,
  `serial_set` int(11) DEFAULT NULL,
  `average_sya` decimal(8,5) DEFAULT NULL,
  `recovery_exam_grade_sya` decimal(8,5) DEFAULT NULL,
  `recovery_replace_serial_prd` int(11) DEFAULT NULL,
  `resit_exam_grade_sya` decimal(8,5) DEFAULT NULL,
  `remedy_exam_grade_sya` decimal(8,5) DEFAULT NULL,
  `grace_exam_grade_sya` decimal(8,5) DEFAULT NULL,
  `final_grade_sya` decimal(8,5) DEFAULT NULL,
  `validation_parameter_sya` enum('NONE','RECOVERY','RESIT','REMEDY','GRACE') NOT NULL DEFAULT 'NONE',
  `subject_type_sya` enum('SIMPLE','PARENT') NOT NULL DEFAULT 'SIMPLE',
  PRIMARY KEY (`serial_sya`),
  KEY `fk_relationship_8747` (`serial_sbc`),
  KEY `fk_relationship_8748` (`serial_lop`),
  KEY `fk_relationship_8749` (`serial_std`,`serial_spt`,`serial_lvl`,`serial_scy`,`serial_set`),
  CONSTRAINT `fk_relationship_8747` FOREIGN KEY (`serial_sbc`) REFERENCES `subject_course` (`serial_sbc`),
  CONSTRAINT `fk_relationship_8748` FOREIGN KEY (`serial_lop`) REFERENCES `level_optional_group` (`serial_lop`),
  CONSTRAINT `fk_relationship_8749` FOREIGN KEY (`serial_std`, `serial_spt`, `serial_lvl`, `serial_scy`, `serial_set`) REFERENCES `student_year` (`serial_std`, `serial_spt`, `serial_lvl`, `serial_scy`, `serial_set`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `student_subject_year_average`
--

LOCK TABLES `student_subject_year_average` WRITE;
/*!40000 ALTER TABLE `student_subject_year_average` DISABLE KEYS */;
/*!40000 ALTER TABLE `student_subject_year_average` ENABLE KEYS */;
UNLOCK TABLES;