 -- Diákok tábla
CREATE TABLE students (
    student_id INT AUTO_INCREMENT PRIMARY KEY,
    student_name VARCHAR(200) NOT NULL,
    birth_date DATE NOT NULL
);

-- Tantárgyak tábla
CREATE TABLE subjects (
    subject_id INT AUTO_INCREMENT PRIMARY KEY,
    subject_name VARCHAR(100) NOT NULL
);

-- Jegyek tábla
CREATE TABLE grades (
    grade_id INT AUTO_INCREMENT PRIMARY KEY,
    student_id INT NOT NULL,
    subject_id INT NOT NULL,
    grade int NOT NULL,
    FOREIGN KEY (student_id) REFERENCES students(student_id),
    FOREIGN KEY (subject_id) REFERENCES subjects(subject_id)
);

-- Diákok tábla adatai
INSERT INTO students (student_name, birth_date) VALUES
('Kovács Máté', '2000-03-15'),
('Szabó Anna', '1999-07-22'),
('Virág Zoltán', '2001-11-05'),
('Kiss Lajos', '2000-01-30'),
('Fehér Lilla', '1998-12-10');

-- Tantárgy tábla adatai
INSERT INTO subjects (subject_name) VALUES
('Matematika'),
('Fizika'),
('Kémia'),
('Informatika'),
('Biológia'),
('Történelem');

-- Jegyek tábla adatai
INSERT INTO grades (student_id, subject_id, grade) VALUES
(1, 1, 4),  
(1, 1, 3),  
(1, 2, 5),  
(1, 2, 4),  
(1, 3, 4),  
(1, 4, 3),  
(1, 5, 5), 
(1, 5, 4), 
(2, 1, 3),  
(2, 1, 4),  
(2, 2, 4),  
(2, 2, 5),  
(2, 3, 3),  
(2, 3, 4),  
(2, 4, 3),  
(2, 5, 4),  
(3, 1, 4),  
(3, 1, 5), 
(3, 2, 4),  
(3, 2, 4), 
(3, 3, 2), 
(3, 4, 4),  
(3, 5, 5),  
(4, 1, 5),  
(4, 1, 4),  
(4, 2, 5),  
(4, 2, 4),  
(4, 3, 4),  
(4, 4, 4), 
(4, 5, 5),  
(5, 1, 3),  
(5, 1, 4),  
(5, 2, 4),  
(5, 2, 5),  
(5, 3, 5),  
(5, 3, 4),  
(5, 4, 3);  
