CREATE TABLE Student (
    StudentID INT PRIMARY KEY AUTO_INCREMENT,  
    student_name VARCHAR(100) NOT NULL,        
    age INT,                                  
    grade CHAR(1)                           
);

-- Create the Result Table
CREATE TABLE Result (
    ResultID INT PRIMARY KEY AUTO_INCREMENT,   
    StudentID INT,                             
    subject VARCHAR(100),                      
    marks INT,                                 
    result VARCHAR(20),                        
    FOREIGN KEY (StudentID) REFERENCES Student(StudentID) 
);

-- Insert sample data into the Student Table
INSERT INTO Student (student_name, age, grade)
VALUES 
('John Doe', 20, 'B'),
('Jane Smith', 22, 'A'),
('Mark Johnson', 21, 'C');

-- Insert sample data into the Result Table
INSERT INTO Result (StudentID, subject, marks, result)
VALUES 
(1, 'Mathematics', 85, 'Pass'),
(1, 'Physics', 78, 'Pass'),
(2, 'Mathematics', 92, 'Pass'),
(2, 'Physics', 88, 'Pass'),
(3, 'Mathematics', 60, 'Pass'),
(3, 'Physics', 55, 'Fail');

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: