Fix Foreign Key Issue for Exam Attendance Module
Executing SQL Statements:
- ✗ END IF... - SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'END IF' at line 1
- ✗ END$$
CREATE TRIGGER `update_marks_on_present` ... - SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'END$$
CREATE TRIGGER `update_marks_on_present`
AFTER UPDATE ON `tbl_exam...' at line 1
- ✗ END IF... - SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'END IF' at line 1
- ✗ END IF... - SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'END IF' at line 1
- ✗ END$$
DELIMITER... - SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'END$$
DELIMITER' at line 1
- ✗ CREATE INDEX idx_ea_status_date ON tbl_exam_attend... - SQLSTATE[42000]: Syntax error or access violation: 1061 Duplicate key name 'idx_ea_status_date'
Fix Summary:
Successful: 0 statements
Errors: 6 statements
Errors:
- SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'END IF' at line 1
- SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'END$$
CREATE TRIGGER `update_marks_on_present`
AFTER UPDATE ON `tbl_exam...' at line 1
- SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'END IF' at line 1
- SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'END IF' at line 1
- SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'END$$
DELIMITER' at line 1
- SQLSTATE[42000]: Syntax error or access violation: 1061 Duplicate key name 'idx_ea_status_date'
Tables Created:
- student_registrations: Links students to exam subjects with fee information
- tbl_exam_attendance: Tracks student attendance during exams
Key Features:
- Automatic Marks Handling: When students are marked absent, their marks are automatically set to 'Absent'
- Default Present Status: All students are marked as 'Present' by default
- Foreign Key Integrity: Proper relationships between all tables
- Performance Optimized: Indexed for fast queries