

CREATE TABLE school_levels(
id INT AUTO_INCREMENT PRIMARY KEY,
level_name VARCHAR(20),
principal_name VARCHAR(100)
);

CREATE TABLE academic_years(
id INT AUTO_INCREMENT PRIMARY KEY,
year_name VARCHAR(20),
is_active TINYINT(1)
);

CREATE TABLE semesters(
id INT AUTO_INCREMENT PRIMARY KEY,
semester_name VARCHAR(20),
is_active TINYINT(1)
);

INSERT INTO semesters(semester_name,is_active) VALUES
('Ganjil',1),('Genap',0);

CREATE TABLE classes(
id INT AUTO_INCREMENT PRIMARY KEY,
class_name VARCHAR(20),
level_id INT,
homeroom_teacher_id INT
);

CREATE TABLE students(
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(100),
student_number VARCHAR(50),
level_id INT,
class_id INT,
academic_year_id INT
);
