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 "airlines" (
"uid" INT,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY ("uid")
);

CREATE TABLE "airports" (
"AirportCode" TEXT UNIQUE,
"Country" TEXT,
PRIMARY KEY ("AirportCode")
);

CREATE TABLE "flights" (
"Airline" INT,
"FlightNo" INT,
PRIMARY KEY ("Airline", "FlightNo")
);





INSERT INTO "airlines" VALUES ("1", "Southwest Airlines", "SWA", "USA");
INSERT INTO "airlines" VALUES ("2", "Delta Air Lines", "DAL", "USA");
INSERT INTO "airlines" VALUES ("3", "United Airlines", "UAL", "USA");
INSERT INTO "airlines" VALUES ("4", "American Airlines", "AAL", "USA");
INSERT INTO "airlines" VALUES ("5", "Spirit Airlines", "NKS", "USA");
INSERT INTO "airlines" VALUES ("6", "Air Canada", "ACA", "Canada");
INSERT INTO "airlines" VALUES ("7", "Lufthansa", "DLH", "Germany");
INSERT INTO "airlines" VALUES ("8", "British Airways", "BAW", "UK");
INSERT INTO "airlines" VALUES ("9", "Ryanair", "RYR", "Ireland");
INSERT INTO "airlines" VALUES ("10", "Emirates", "UAE", "UAE");
INSERT INTO "airports" VALUES ("LAX", "USA");
INSERT INTO "airports" VALUES ("JFK", "USA");
INSERT INTO "airports" VALUES ("ORD", "USA");
INSERT INTO "airports" VALUES ("DFW", "USA");
INSERT INTO "airports" VALUES ("ATL", "USA");
INSERT INTO "airports" VALUES ("YYZ", "Canada");
INSERT INTO "airports" VALUES ("LHR", "UK");
INSERT INTO "airports" VALUES ("FRA", "Germany");
INSERT INTO "airports" VALUES ("DXB", "UAE");
INSERT INTO "airports" VALUES ("DUB", "Ireland");
INSERT INTO "flights" VALUES ("1", "1001");
INSERT INTO "flights" VALUES ("1", "1002");
INSERT INTO "flights" VALUES ("1", "1003");
INSERT INTO "flights" VALUES ("2", "2001");
INSERT INTO "flights" VALUES ("2", "2002");
INSERT INTO "flights" VALUES ("2", "2003");
INSERT INTO "flights" VALUES ("2", "2004");
INSERT INTO "flights" VALUES ("3", "3001");
INSERT INTO "flights" VALUES ("3", "3002");
INSERT INTO "flights" VALUES ("3", "3003");
INSERT INTO "flights" VALUES ("3", "3004");
INSERT INTO "flights" VALUES ("3", "3005");
INSERT INTO "flights" VALUES ("4", "4001");
INSERT INTO "flights" VALUES ("4", "4002");
INSERT INTO "flights" VALUES ("4", "4003");
INSERT INTO "flights" VALUES ("4", "4004");
INSERT INTO "flights" VALUES ("4", "4005");
INSERT INTO "flights" VALUES ("4", "4006");
INSERT INTO "flights" VALUES ("5", "5001");
INSERT INTO "flights" VALUES ("6", "6001");
INSERT INTO "flights" VALUES ("6", "6002");
INSERT INTO "flights" VALUES ("7", "7001");
INSERT INTO "flights" VALUES ("7", "7002");
INSERT INTO "flights" VALUES ("7", "7003");
INSERT INTO "flights" VALUES ("8", "8001");
INSERT INTO "flights" VALUES ("8", "8002");
INSERT INTO "flights" VALUES ("8", "8003");
INSERT INTO "flights" VALUES ("8", "8004");
INSERT INTO "flights" VALUES ("9", "9001");
INSERT INTO "flights" VALUES ("9", "9002");
INSERT INTO "flights" VALUES ("9", "9003");
INSERT INTO "flights" VALUES ("9", "9004");
INSERT INTO "flights" VALUES ("9", "9005");
INSERT INTO "flights" VALUES ("10", "10001");
INSERT INTO "flights" VALUES ("10", "10002");
INSERT INTO "flights" VALUES ("10", "10003");
INSERT INTO "flights" VALUES ("10", "10004");
INSERT INTO "flights" VALUES ("10", "10005");
INSERT INTO "flights" VALUES ("10", "10006");
INSERT INTO "flights" VALUES ("10", "10007");