-- Create a table to store student information
CREATE TABLE Students(
student_id INT AUTO_INCREMENT PRIMARY KEY,
first_name VARCHAR(50) NOT NULL,
last_name VARCHAR(50) NOT NULL,
grade VARCHAR(10) NOT NULL
);
-- Insert sample students into the students table
INSERT INTO Students(first_name,last_name,grade) VALUES
('John','Doe','10th Grade'),
('Jane','Smith',"11th Grade"),
('Alice', 'Johnson','10th Grade');
SELECT *FROM Students
CREATE TABLE Subjects(
subject_id INT AUTO_INCREMENT PRIMARY KEY
subject_name VARCHAR(50) NOT NULL
);
-- Create a table to store student marks
CREATE TABLE Marks(
mark_id INT AUTO_INCREMENT PRIMARY KEY
student_id INT,
subject_id INT,
marks_obtained INT,
FOREIGN KEY (student_id) REFERENCES Students(student_id),
FOREIGN_KEY (subject_id) REFERENCES Subjects(subject_id);
);
INSERT INTO Subjects(subject_name) VALUES
('Math'),
('Science'),
('History'),
('Spanish');
INSERT INTO Marks (student_id, subject_id, marks_obtained) VALUES
(1, 1, 90),
(1, 2, 85),
(1, 3, 92),
(2, 1, 88),
(2, 2, 78),
(2, 3, 95),
(3, 1, 92),
(3, 2, 89),
(3, 3, 94);
SELECT *FROM Marks;
To embed this project on your website, copy the following code and paste it into your website's HTML: