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,
PRIMARY KEY ("AirportCode")
);

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





INSERT INTO "airlines" VALUES ("1", "United Airlines", "UAL", "United States");
INSERT INTO "airlines" VALUES ("2", "Delta Air Lines", "DAL", "United States");
INSERT INTO "airlines" VALUES ("3", "American Airlines", "AAL", "United States");
INSERT INTO "airlines" VALUES ("4", "Lufthansa", "DLH", "Germany");
INSERT INTO "airlines" VALUES ("5", "Air France", "AFR", "France");
INSERT INTO "airlines" VALUES ("6", "British Airways", "BAW", "United Kingdom");
INSERT INTO "airlines" VALUES ("7", "Emirates", "UAE", "United Arab Emirates");
INSERT INTO "airlines" VALUES ("8", "Qantas", "QFA", "Australia");
INSERT INTO "airlines" VALUES ("9", "Japan Airlines", "JAL", "Japan");
INSERT INTO "airlines" VALUES ("10", "Southwest Airlines", "SWA", "United States");
INSERT INTO "airports" VALUES ("JFK");
INSERT INTO "airports" VALUES ("LAX");
INSERT INTO "airports" VALUES ("ORD");
INSERT INTO "airports" VALUES ("ATL");
INSERT INTO "airports" VALUES ("CDG");
INSERT INTO "airports" VALUES ("FRA");
INSERT INTO "airports" VALUES ("LHR");
INSERT INTO "airports" VALUES ("DXB");
INSERT INTO "airports" VALUES ("SYD");
INSERT INTO "airports" VALUES ("NRT");
INSERT INTO "flights" VALUES ("1", "100");
INSERT INTO "flights" VALUES ("1", "101");
INSERT INTO "flights" VALUES ("2", "200");
INSERT INTO "flights" VALUES ("3", "300");
INSERT INTO "flights" VALUES ("4", "400");
INSERT INTO "flights" VALUES ("5", "500");
INSERT INTO "flights" VALUES ("6", "600");
INSERT INTO "flights" VALUES ("7", "700");
INSERT INTO "flights" VALUES ("8", "800");
INSERT INTO "flights" VALUES ("9", "900");
INSERT INTO "flights" VALUES ("10", "1000");