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

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

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





INSERT INTO "airlines" VALUES ("1", "Jetblue Airways", "United States");
INSERT INTO "airlines" VALUES ("2", "Delta Airlines", "United States");
INSERT INTO "airlines" VALUES ("3", "Lufthansa", "Germany");
INSERT INTO "airlines" VALUES ("4", "Emirates", "United Arab Emirates");
INSERT INTO "airlines" VALUES ("5", "Air Canada", "Canada");
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 ("Frankfurt", "FRA", "Frankfurt Airport");
INSERT INTO "airports" VALUES ("Dubai", "DXB", "Dubai International Airport");
INSERT INTO "airports" VALUES ("Toronto", "YYZ", "Toronto Pearson International Airport");
INSERT INTO "flights" VALUES ("1", "1001");
INSERT INTO "flights" VALUES ("1", "1002");
INSERT INTO "flights" VALUES ("1", "1003");
INSERT INTO "flights" VALUES ("1", "1004");
INSERT INTO "flights" VALUES ("1", "1005");
INSERT INTO "flights" VALUES ("2", "2001");
INSERT INTO "flights" VALUES ("2", "2002");
INSERT INTO "flights" VALUES ("3", "3001");
INSERT INTO "flights" VALUES ("4", "4001");
INSERT INTO "flights" VALUES ("5", "5001");