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),
PRIMARY KEY ("PetID")
);

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





INSERT INTO "Student" VALUES ("1", "Smith", "22");
INSERT INTO "Student" VALUES ("2", "Johnson", "19");
INSERT INTO "Student" VALUES ("3", "Williams", "25");
INSERT INTO "Student" VALUES ("4", "Brown", "20");
INSERT INTO "Student" VALUES ("5", "Jones", "30");
INSERT INTO "Student" VALUES ("6", "Garcia", "21");
INSERT INTO "Student" VALUES ("7", "Miller", "18");
INSERT INTO "Student" VALUES ("8", "Davis", "23");
INSERT INTO "Pets" VALUES ("101", "Dog");
INSERT INTO "Pets" VALUES ("102", "Cat");
INSERT INTO "Pets" VALUES ("103", "Parrot");
INSERT INTO "Pets" VALUES ("104", "Hamster");
INSERT INTO "Pets" VALUES ("105", "Fish");
INSERT INTO "Pets" VALUES ("106", "Rabbit");
INSERT INTO "Pets" VALUES ("107", "Turtle");
INSERT INTO "Pets" VALUES ("108", "Snake");
INSERT INTO "Pets" VALUES ("109", "Lizard");
INSERT INTO "Has_Pet" VALUES ("1", "101");
INSERT INTO "Has_Pet" VALUES ("1", "102");
INSERT INTO "Has_Pet" VALUES ("2", "103");
INSERT INTO "Has_Pet" VALUES ("3", "104");
INSERT INTO "Has_Pet" VALUES ("3", "105");
INSERT INTO "Has_Pet" VALUES ("4", "106");
INSERT INTO "Has_Pet" VALUES ("5", "107");
INSERT INTO "Has_Pet" VALUES ("5", "108");
INSERT INTO "Has_Pet" VALUES ("5", "109");
INSERT INTO "Has_Pet" VALUES ("6", "101");
INSERT INTO "Has_Pet" VALUES ("7", "102");
INSERT INTO "Has_Pet" VALUES ("8", "103");
INSERT INTO "Has_Pet" VALUES ("8", "104");