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),
"Fname" VARCHAR(12),
"Age" INT,
"Major" INT,
PRIMARY KEY ("StuID")
);





INSERT INTO "Pets" VALUES ("1", "Dog");
INSERT INTO "Pets" VALUES ("2", "Cat");
INSERT INTO "Pets" VALUES ("3", "Bird");
INSERT INTO "Pets" VALUES ("4", "Fish");
INSERT INTO "Pets" VALUES ("5", "Hamster");
INSERT INTO "Pets" VALUES ("6", "Rabbit");
INSERT INTO "Pets" VALUES ("7", "Snake");
INSERT INTO "Student" VALUES ("101", "Smith", "Alice", "20", "1");
INSERT INTO "Student" VALUES ("102", "Johnson", "Bob", "22", "2");
INSERT INTO "Student" VALUES ("103", "Williams", "Charlie", "19", "1");
INSERT INTO "Student" VALUES ("104", "Brown", "Diana", "21", "3");
INSERT INTO "Student" VALUES ("105", "Jones", "Eve", "20", "2");
INSERT INTO "Student" VALUES ("106", "Garcia", "Frank", "23", "1");
INSERT INTO "Student" VALUES ("107", "Miller", "Alice", "20", "3");
INSERT INTO "Student" VALUES ("108", "Davis", "Grace", "18", "4");
INSERT INTO "Student" VALUES ("109", "Rodriguez", "Bob", "22", "4");
INSERT INTO "Student" VALUES ("110", "Martinez", "Henry", "25", "5");
INSERT INTO "Has_Pet" VALUES ("101", "1");
INSERT INTO "Has_Pet" VALUES ("102", "2");
INSERT INTO "Has_Pet" VALUES ("103", "1");
INSERT INTO "Has_Pet" VALUES ("104", "3");
INSERT INTO "Has_Pet" VALUES ("105", "4");
INSERT INTO "Has_Pet" VALUES ("106", "5");
INSERT INTO "Has_Pet" VALUES ("107", "1");
INSERT INTO "Has_Pet" VALUES ("108", "6");
INSERT INTO "Has_Pet" VALUES ("109", "2");
INSERT INTO "Has_Pet" VALUES ("101", "7");
INSERT INTO "Has_Pet" VALUES ("104", "1");