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

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





INSERT INTO "airlines" VALUES ("1", "United Airlines", "United States");
INSERT INTO "airlines" VALUES ("2", "Delta Airlines", "United States");
INSERT INTO "airlines" VALUES ("3", "Lufthansa", "Germany");
INSERT INTO "airlines" VALUES ("4", "Emirates", "United Arab Emirates");
INSERT INTO "airlines" VALUES ("5", "Air Canada", "Canada");
INSERT INTO "airlines" VALUES ("6", "Qantas", "Australia");
INSERT INTO "airlines" VALUES ("7", "United Airlines", "United States");
INSERT INTO "airlines" VALUES ("8", "British Airways", "United Kingdom");
INSERT INTO "flights" VALUES ("1", "100", "JFK", "LAX");
INSERT INTO "flights" VALUES ("1", "101", "ORD", "SFO");
INSERT INTO "flights" VALUES ("1", "102", "DEN", "MIA");
INSERT INTO "flights" VALUES ("2", "200", "ATL", "LAX");
INSERT INTO "flights" VALUES ("2", "201", "MSP", "JFK");
INSERT INTO "flights" VALUES ("3", "300", "FRA", "JFK");
INSERT INTO "flights" VALUES ("3", "301", "MUC", "LHR");
INSERT INTO "flights" VALUES ("4", "400", "DXB", "LHR");
INSERT INTO "flights" VALUES ("5", "500", "YYZ", "YVR");
INSERT INTO "flights" VALUES ("6", "600", "SYD", "MEL");
INSERT INTO "flights" VALUES ("7", "700", "IAD", "ORD");
INSERT INTO "flights" VALUES ("7", "701", "EWR", "SEA");
INSERT INTO "flights" VALUES ("7", "702", "SFO", "DEN");
INSERT INTO "flights" VALUES ("8", "800", "LHR", "JFK");