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

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





INSERT INTO "Student" VALUES ("1", "Smith", "20", "101");
INSERT INTO "Student" VALUES ("2", "Johnson", "22", "102");
INSERT INTO "Student" VALUES ("3", "Williams", "19", "103");
INSERT INTO "Student" VALUES ("4", "Brown", "21", "101");
INSERT INTO "Student" VALUES ("5", "Jones", "23", "104");
INSERT INTO "Student" VALUES ("6", "Garcia", "18", "102");
INSERT INTO "Student" VALUES ("7", "Miller", "24", "103");
INSERT INTO "Student" VALUES ("8", "Davis", "20", "104");
INSERT INTO "Student" VALUES ("9", "Rodriguez", "22", "101");
INSERT INTO "Student" VALUES ("10", "Martinez", "25", "102");
INSERT INTO "Pets" VALUES ("1", "Dog");
INSERT INTO "Pets" VALUES ("2", "Cat");
INSERT INTO "Pets" VALUES ("3", "Fish");
INSERT INTO "Pets" VALUES ("4", "Bird");
INSERT INTO "Pets" VALUES ("5", "Hamster");
INSERT INTO "Has_Pet" VALUES ("1", "1");
INSERT INTO "Has_Pet" VALUES ("2", "2");
INSERT INTO "Has_Pet" VALUES ("3", "3");
INSERT INTO "Has_Pet" VALUES ("5", "4");
INSERT INTO "Has_Pet" VALUES ("7", "5");
INSERT INTO "Has_Pet" VALUES ("9", "1");