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 "Addresses" (
"address_id" INT UNIQUE,
"line_1" VARCHAR(255),
"line_2" VARCHAR(255),
PRIMARY KEY ("address_id")
);

CREATE TABLE "Students" (
"student_id" INT,
"current_address_id" INT,
"permanent_address_id" INT,
PRIMARY KEY ("student_id"),
FOREIGN KEY ("permanent_address_id") REFERENCES "Addresses"("address_id"),
FOREIGN KEY ("current_address_id") REFERENCES "Addresses"("address_id")
);





INSERT INTO "Addresses" VALUES ("1", "123 Maple St", "Apt 4B");
INSERT INTO "Addresses" VALUES ("2", "456 Oak Ave", "Suite 12");
INSERT INTO "Addresses" VALUES ("3", "789 Pine Rd", "");
INSERT INTO "Addresses" VALUES ("4", "101 Elm St", "Floor 3");
INSERT INTO "Addresses" VALUES ("5", "202 Birch Blvd", "Unit 5");
INSERT INTO "Addresses" VALUES ("6", "303 Cedar Ln", "NULL");
INSERT INTO "Addresses" VALUES ("7", "404 Spruce Dr", "Building A");
INSERT INTO "Addresses" VALUES ("8", "505 Walnut St", "Apt 1");
INSERT INTO "Addresses" VALUES ("9", "606 Chestnut Ct", "");
INSERT INTO "Addresses" VALUES ("10", "707 Willow Way", "Suite 200");
INSERT INTO "Students" VALUES ("1001", "1", "2");
INSERT INTO "Students" VALUES ("1002", "3", "4");
INSERT INTO "Students" VALUES ("1003", "5", "6");
INSERT INTO "Students" VALUES ("1004", "7", "8");
INSERT INTO "Students" VALUES ("1005", "9", "10");
INSERT INTO "Students" VALUES ("1006", "2", "3");
INSERT INTO "Students" VALUES ("1007", "4", "5");
INSERT INTO "Students" VALUES ("1008", "6", "7");
INSERT INTO "Students" VALUES ("1009", "8", "9");
INSERT INTO "Students" VALUES ("1010", "10", "1");