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,
"name" TEXT,
"grade" INT,
PRIMARY KEY ("ID")
);

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





INSERT INTO "Highschooler" VALUES ("1001", "John", "10");
INSERT INTO "Highschooler" VALUES ("1002", "Kyle", "11");
INSERT INTO "Highschooler" VALUES ("1003", "Sarah", "10");
INSERT INTO "Highschooler" VALUES ("1004", "Emily", "12");
INSERT INTO "Highschooler" VALUES ("1005", "David", "9");
INSERT INTO "Highschooler" VALUES ("1006", "Jessica", "11");
INSERT INTO "Highschooler" VALUES ("1007", "Michael", "10");
INSERT INTO "Highschooler" VALUES ("1008", "Ashley", "12");
INSERT INTO "Highschooler" VALUES ("1009", "Chris", "9");
INSERT INTO "Highschooler" VALUES ("1010", "Megan", "11");
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 ("1004", "1008");
INSERT INTO "Friend" VALUES ("1005", "1009");
INSERT INTO "Friend" VALUES ("1006", "1010");
INSERT INTO "Friend" VALUES ("1007", "1001");
INSERT INTO "Friend" VALUES ("1008", "1004");
INSERT INTO "Friend" VALUES ("1009", "1005");
INSERT INTO "Likes" VALUES ("1001", "1004");
INSERT INTO "Likes" VALUES ("1002", "1003");
INSERT INTO "Likes" VALUES ("1003", "1002");
INSERT INTO "Likes" VALUES ("1004", "1001");
INSERT INTO "Likes" VALUES ("1005", "1006");
INSERT INTO "Likes" VALUES ("1006", "1005");
INSERT INTO "Likes" VALUES ("1007", "1008");
INSERT INTO "Likes" VALUES ("1008", "1007");
INSERT INTO "Likes" VALUES ("1009", "1010");
INSERT INTO "Likes" VALUES ("1010", "1009");