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

CREATE TABLE "Pets" (
"PetID" INT,
"PetType" VARCHAR(20),
"pet_age" INT,
"weight" FLOAT,
PRIMARY KEY ("PetID")
);

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





INSERT INTO "Student" VALUES ("1", "20", "M");
INSERT INTO "Student" VALUES ("2", "22", "F");
INSERT INTO "Student" VALUES ("3", "19", "M");
INSERT INTO "Student" VALUES ("4", "21", "F");
INSERT INTO "Student" VALUES ("5", "23", "M");
INSERT INTO "Pets" VALUES ("101", "Dog", "5", "20.5");
INSERT INTO "Pets" VALUES ("102", "Cat", "3", "8.2");
INSERT INTO "Pets" VALUES ("103", "Parrot", "1", "0.5");
INSERT INTO "Pets" VALUES ("104", "Hamster", "1", "0.1");
INSERT INTO "Pets" VALUES ("105", "Rabbit", "2", "3.0");
INSERT INTO "Pets" VALUES ("106", "Turtle", "10", "15.0");
INSERT INTO "Pets" VALUES ("107", "Fish", "1", "0.05");
INSERT INTO "Has_Pet" VALUES ("1");
INSERT INTO "Has_Pet" VALUES ("1");
INSERT INTO "Has_Pet" VALUES ("2");
INSERT INTO "Has_Pet" VALUES ("2");
INSERT INTO "Has_Pet" VALUES ("3");
INSERT INTO "Has_Pet" VALUES ("4");
INSERT INTO "Has_Pet" VALUES ("5");