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 UNIQUE,
"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 "Has_Pet" VALUES ("1");
INSERT INTO "Has_Pet" VALUES ("2");
INSERT INTO "Has_Pet" VALUES ("3");
INSERT INTO "Has_Pet" VALUES ("4");
INSERT INTO "Has_Pet" VALUES ("5");
INSERT INTO "Pets" VALUES ("101", "2", "5.5");
INSERT INTO "Pets" VALUES ("102", "1", "3.2");
INSERT INTO "Pets" VALUES ("103", "4", "7.8");
INSERT INTO "Pets" VALUES ("104", "1", "2.1");
INSERT INTO "Pets" VALUES ("105", "3", "6.0");
INSERT INTO "Pets" VALUES ("106", "0", "1.5");
INSERT INTO "Pets" VALUES ("107", "5", "8.3");
INSERT INTO "Pets" VALUES ("108", "1", "4.0");
INSERT INTO "Pets" VALUES ("109", "6", "9.1");
INSERT INTO "Pets" VALUES ("110", "2", "5.0");