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

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





INSERT INTO "airlines" VALUES ("1", "Southwest Airlines", "SWA", "USA");
INSERT INTO "airlines" VALUES ("2", "Delta Air Lines", "DAL", "USA");
INSERT INTO "airlines" VALUES ("3", "United Airlines", "UAL", "USA");
INSERT INTO "airlines" VALUES ("4", "American Airlines", "AAL", "USA");
INSERT INTO "airlines" VALUES ("5", "Lufthansa", "DLH", "Germany");
INSERT INTO "airlines" VALUES ("6", "Air France", "AFR", "France");
INSERT INTO "airlines" VALUES ("7", "British Airways", "BAW", "UK");
INSERT INTO "airlines" VALUES ("8", "Ryanair", "RYR", "Ireland");
INSERT INTO "airports" VALUES ("LAX", "USA");
INSERT INTO "airports" VALUES ("JFK", "USA");
INSERT INTO "airports" VALUES ("ORD", "USA");
INSERT INTO "airports" VALUES ("DFW", "USA");
INSERT INTO "airports" VALUES ("FRA", "Germany");
INSERT INTO "airports" VALUES ("CDG", "France");
INSERT INTO "airports" VALUES ("LHR", "UK");
INSERT INTO "airports" VALUES ("DUB", "Ireland");
INSERT INTO "flights" VALUES ("1", "101");
INSERT INTO "flights" VALUES ("1", "102");
INSERT INTO "flights" VALUES ("1", "103");
INSERT INTO "flights" VALUES ("1", "104");
INSERT INTO "flights" VALUES ("2", "201");
INSERT INTO "flights" VALUES ("2", "202");
INSERT INTO "flights" VALUES ("2", "203");
INSERT INTO "flights" VALUES ("3", "301");
INSERT INTO "flights" VALUES ("3", "302");
INSERT INTO "flights" VALUES ("4", "401");
INSERT INTO "flights" VALUES ("5", "501");
INSERT INTO "flights" VALUES ("5", "502");
INSERT INTO "flights" VALUES ("6", "601");
INSERT INTO "flights" VALUES ("7", "701");
INSERT INTO "flights" VALUES ("7", "702");
INSERT INTO "flights" VALUES ("7", "703");
INSERT INTO "flights" VALUES ("8", "801");