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,
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");
INSERT INTO "airlines" VALUES ("2", "American Airlines", "AAL");
INSERT INTO "airlines" VALUES ("3", "Delta Airlines", "DAL");
INSERT INTO "airlines" VALUES ("4", "Southwest Airlines", "SWA");
INSERT INTO "airlines" VALUES ("5", "Alaska Airlines", "ASA");
INSERT INTO "airlines" VALUES ("6", "JetBlue Airways", "JBU");
INSERT INTO "airlines" VALUES ("7", "Spirit Airlines", "NKS");
INSERT INTO "airlines" VALUES ("8", "Frontier Airlines", "FFT");
INSERT INTO "airlines" VALUES ("9", "Allegiant Air", "AAY");
INSERT INTO "airlines" VALUES ("10", "Hawaiian Airlines", "HAL");
INSERT INTO "airports" VALUES ("ORD");
INSERT INTO "airports" VALUES ("LAX");
INSERT INTO "airports" VALUES ("DFW");
INSERT INTO "airports" VALUES ("ATL");
INSERT INTO "airports" VALUES ("DEN");
INSERT INTO "airports" VALUES ("SFO");
INSERT INTO "airports" VALUES ("SEA");
INSERT INTO "airports" VALUES ("JFK");
INSERT INTO "airports" VALUES ("MIA");
INSERT INTO "airports" VALUES ("LAS");
INSERT INTO "flights" VALUES ("1", "101");
INSERT INTO "flights" VALUES ("1", "102");
INSERT INTO "flights" VALUES ("2", "201");
INSERT INTO "flights" VALUES ("3", "305");
INSERT INTO "flights" VALUES ("4", "410");
INSERT INTO "flights" VALUES ("5", "500");
INSERT INTO "flights" VALUES ("1", "103");
INSERT INTO "flights" VALUES ("2", "202");
INSERT INTO "flights" VALUES ("3", "306");
INSERT INTO "flights" VALUES ("4", "411");