PRAGMA foreign_keys = ON;

PRAGMA writable_schema = 1;
DELETE FROM sqlite_master WHERE type IN ("table", "index", "trigger");
PRAGMA writable_schema = 0;
VACUUM;

CREATE TABLE "Friend" (
"student_id" INT,
"friend_id" INT,
PRIMARY KEY ("student_id", "friend_id"),
FOREIGN KEY ("student_id") REFERENCES "Highschooler"("ID"),
FOREIGN KEY ("friend_id") REFERENCES "Highschooler"("ID")
);

CREATE TABLE "Highschooler" (
"ID" INT UNIQUE,
"grade" INT,
PRIMARY KEY ("ID")
);

CREATE TABLE "Likes" (
"student_id" INT,
"liked_id" INT,
PRIMARY KEY ("student_id", "liked_id"),
FOREIGN KEY ("student_id") REFERENCES "Highschooler"("ID")
);





INSERT INTO "Highschooler" VALUES ("1", "9");
INSERT INTO "Highschooler" VALUES ("2", "9");
INSERT INTO "Highschooler" VALUES ("3", "9");
INSERT INTO "Highschooler" VALUES ("4", "10");
INSERT INTO "Highschooler" VALUES ("5", "10");
INSERT INTO "Highschooler" VALUES ("6", "10");
INSERT INTO "Highschooler" VALUES ("7", "10");
INSERT INTO "Highschooler" VALUES ("8", "11");
INSERT INTO "Highschooler" VALUES ("9", "11");
INSERT INTO "Highschooler" VALUES ("10", "12");
INSERT INTO "Highschooler" VALUES ("11", "12");
INSERT INTO "Highschooler" VALUES ("12", "12");
INSERT INTO "Highschooler" VALUES ("13", "12");
INSERT INTO "Highschooler" VALUES ("14", "12");
INSERT INTO "Highschooler" VALUES ("15", "12");
INSERT INTO "Highschooler" VALUES ("16", "12");
INSERT INTO "Highschooler" VALUES ("17", "12");
INSERT INTO "Highschooler" VALUES ("18", "12");
INSERT INTO "Highschooler" VALUES ("19", "12");
INSERT INTO "Highschooler" VALUES ("20", "12");
INSERT INTO "Highschooler" VALUES ("21", "12");
INSERT INTO "Highschooler" VALUES ("22", "12");
INSERT INTO "Highschooler" VALUES ("23", "12");
INSERT INTO "Highschooler" VALUES ("24", "12");
INSERT INTO "Highschooler" VALUES ("25", "12");
INSERT INTO "Highschooler" VALUES ("26", "11");
INSERT INTO "Highschooler" VALUES ("27", "11");
INSERT INTO "Highschooler" VALUES ("28", "11");
INSERT INTO "Highschooler" VALUES ("29", "11");
INSERT INTO "Highschooler" VALUES ("30", "11");
INSERT INTO "Highschooler" VALUES ("31", "10");
INSERT INTO "Highschooler" VALUES ("32", "10");
INSERT INTO "Highschooler" VALUES ("33", "9");
INSERT INTO "Highschooler" VALUES ("34", "9");
INSERT INTO "Highschooler" VALUES ("35", "9");
INSERT INTO "Highschooler" VALUES ("36", "9");
INSERT INTO "Highschooler" VALUES ("37", "9");
INSERT INTO "Highschooler" VALUES ("38", "9");
INSERT INTO "Highschooler" VALUES ("39", "9");
INSERT INTO "Highschooler" VALUES ("40", "9");