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", "10");
INSERT INTO "Highschooler" VALUES ("3", "11");
INSERT INTO "Highschooler" VALUES ("4", "12");
INSERT INTO "Highschooler" VALUES ("5", "9");
INSERT INTO "Highschooler" VALUES ("6", "10");
INSERT INTO "Highschooler" VALUES ("7", "11");
INSERT INTO "Highschooler" VALUES ("8", "12");
INSERT INTO "Highschooler" VALUES ("9", "9");
INSERT INTO "Highschooler" VALUES ("10", "10");
INSERT INTO "Highschooler" VALUES ("11", "11");
INSERT INTO "Highschooler" VALUES ("12", "12");
INSERT INTO "Highschooler" VALUES ("13", "9");
INSERT INTO "Highschooler" VALUES ("14", "10");
INSERT INTO "Highschooler" VALUES ("15", "11");
INSERT INTO "Highschooler" VALUES ("16", "12");
INSERT INTO "Highschooler" VALUES ("17", "9");
INSERT INTO "Highschooler" VALUES ("18", "10");
INSERT INTO "Highschooler" VALUES ("19", "11");
INSERT INTO "Highschooler" VALUES ("20", "12");
INSERT INTO "Highschooler" VALUES ("21", "8");
INSERT INTO "Highschooler" VALUES ("22", "13");
INSERT INTO "Highschooler" VALUES ("23", "0");
INSERT INTO "Highschooler" VALUES ("24", "12");
INSERT INTO "Highschooler" VALUES ("25", "9");
INSERT INTO "Friend" VALUES ("1", "2");
INSERT INTO "Friend" VALUES ("2", "3");
INSERT INTO "Friend" VALUES ("3", "4");
INSERT INTO "Friend" VALUES ("4", "5");
INSERT INTO "Friend" VALUES ("5", "6");
INSERT INTO "Likes" VALUES ("1", "3");
INSERT INTO "Likes" VALUES ("2", "4");
INSERT INTO "Likes" VALUES ("3", "5");
INSERT INTO "Likes" VALUES ("4", "6");
INSERT INTO "Likes" VALUES ("5", "7");