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

CREATE TABLE "airports" (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
);

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





INSERT INTO "airlines" VALUES ("1", "AA");
INSERT INTO "airlines" VALUES ("2", "UA");
INSERT INTO "airlines" VALUES ("3", "DL");
INSERT INTO "airlines" VALUES ("4", "SW");
INSERT INTO "airlines" VALUES ("5", "BA");
INSERT INTO "airlines" VALUES ("6", "LH");
INSERT INTO "airports" VALUES ("Dallas", "DFW", "Dallas/Fort Worth International", "USA", "US");
INSERT INTO "airports" VALUES ("Chicago", "ORD", "O'Hare International", "USA", "US");
INSERT INTO "airports" VALUES ("London", "LHR", "Heathrow", "UK", "GB");
INSERT INTO "airports" VALUES ("Frankfurt", "FRA", "Frankfurt Airport", "Germany", "DE");
INSERT INTO "airports" VALUES ("Alton", "ALN", "Alton Regional Airport", "USA", "US");
INSERT INTO "airports" VALUES ("Paris", "CDG", "Charles de Gaulle Airport", "France", "FR");
INSERT INTO "airports" VALUES ("Tokyo", "NRT", "Narita International Airport", "Japan", "JP");
INSERT INTO "airports" VALUES ("Sydney", "SYD", "Sydney Airport", "Australia", "AU");
INSERT INTO "flights" VALUES ("1", "101");
INSERT INTO "flights" VALUES ("1", "102");
INSERT INTO "flights" VALUES ("2", "201");
INSERT INTO "flights" VALUES ("3", "301");
INSERT INTO "flights" VALUES ("4", "401");
INSERT INTO "flights" VALUES ("5", "501");
INSERT INTO "flights" VALUES ("6", "601");