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 ("1001", "10");
INSERT INTO "Highschooler" VALUES ("1002", "10");
INSERT INTO "Highschooler" VALUES ("1003", "10");
INSERT INTO "Highschooler" VALUES ("1004", "10");
INSERT INTO "Highschooler" VALUES ("1005", "11");
INSERT INTO "Highschooler" VALUES ("1006", "11");
INSERT INTO "Highschooler" VALUES ("1007", "11");
INSERT INTO "Highschooler" VALUES ("1008", "12");
INSERT INTO "Highschooler" VALUES ("1009", "12");
INSERT INTO "Highschooler" VALUES ("1010", "12");
INSERT INTO "Highschooler" VALUES ("1011", "12");
INSERT INTO "Highschooler" VALUES ("1012", "12");
INSERT INTO "Highschooler" VALUES ("1013", "9");
INSERT INTO "Highschooler" VALUES ("1014", "9");
INSERT INTO "Highschooler" VALUES ("1015", "9");
INSERT INTO "Highschooler" VALUES ("1016", "9");
INSERT INTO "Highschooler" VALUES ("1017", "9");
INSERT INTO "Highschooler" VALUES ("1018", "9");
INSERT INTO "Friend" VALUES ("1001", "1002");
INSERT INTO "Friend" VALUES ("1001", "1003");
INSERT INTO "Friend" VALUES ("1002", "1001");
INSERT INTO "Friend" VALUES ("1003", "1001");
INSERT INTO "Friend" VALUES ("1005", "1006");
INSERT INTO "Friend" VALUES ("1006", "1005");
INSERT INTO "Friend" VALUES ("1008", "1009");
INSERT INTO "Friend" VALUES ("1009", "1008");
INSERT INTO "Friend" VALUES ("1010", "1011");
INSERT INTO "Friend" VALUES ("1011", "1010");
INSERT INTO "Friend" VALUES ("1012", "1008");
INSERT INTO "Friend" VALUES ("1013", "1014");
INSERT INTO "Friend" VALUES ("1014", "1013");
INSERT INTO "Friend" VALUES ("1015", "1016");
INSERT INTO "Friend" VALUES ("1016", "1015");
INSERT INTO "Friend" VALUES ("1017", "1018");
INSERT INTO "Friend" VALUES ("1018", "1017");
INSERT INTO "Likes" VALUES ("1001", "1005");
INSERT INTO "Likes" VALUES ("1002", "1006");
INSERT INTO "Likes" VALUES ("1003", "1007");
INSERT INTO "Likes" VALUES ("1004", "1008");
INSERT INTO "Likes" VALUES ("1005", "1001");
INSERT INTO "Likes" VALUES ("1006", "1002");
INSERT INTO "Likes" VALUES ("1007", "1003");
INSERT INTO "Likes" VALUES ("1008", "1004");
INSERT INTO "Likes" VALUES ("1009", "1010");
INSERT INTO "Likes" VALUES ("1010", "1009");
INSERT INTO "Likes" VALUES ("1011", "1012");
INSERT INTO "Likes" VALUES ("1012", "1011");
INSERT INTO "Likes" VALUES ("1013", "1015");
INSERT INTO "Likes" VALUES ("1014", "1016");
INSERT INTO "Likes" VALUES ("1015", "1013");
INSERT INTO "Likes" VALUES ("1016", "1014");
INSERT INTO "Likes" VALUES ("1017", "1018");
INSERT INTO "Likes" VALUES ("1018", "1017");