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,
"PetType" VARCHAR(20),
"weight" FLOAT,
PRIMARY KEY ("PetID")
);

CREATE TABLE "Student" (
"StuID" INT UNIQUE,
"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", "25");
INSERT INTO "Student" VALUES ("5", "21");
INSERT INTO "Student" VALUES ("6", "23");
INSERT INTO "Student" VALUES ("7", "18");
INSERT INTO "Student" VALUES ("8", "24");
INSERT INTO "Student" VALUES ("9", "20");
INSERT INTO "Student" VALUES ("10", "26");
INSERT INTO "Pets" VALUES ("101", "Dog", "15.5");
INSERT INTO "Pets" VALUES ("102", "Cat", "8.2");
INSERT INTO "Pets" VALUES ("103", "Parrot", "0.5");
INSERT INTO "Pets" VALUES ("104", "Hamster", "0.3");
INSERT INTO "Pets" VALUES ("105", "Rabbit", "2.7");
INSERT INTO "Has_Pet" VALUES ("1", "101");
INSERT INTO "Has_Pet" VALUES ("2", "102");
INSERT INTO "Has_Pet" VALUES ("3", "103");
INSERT INTO "Has_Pet" VALUES ("5", "104");
INSERT INTO "Has_Pet" VALUES ("6", "105");
INSERT INTO "Has_Pet" VALUES ("7", "101");
INSERT INTO "Has_Pet" VALUES ("9", "102");