For Dummy Database If Not Exists School - 012937
For Dummy Database If Not Exists School - 012937
USE school_management;
-- Grading System
CREATE TABLE grade_symbols (
symbol VARCHAR(2) PRIMARY KEY,
description VARCHAR(20) NOT NULL,
min_percentage DECIMAL(5,2) NOT NULL,
max_percentage DECIMAL(5,2) NOT NULL
);
-- Reporting System
CREATE TABLE reports (
id INT PRIMARY KEY AUTO_INCREMENT,
student_id INT NOT NULL,
term INT NOT NULL,
academic_year YEAR NOT NULL,
term_start DATE NOT NULL,
term_end DATE NOT NULL,
overall_average DECIMAL(5,2),
class_position INT,
teacher_comment TEXT,
head_comment TEXT,
recommendation TEXT,
generated_at DATETIME DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (student_id) REFERENCES students(id)
);
-- Financial System
CREATE TABLE student_fees (
id INT PRIMARY KEY AUTO_INCREMENT,
student_id INT NOT NULL,
total_fees DECIMAL(10,2) NOT NULL,
paid_amount DECIMAL(10,2) DEFAULT 0.00,
due_date DATE NOT NULL,
FOREIGN KEY (student_id) REFERENCES students(id)
);
-- Initial Data
INSERT INTO grade_symbols (symbol, description, min_percentage, max_percentage)
VALUES
('E', 'Excellent', 90.00, 100.00),
('VG', 'Very Good', 80.00, 89.99),
('G', 'Good', 70.00, 79.99),
('A', 'Average', 50.00, 69.99),
('U', 'Unsufficient', 30.00, 49.99),
('VU', 'Very Unsufficient', 0.00, 29.99);