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

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

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





INSERT INTO "airlines" VALUES ("1", "AA", "United States");
INSERT INTO "airlines" VALUES ("2", "BA", "United Kingdom");
INSERT INTO "airlines" VALUES ("3", "LH", "Germany");
INSERT INTO "airlines" VALUES ("4", "QF", "Australia");
INSERT INTO "airlines" VALUES ("5", "EK", "United Arab Emirates");
INSERT INTO "airlines" VALUES ("6", "AC", "Canada");
INSERT INTO "airports" VALUES ("JFK");
INSERT INTO "airports" VALUES ("LHR");
INSERT INTO "airports" VALUES ("FRA");
INSERT INTO "airports" VALUES ("SYD");
INSERT INTO "airports" VALUES ("DXB");
INSERT INTO "airports" VALUES ("YYZ");
INSERT INTO "flights" VALUES ("1", "100");
INSERT INTO "flights" VALUES ("1", "101");
INSERT INTO "flights" VALUES ("1", "102");
INSERT INTO "flights" VALUES ("2", "200");
INSERT INTO "flights" VALUES ("2", "201");
INSERT INTO "flights" VALUES ("3", "300");
INSERT INTO "flights" VALUES ("3", "301");
INSERT INTO "flights" VALUES ("3", "302");
INSERT INTO "flights" VALUES ("3", "303");
INSERT INTO "flights" VALUES ("4", "400");
INSERT INTO "flights" VALUES ("5", "500");
INSERT INTO "flights" VALUES ("5", "501");
INSERT INTO "flights" VALUES ("5", "502");
INSERT INTO "flights" VALUES ("6", "600");