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





INSERT INTO "Student" VALUES ("1", "20", "101");
INSERT INTO "Student" VALUES ("2", "22", "102");
INSERT INTO "Student" VALUES ("3", "19", "103");
INSERT INTO "Student" VALUES ("4", "21", "104");
INSERT INTO "Student" VALUES ("5", "23", "105");
INSERT INTO "Student" VALUES ("6", "20", "106");
INSERT INTO "Student" VALUES ("7", "22", "107");
INSERT INTO "Student" VALUES ("8", "24", "108");
INSERT INTO "Student" VALUES ("9", "21", "109");
INSERT INTO "Student" VALUES ("10", "20", "110");
INSERT INTO "Pets" VALUES ("1001", "Dog");
INSERT INTO "Pets" VALUES ("1002", "Cat");
INSERT INTO "Pets" VALUES ("1003", "Parrot");
INSERT INTO "Pets" VALUES ("1004", "Hamster");
INSERT INTO "Pets" VALUES ("1005", "Fish");
INSERT INTO "Pets" VALUES ("1006", "Rabbit");
INSERT INTO "Pets" VALUES ("1007", "Dog");
INSERT INTO "Pets" VALUES ("1008", "Cat");
INSERT INTO "Pets" VALUES ("1009", "Turtle");
INSERT INTO "Pets" VALUES ("1010", "Snake");
INSERT INTO "Pets" VALUES ("1011", "Dog");
INSERT INTO "Pets" VALUES ("1012", "Cat");
INSERT INTO "Has_Pet" VALUES ("1", "1001");
INSERT INTO "Has_Pet" VALUES ("1", "1002");
INSERT INTO "Has_Pet" VALUES ("2", "1003");
INSERT INTO "Has_Pet" VALUES ("2", "1004");
INSERT INTO "Has_Pet" VALUES ("2", "1005");
INSERT INTO "Has_Pet" VALUES ("3", "1006");
INSERT INTO "Has_Pet" VALUES ("4", "1007");
INSERT INTO "Has_Pet" VALUES ("4", "1008");
INSERT INTO "Has_Pet" VALUES ("5", "1009");
INSERT INTO "Has_Pet" VALUES ("6", "1010");
INSERT INTO "Has_Pet" VALUES ("6", "1011");
INSERT INTO "Has_Pet" VALUES ("6", "1012");
INSERT INTO "Has_Pet" VALUES ("7", "1001");
INSERT INTO "Has_Pet" VALUES ("8", "1002");
INSERT INTO "Has_Pet" VALUES ("9", "1003");