-- create a table
CREATE TABLE students (
student_id INTEGER PRIMARY KEY,
FirstName VARCHAR(50) NOT NULL,
LastName VARCHAR(50) NOT NULL,
Grade INT
);
CREATE TABLE Results(
student_id INT PRIMARY KEY,
Subject VARCHAR(50),
Marks INT
);
-- insert some values
INSERT INTO students (student_id,FirstName,LastName,Grade) VALUES
(1,'John','Doe',7),
(2,'Jane','Smith',5),
(3,'Michael','Johnson',4),
(4,'Emily','Brown',8),
(5,'Alice','Jackson',6),
(6,'Jake','Joe',7);
INSERT INTO Result(student_id,Subject,Marks) VALUES
(1,'Coding',22),
(2,'Coding',23),
(3,'Science',20),
(4,'English',25),
(5,'French',24);
-- Basic SQL Queries for School Data
-- Select all Grade 7 students:
SELECT *FROM students
WHERE Grade=7;
-- --Count the number of Grade 7 students
-- SELECT COUNT(*) FROM students
-- WHERE Grade=7
--Find the student with a specific StudentID:
SELECT *FROM students
WHERE student_id = 4;
UPDATE students SET Grade=7
WHERE student_id=3;
SELECT *FROM students;
--Check the marks for student where student_id=5;
SELECT marks *FROM Results
WHERE student_id=5;
To embed this project on your website, copy the following code and paste it into your website's HTML: