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

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





INSERT INTO "Student" VALUES ("1", "Smith", "John", "101");
INSERT INTO "Student" VALUES ("2", "Doe", "Jane", "102");
INSERT INTO "Student" VALUES ("3", "Brown", "Charlie", "103");
INSERT INTO "Student" VALUES ("4", "Davis", "Alice", "104");
INSERT INTO "Student" VALUES ("5", "Wilson", "Bob", "105");
INSERT INTO "Student" VALUES ("6", "Taylor", "Eve", "106");
INSERT INTO "Pets" VALUES ("1", "dog", "3");
INSERT INTO "Pets" VALUES ("2", "cat", "2");
INSERT INTO "Pets" VALUES ("3", "dog", "5");
INSERT INTO "Pets" VALUES ("4", "parrot", "1");
INSERT INTO "Pets" VALUES ("5", "cat", "4");
INSERT INTO "Pets" VALUES ("6", "dog", "7");
INSERT INTO "Pets" VALUES ("7", "hamster", "1");
INSERT INTO "Has_Pet" VALUES ("1", "1");
INSERT INTO "Has_Pet" VALUES ("1", "4");
INSERT INTO "Has_Pet" VALUES ("2", "2");
INSERT INTO "Has_Pet" VALUES ("2", "4");
INSERT INTO "Has_Pet" VALUES ("3", "3");
INSERT INTO "Has_Pet" VALUES ("3", "5");
INSERT INTO "Has_Pet" VALUES ("4", "6");
INSERT INTO "Has_Pet" VALUES ("5", "7");
INSERT INTO "Has_Pet" VALUES ("6", "1");
INSERT INTO "Has_Pet" VALUES ("6", "7");