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),
"city" VARCHAR(255),
PRIMARY KEY ("address_id")
);

CREATE TABLE "Students" (
"student_id" INT,
"current_address_id" INT,
"permanent_address_id" INT,
"first_name" VARCHAR(80),
"last_name" VARCHAR(40),
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 Main St", "Apt 101", "Springfield");
INSERT INTO "Addresses" VALUES ("2", "456 Oak Ave", "Suite 200", "Springfield");
INSERT INTO "Addresses" VALUES ("3", "789 Pine Ln", "", "Shelbyville");
INSERT INTO "Addresses" VALUES ("4", "101 Elm Rd", "Unit 3B", "Capital City");
INSERT INTO "Addresses" VALUES ("5", "222 Maple Dr", "", "Springfield");
INSERT INTO "Addresses" VALUES ("6", "333 Birch Blvd", "Apt 5", "Shelbyville");
INSERT INTO "Addresses" VALUES ("7", "444 Cedar Ct", "", "Springfield");
INSERT INTO "Addresses" VALUES ("8", "555 Willow Way", "", "Capital City");
INSERT INTO "Addresses" VALUES ("9", "666 Poplar Pl", "", "SpringSpringfield");
INSERT INTO "Addresses" VALUES ("10", "777 Spruce St", "", "Springfield");
INSERT INTO "Students" VALUES ("1", "1", "1", "Alice", "Smith");
INSERT INTO "Students" VALUES ("2", "1", "1", "Bob", "Johnson");
INSERT INTO "Students" VALUES ("3", "2", "1", "Charlie", "Brown");
INSERT INTO "Students" VALUES ("4", "3", "3", "Diana", "Prince");
INSERT INTO "Students" VALUES ("5", "1", "5", "Eve", "Adams");
INSERT INTO "Students" VALUES ("6", "4", "4", "Frank", "White");
INSERT INTO "Students" VALUES ("7", "1", "1", "Grace", "Taylor");
INSERT INTO "Students" VALUES ("8", "5", "5", "Henry", "Miller");
INSERT INTO "Students" VALUES ("9", "1", "1", "Ivy", "Davis");
INSERT INTO "Students" VALUES ("10", "6", "6", "Jack", "Wilson");
INSERT INTO "Students" VALUES ("11", "1", "1", "Karen", "Moore");
INSERT INTO "Students" VALUES ("12", "7", "7", "Liam", "Hall");
INSERT INTO "Students" VALUES ("13", "1", "1", "Mia", "Clark");
INSERT INTO "Students" VALUES ("14", "8", "8", "Noah", "Lewis");
INSERT INTO "Students" VALUES ("15", "1", "1", "Olivia", "Young");
INSERT INTO "Students" VALUES ("16", "9", "9", "Peter", "King");
INSERT INTO "Students" VALUES ("17", "10", "10", "Quinn", "Wright");
INSERT INTO "Students" VALUES ("18", "1", "1", "Rachel", "Scott");
INSERT INTO "Students" VALUES ("19", "1", "1", "Sam", "Green");
INSERT INTO "Students" VALUES ("20", "1", "1", "Tina", "Baker");