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),
"line_3" VARCHAR(255),
"city" VARCHAR(255),
"zip_postcode" VARCHAR(20),
"state_province_county" VARCHAR(255),
"country" 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", "NULL", "Anytown", "12345", "CA", "USA");
INSERT INTO "Addresses" VALUES ("2", "456 Oak Ave", "NULL", "NULL", "Otherville", "67890", "NY", "USA");
INSERT INTO "Addresses" VALUES ("3", "789 Pine Ln", "Unit B", "NULL", "Anytown", "12345", "CA", "USA");
INSERT INTO "Addresses" VALUES ("4", "101 Elm Rd", "NULL", "NULL", "Smallville", "11223", "TX", "USA");
INSERT INTO "Addresses" VALUES ("5", "202 Birch Blvd", "Suite 5", "NULL", "Big City", "98765", "FL", "USA");
INSERT INTO "Addresses" VALUES ("6", "303 Cedar Ct", "NULL", "NULL", "Anytown", "12345", "CA", "USA");
INSERT INTO "Addresses" VALUES ("7", "404 Maple Dr", "NULL", "NULL", "Otherville", "67890", "NY", "USA");
INSERT INTO "Addresses" VALUES ("8", "505 Willow Way", "NULL", "NULL", "Smallville", "11223", "TX", "USA");
INSERT INTO "Addresses" VALUES ("9", "606 Poplar Pl", "NULL", "NULL", "Big City", "98765", "FL", "USA");
INSERT INTO "Addresses" VALUES ("10", "707 Spruce St", "NULL", "NULL", "Anytown", "12345", "CA", "USA");
INSERT INTO "Students" VALUES ("1", "1", "1", "Alice", "Smith");
INSERT INTO "Students" VALUES ("2", "2", "2", "Bob", "Johnson");
INSERT INTO "Students" VALUES ("3", "1", "3", "Charlie", "Brown");
INSERT INTO "Students" VALUES ("4", "4", "4", "Diana", "Prince");
INSERT INTO "Students" VALUES ("5", "5", "5", "Eve", "Adams");
INSERT INTO "Students" VALUES ("6", "1", "6", "Frank", "White");
INSERT INTO "Students" VALUES ("7", "2", "7", "Grace", "Taylor");
INSERT INTO "Students" VALUES ("8", "4", "8", "Henry", "Miller");
INSERT INTO "Students" VALUES ("9", "5", "9", "Ivy", "Davis");
INSERT INTO "Students" VALUES ("10", "10", "10", "Jack", "Wilson");
INSERT INTO "Students" VALUES ("11", "1", "1", "Karen", "Moore");
INSERT INTO "Students" VALUES ("12", "2", "2", "Liam", "Hall");
INSERT INTO "Students" VALUES ("13", "3", "3", "Mia", "Clark");
INSERT INTO "Students" VALUES ("14", "4", "4", "Noah", "Lewis");
INSERT INTO "Students" VALUES ("15", "5", "5", "Olivia", "King");