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 "Has_Pet" (
"StuID" INT,
"PetID" INT,
FOREIGN KEY ("PetID") REFERENCES "Pets"("PetID"),
FOREIGN KEY ("StuID") REFERENCES "Student"("StuID")
);

CREATE TABLE "Pets" (
"PetID" INT UNIQUE,
"pet_age" INT,
"weight" FLOAT,
PRIMARY KEY ("PetID")
);

CREATE TABLE "Student" (
"StuID" INT,
"Age" INT,
PRIMARY KEY ("StuID")
);





INSERT INTO "Student" VALUES ("1", "20");
INSERT INTO "Student" VALUES ("2", "22");
INSERT INTO "Student" VALUES ("3", "19");
INSERT INTO "Student" VALUES ("4", "21");
INSERT INTO "Student" VALUES ("5", "23");
INSERT INTO "Student" VALUES ("6", "18");
INSERT INTO "Student" VALUES ("7", "25");
INSERT INTO "Pets" VALUES ("101", "3", "9.5");
INSERT INTO "Pets" VALUES ("102", "5", "10.0");
INSERT INTO "Pets" VALUES ("103", "2", "10.1");
INSERT INTO "Pets" VALUES ("104", "7", "15.2");
INSERT INTO "Pets" VALUES ("105", "1", "8.0");
INSERT INTO "Pets" VALUES ("106", "4", "12.3");
INSERT INTO "Pets" VALUES ("107", "6", "20.0");
INSERT INTO "Pets" VALUES ("108", "3", "9.9");
INSERT INTO "Pets" VALUES ("109", "8", "11.0");
INSERT INTO "Pets" VALUES ("110", "2", "5.5");
INSERT INTO "Has_Pet" VALUES ("1", "101");
INSERT INTO "Has_Pet" VALUES ("1", "103");
INSERT INTO "Has_Pet" VALUES ("2", "104");
INSERT INTO "Has_Pet" VALUES ("3", "105");
INSERT INTO "Has_Pet" VALUES ("4", "106");
INSERT INTO "Has_Pet" VALUES ("5", "107");
INSERT INTO "Has_Pet" VALUES ("6", "108");
INSERT INTO "Has_Pet" VALUES ("7", "109");
INSERT INTO "Has_Pet" VALUES ("7", "110");