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,
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", "Delta Air Lines");
INSERT INTO "airlines" VALUES ("2", "American Airlines");
INSERT INTO "airlines" VALUES ("3", "United Airlines");
INSERT INTO "airlines" VALUES ("4", "Southwest Airlines");
INSERT INTO "airlines" VALUES ("5", "Alaska Airlines");
INSERT INTO "airlines" VALUES ("6", "JetBlue Airways");
INSERT INTO "airlines" VALUES ("7", "Spirit Airlines");
INSERT INTO "airlines" VALUES ("8", "Frontier Airlines");
INSERT INTO "airlines" VALUES ("9", "Hawaiian Airlines");
INSERT INTO "airlines" VALUES ("10", "Allegiant Air");
INSERT INTO "airports" VALUES ("ATL");
INSERT INTO "airports" VALUES ("LAX");
INSERT INTO "airports" VALUES ("ORD");
INSERT INTO "airports" VALUES ("DFW");
INSERT INTO "airports" VALUES ("DEN");
INSERT INTO "airports" VALUES ("JFK");
INSERT INTO "airports" VALUES ("SFO");
INSERT INTO "airports" VALUES ("SEA");
INSERT INTO "airports" VALUES ("MIA");
INSERT INTO "airports" VALUES ("LAS");
INSERT INTO "flights" VALUES ("1", "1001");
INSERT INTO "flights" VALUES ("1", "1002");
INSERT INTO "flights" VALUES ("2", "2001");
INSERT INTO "flights" VALUES ("2", "2002");
INSERT INTO "flights" VALUES ("3", "3001");
INSERT INTO "flights" VALUES ("3", "3002");
INSERT INTO "flights" VALUES ("4", "4001");
INSERT INTO "flights" VALUES ("5", "5001");
INSERT INTO "flights" VALUES ("6", "6001");
INSERT INTO "flights" VALUES ("7", "7001");
INSERT INTO "flights" VALUES ("8", "8001");
INSERT INTO "flights" VALUES ("9", "9001");
INSERT INTO "flights" VALUES ("10", "10001");