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,
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", "American Airlines", "United States");
INSERT INTO "airlines" VALUES ("4", "United Airlines Express", "United States");
INSERT INTO "airlines" VALUES ("5", "Lufthansa", "Germany");
INSERT INTO "airlines" VALUES ("6", "Emirates", "United Arab Emirates");
INSERT INTO "airlines" VALUES ("7", "Air Canada", "Canada");
INSERT INTO "airlines" VALUES ("8", "United Airlines Cargo", "United States");
INSERT INTO "flights" VALUES ("1", "100", "JFK");
INSERT INTO "flights" VALUES ("1", "101", "LAX");
INSERT INTO "flights" VALUES ("1", "102", "ORD");
INSERT INTO "flights" VALUES ("2", "100", "ATL");
INSERT INTO "flights" VALUES ("2", "200", "MSP");
INSERT INTO "flights" VALUES ("3", "300", "DFW");
INSERT INTO "flights" VALUES ("4", "100", "EWR");
INSERT INTO "flights" VALUES ("4", "103", "SFO");
INSERT INTO "flights" VALUES ("5", "400", "FRA");
INSERT INTO "flights" VALUES ("6", "500", "DXB");
INSERT INTO "flights" VALUES ("7", "600", "YYZ");
INSERT INTO "flights" VALUES ("8", "700", "ORD");
INSERT INTO "flights" VALUES ("8", "102", "IAD");
INSERT INTO "flights" VALUES ("1", "103", "DEN");
INSERT INTO "flights" VALUES ("1", "104", "SFO");
INSERT INTO "flights" VALUES ("3", "101", "MIA");