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 "airports" (
"City" TEXT,
"AirportCode" TEXT UNIQUE,
"AirportName" TEXT,
PRIMARY KEY ("AirportCode")
);

CREATE TABLE "flights" (
"Airline" INT,
"FlightNo" INT,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY ("SourceAirport") REFERENCES "airports"("AirportCode"),
FOREIGN KEY ("DestAirport") REFERENCES "airports"("AirportCode")
);





INSERT INTO "airports" VALUES ("New York", "JFK", "John F. Kennedy International Airport");
INSERT INTO "airports" VALUES ("Los Angeles", "LAX", "Los Angeles International Airport");
INSERT INTO "airports" VALUES ("Chicago", "ORD", "O'Hare International Airport");
INSERT INTO "airports" VALUES ("Dallas", "DFW", "Dallas/Fort Worth International Airport");
INSERT INTO "airports" VALUES ("Denver", "DEN", "Denver International Airport");
INSERT INTO "airports" VALUES ("San Francisco", "SFO", "San Francisco International Airport");
INSERT INTO "airports" VALUES ("Atlanta", "ATL", "Hartsfield-Jackson Atlanta International Airport");
INSERT INTO "airports" VALUES ("Seattle", "SEA", "Seattle-Tacoma International Airport");
INSERT INTO "airports" VALUES ("Miami", "MIA", "Miami International Airport");
INSERT INTO "airports" VALUES ("Boston", "BOS", "Logan International Airport");
INSERT INTO "flights" VALUES ("1", "101", "JFK", "LAX");
INSERT INTO "flights" VALUES ("1", "102", "JFK", "ORD");
INSERT INTO "flights" VALUES ("1", "103", "JFK", "DFW");
INSERT INTO "flights" VALUES ("1", "104", "JFK", "DEN");
INSERT INTO "flights" VALUES ("1", "105", "JFK", "SFO");
INSERT INTO "flights" VALUES ("2", "201", "LAX", "JFK");
INSERT INTO "flights" VALUES ("2", "202", "LAX", "ORD");
INSERT INTO "flights" VALUES ("2", "203", "LAX", "DFW");
INSERT INTO "flights" VALUES ("2", "204", "LAX", "DEN");
INSERT INTO "flights" VALUES ("2", "205", "LAX", "SFO");
INSERT INTO "flights" VALUES ("2", "206", "LAX", "ATL");
INSERT INTO "flights" VALUES ("3", "301", "ORD", "JFK");
INSERT INTO "flights" VALUES ("3", "302", "ORD", "LAX");
INSERT INTO "flights" VALUES ("3", "303", "ORD", "DFW");
INSERT INTO "flights" VALUES ("3", "304", "ORD", "DEN");
INSERT INTO "flights" VALUES ("3", "305", "ORD", "SFO");
INSERT INTO "flights" VALUES ("3", "306", "ORD", "ATL");
INSERT INTO "flights" VALUES ("3", "307", "ORD", "SEA");
INSERT INTO "flights" VALUES ("4", "401", "DFW", "JFK");
INSERT INTO "flights" VALUES ("4", "402", "DFW", "LAX");
INSERT INTO "flights" VALUES ("4", "403", "DFW", "ORD");
INSERT INTO "flights" VALUES ("4", "404", "DFW", "DEN");
INSERT INTO "flights" VALUES ("4", "405", "DFW", "SFO");
INSERT INTO "flights" VALUES ("4", "406", "DFW", "ATL");
INSERT INTO "flights" VALUES ("4", "407", "DFW", "SEA");
INSERT INTO "flights" VALUES ("4", "408", "DFW", "MIA");
INSERT INTO "flights" VALUES ("5", "501", "DEN", "JFK");
INSERT INTO "flights" VALUES ("5", "502", "DEN", "LAX");
INSERT INTO "flights" VALUES ("5", "503", "DEN", "ORD");
INSERT INTO "flights" VALUES ("5", "504", "DEN", "DFW");
INSERT INTO "flights" VALUES ("5", "505", "DEN", "SFO");
INSERT INTO "flights" VALUES ("5", "506", "DEN", "ATL");
INSERT INTO "flights" VALUES ("5", "507", "DEN", "SEA");
INSERT INTO "flights" VALUES ("5", "508", "DEN", "MIA");
INSERT INTO "flights" VALUES ("5", "509", "DEN", "BOS");
INSERT INTO "flights" VALUES ("6", "601", "SFO", "JFK");
INSERT INTO "flights" VALUES ("6", "602", "SFO", "LAX");
INSERT INTO "flights" VALUES ("6", "603", "SFO", "ORD");
INSERT INTO "flights" VALUES ("6", "604", "SFO", "DFW");
INSERT INTO "flights" VALUES ("6", "605", "SFO", "DEN");
INSERT INTO "flights" VALUES ("6", "606", "SFO", "ATL");
INSERT INTO "flights" VALUES ("6", "607", "SFO", "SEA");
INSERT INTO "flights" VALUES ("6", "608", "SFO", "MIA");
INSERT INTO "flights" VALUES ("6", "609", "SFO", "BOS");
INSERT INTO "flights" VALUES ("6", "610", "SFO", "JFK");
INSERT INTO "flights" VALUES ("7", "701", "ATL", "JFK");
INSERT INTO "flights" VALUES ("7", "702", "ATL", "LAX");
INSERT INTO "flights" VALUES ("7", "703", "ATL", "ORD");
INSERT INTO "flights" VALUES ("7", "704", "ATL", "DFW");
INSERT INTO "flights" VALUES ("7", "705", "ATL", "DEN");
INSERT INTO "flights" VALUES ("7", "706", "ATL", "SFO");
INSERT INTO "flights" VALUES ("7", "707", "ATL", "SEA");
INSERT INTO "flights" VALUES ("7", "708", "ATL", "MIA");
INSERT INTO "flights" VALUES ("7", "709", "ATL", "BOS");
INSERT INTO "flights" VALUES ("7", "710", "ATL", "ORD");
INSERT INTO "flights" VALUES ("7", "711", "ATL", "DFW");
INSERT INTO "flights" VALUES ("8", "801", "SEA", "JFK");
INSERT INTO "flights" VALUES ("8", "802", "SEA", "LAX");
INSERT INTO "flights" VALUES ("8", "803", "SEA", "ORD");
INSERT INTO "flights" VALUES ("8", "804", "SEA", "DFW");
INSERT INTO "flights" VALUES ("8", "805", "SEA", "DEN");
INSERT INTO "flights" VALUES ("8", "806", "SEA", "SFO");
INSERT INTO "flights" VALUES ("8", "807", "SEA", "ATL");
INSERT INTO "flights" VALUES ("8", "808", "SEA", "MIA");
INSERT INTO "flights" VALUES ("8", "809", "SEA", "BOS");
INSERT INTO "flights" VALUES ("8", "810", "SEA", "JFK");
INSERT INTO "flights" VALUES ("8", "811", "SEA", "LAX");
INSERT INTO "flights" VALUES ("9", "901", "MIA", "JFK");
INSERT INTO "flights" VALUES ("9", "902", "MIA", "LAX");
INSERT INTO "flights" VALUES ("9", "903", "MIA", "ORD");
INSERT INTO "flights" VALUES ("9", "904", "MIA", "DFW");
INSERT INTO "flights" VALUES ("9", "905", "MIA", "DEN");
INSERT INTO "flights" VALUES ("9", "906", "MIA", "SFO");
INSERT INTO "flights" VALUES ("9", "907", "MIA", "ATL");
INSERT INTO "flights" VALUES ("9", "908", "MIA", "SEA");
INSERT INTO "flights" VALUES ("9", "909", "MIA", "BOS");
INSERT INTO "flights" VALUES ("9", "910", "MIA", "JFK");
INSERT INTO "flights" VALUES ("9", "911", "MIA", "LAX");
INSERT INTO "flights" VALUES ("9", "912", "MIA", "ORD");
INSERT INTO "flights" VALUES ("10", "1001", "BOS", "JFK");
INSERT INTO "flights" VALUES ("10", "1002", "BOS", "LAX");
INSERT INTO "flights" VALUES ("10", "1003", "BOS", "ORD");
INSERT INTO "flights" VALUES ("10", "1004", "BOS", "DFW");
INSERT INTO "flights" VALUES ("10", "1005", "BOS", "DEN");
INSERT INTO "flights" VALUES ("10", "1006", "BOS", "SFO");
INSERT INTO "flights" VALUES ("10", "1007", "BOS", "ATL");
INSERT INTO "flights" VALUES ("10", "1008", "BOS", "SEA");
INSERT INTO "flights" VALUES ("10", "1009", "BOS", "MIA");
INSERT INTO "flights" VALUES ("10", "1010", "BOS", "JFK");
INSERT INTO "flights" VALUES ("10", "1011", "BOS", "LAX");
INSERT INTO "flights" VALUES ("10", "1012", "BOS", "ORD");
INSERT INTO "flights" VALUES ("10", "1013", "BOS", "DFW");
INSERT INTO "flights" VALUES ("10", "1014", "BOS", "DEN");