--UPDATE
/*
A table containing the students enrolled in a yearly course has incorrect data in records with ids between 20 and 100 (inclusive).
TABLE enrollments
id INTEGER NOT NULL PRIMARY KEY
year INTEGER NOT NULL
studentId INTEGER NOT NULL
Write a query that updates the field 'year' of every faulty record to 2015.
*/
CREATE TABLE enrollments(
id INTEGER NOT NULL PRIMARY KEY,
name VARCHAR(100),
year INTEGER NOT NULL,
studentId INTEGER NOT NULL);
INSERT INTO enrollments(name,year, studentId) VALUES ("fran",2024, 12);
INSERT INTO enrollments(name,year, studentId) VALUES ("tet",2025, 30);
INSERT INTO enrollments(name,year, studentId) VALUES ("sil",2027,100);
INSERT INTO enrollments(name,year, studentId) VALUES ("hell",2012,200);
SELECT * FROM enrollments ;
UPDATE enrollments SET year = 2099 where studentId between 12 and 100;
SELECT * FROM enrollments Order by year desc;
SELECT Count(*) FROM enrollments where year >= 2020;
SELECT Name, year FROM enrollments where year >= 2020 Order By Name Asc, year Desc;
-- https://[Log in to view URL]
--To fetch records of where Name starts with the letter h.
SELECT * FROM enrollments WHERE Name LIKE 'h%';
--contains string e
SELECT * FROM enrollments WHERE Name LIKE '%e%';
SELECT * FROM enrollments WHERE year in (2012, 2024);
SELECT * FROM enrollments WHERE year <> 2012;
To embed this project on your website, copy the following code and paste it into your website's HTML: