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 UNIQUE,
"Age" INT,
PRIMARY KEY ("StuID")
);





INSERT INTO "Student" VALUES ("1", "10");
INSERT INTO "Student" VALUES ("2", "12");
INSERT INTO "Student" VALUES ("3", "15");
INSERT INTO "Student" VALUES ("4", "8");
INSERT INTO "Student" VALUES ("5", "11");
INSERT INTO "Student" VALUES ("6", "9");
INSERT INTO "Student" VALUES ("7", "13");
INSERT INTO "Student" VALUES ("8", "14");
INSERT INTO "Pets" VALUES ("1", "dog", "2", "15.5");
INSERT INTO "Pets" VALUES ("2", "Cat", "3", "5.2");
INSERT INTO "Pets" VALUES ("3", "dog", "1", "10.1");
INSERT INTO "Pets" VALUES ("4", "Bird", "1", "0.5");
INSERT INTO "Pets" VALUES ("5", "dog", "4", "20.0");
INSERT INTO "Pets" VALUES ("6", "Cat", "2", "4.8");
INSERT INTO "Pets" VALUES ("7", "dog", "1", "12.3");
INSERT INTO "Pets" VALUES ("8", "Fish", "1", "0.1");
INSERT INTO "Pets" VALUES ("9", "dog", "3", "18.7");
INSERT INTO "Pets" VALUES ("10", "dog", "5", "25.0");
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 "Has_Pet" VALUES ("6");
INSERT INTO "Has_Pet" VALUES ("7");
INSERT INTO "Has_Pet" VALUES ("8");