use `akura`;
/*!40014 SET UNIQUE_CHECKS=0 */;
/*!40014 SET FOREIGN_KEY_CHECKS=0 */;


--
-- Table structure for table `DAILY_STUDENT_ATTENDANCE`
--
DELETE FROM `DAILY_STUDENT_ATTENDANCE` 
WHERE `STUDENT_ID` NOT IN (SELECT STUDENT_ID 
			   FROM `STUDENT`);

--
-- Table structure for table `DAILY_TEACHER_ATTENDANCE`
--
DELETE FROM `DAILY_TEACHER_ATTENDANCE` 
WHERE `STAFF_ID` NOT IN (SELECT STAFF_ID 
			   FROM `STAFF`);

--
-- Table structure for table `STUDENT_SEMINAR`
--
DELETE FROM `STUDENT_SEMINAR` 
WHERE `STUDENT_ID` NOT IN (SELECT STUDENT_ID 
			   FROM `STUDENT`);

DELETE FROM `STUDENT_SEMINAR` 
WHERE `SEMINAR_ID` NOT IN (SELECT SEMINAR_ID 
			   FROM `SEMINAR`);
--
-- Table structure for table `SPECIAL_EVENTS`
--
DELETE FROM `SPECIAL_EVENTS` 
WHERE `PARTICIPANT_CATEGORY_ID` NOT IN (SELECT PARTICIPANT_CATEGORY_ID 
			   		FROM `PARTICIPANT_CATEGORY`);

--
-- Table structure for table `SPECIAL_EVENT_PARTICIPATION`
--
DELETE FROM `SPECIAL_EVENT_PARTICIPATION` 
WHERE `SPECIAL_EVENT_ID` NOT IN (SELECT SPECIAL_EVENTS_ID 
			   	 FROM `SPECIAL_EVENTS`);

DELETE FROM `SPECIAL_EVENT_PARTICIPATION` 
WHERE `CLASS_GRADE_ID` NOT IN (SELECT CLASS_GRADE_ID 
			       FROM `CLASS_GRADE`);

DELETE FROM `SPECIAL_EVENT_PARTICIPATION` 
WHERE `SPORT_CATEGORY_ID` NOT IN (SELECT SPORT_CATEGORY_ID 
			   	  FROM `SPORT_CATEGORY`);

DELETE FROM `SPECIAL_EVENT_PARTICIPATION` 
WHERE `CLUB_SOCIETY_ID` NOT IN (SELECT CLUB_SOCIETY_ID 
			   	FROM `CLUB_SOCIETY`);


--
-- Table structure for table `SPECIAL_EVENT_ATTENDANCE`
--
DELETE FROM `SPECIAL_EVENT_ATTENDANCE` 
WHERE `SPECIAL_EVENT_PARTICIPATION_ID` NOT IN (SELECT SPECIAL_EVENT_PARTICIPATION_ID 
			   	 	       FROM `SPECIAL_EVENT_PARTICIPATION`);

DELETE FROM `SPECIAL_EVENT_ATTENDANCE` 
WHERE `STUDENT_ID` NOT IN (SELECT STUDENT_ID 
			   FROM `STUDENT`);



/*!40014 SET FOREIGN_KEY_CHECKS=1 */;
/*!40014 SET UNIQUE_CHECKS=1 */;