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

CREATE TABLE "Student" (
"StuID" INT UNIQUE,
"LName" VARCHAR(12),
"Fname" VARCHAR(12),
"Age" INT,
PRIMARY KEY ("StuID")
);





INSERT INTO "Pets" VALUES ("1", "cat", "3", "5.2");
INSERT INTO "Pets" VALUES ("2", "Dog", "5", "12.1");
INSERT INTO "Pets" VALUES ("3", "Bird", "2", "0.5");
INSERT INTO "Pets" VALUES ("4", "cat", "4", "6.0");
INSERT INTO "Pets" VALUES ("5", "Fish", "1", "0.1");
INSERT INTO "Pets" VALUES ("6", "cat", "3", "5.5");
INSERT INTO "Pets" VALUES ("7", "Dog", "3", "10.0");
INSERT INTO "Pets" VALUES ("8", "cat", "6", "7.0");
INSERT INTO "Pets" VALUES ("9", "Rabbit", "2", "2.5");
INSERT INTO "Pets" VALUES ("10", "cat", "3", "5.8");
INSERT INTO "Student" VALUES ("101", "Smith", "John", "20");
INSERT INTO "Student" VALUES ("102", "Doe", "Jane", "22");
INSERT INTO "Student" VALUES ("103", "Brown", "Peter", "19");
INSERT INTO "Student" VALUES ("104", "White", "Alice", "21");
INSERT INTO "Student" VALUES ("105", "Green", "Bob", "23");
INSERT INTO "Student" VALUES ("106", "Black", "Charlie", "20");
INSERT INTO "Student" VALUES ("107", "Grey", "Diana", "22");
INSERT INTO "Student" VALUES ("108", "Blue", "Eve", "19");
INSERT INTO "Has_Pet" VALUES ("101", "1");
INSERT INTO "Has_Pet" VALUES ("102", "2");
INSERT INTO "Has_Pet" VALUES ("103", "3");
INSERT INTO "Has_Pet" VALUES ("104", "4");
INSERT INTO "Has_Pet" VALUES ("105", "5");
INSERT INTO "Has_Pet" VALUES ("101", "6");
INSERT INTO "Has_Pet" VALUES ("106", "7");
INSERT INTO "Has_Pet" VALUES ("107", "8");
INSERT INTO "Has_Pet" VALUES ("108", "9");
INSERT INTO "Has_Pet" VALUES ("102", "10");