{"pilot": {"columns": [[0, "Pilot_Id", "int(11)", 1, null, 1], [1, "Name", "varchar(50)", 1, null, 0], [2, "Age", "int(11)", 1, null, 0]], "primary_keys": ["Pilot_Id"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Pilot_Id"]]], "check_constraints": []}, "aircraft": {"columns": [[0, "Aircraft_ID", "int(11)", 1, null, 1], [1, "Aircraft", "varchar(50)", 1, null, 0], [2, "Description", "varchar(50)", 1, null, 0], [3, "Max_Gross_Weight", "varchar(50)", 1, null, 0], [4, "Total_disk_area", "varchar(50)", 1, null, 0], [5, "Max_disk_Loading", "varchar(50)", 1, null, 0]], "primary_keys": ["Aircraft_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Aircraft_ID"]]], "check_constraints": []}, "match": {"columns": [[0, "Round", "REAL", 0, null, 1], [1, "Location", "TEXT", 0, null, 0], [2, "Country", "TEXT", 0, null, 0], [3, "Date", "TEXT", 0, null, 0], [4, "Fastest_Qualifying", "TEXT", 0, null, 0], [5, "Winning_Pilot", "TEXT", 0, null, 0], [6, "Winning_Aircraft", "TEXT", 0, null, 0]], "primary_keys": ["Round"], "foreign_keys": [[0, 0, "pilot", "Winning_Pilot", "Pilot_Id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "aircraft", "Winning_Aircraft", "Aircraft_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Round"]]], "check_constraints": []}, "airport": {"columns": [[0, "Airport_ID", "INT", 0, null, 1], [1, "Airport_Name", "TEXT", 0, null, 0], [2, "Total_Passengers", "REAL", 0, null, 0], [3, "%_Change_2007", "TEXT", 0, null, 0], [4, "International_Passengers", "REAL", 0, null, 0], [5, "Domestic_Passengers", "REAL", 0, null, 0], [6, "Transit_Passengers", "REAL", 0, null, 0], [7, "Aircraft_Movements", "REAL", 0, null, 0], [8, "Freight_Metric_Tonnes", "REAL", 0, null, 0]], "primary_keys": ["Airport_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Airport_ID"]]], "check_constraints": []}, "airport_aircraft": {"columns": [[0, "ID", "INT", 0, null, 0], [1, "Airport_ID", "INT", 0, null, 1], [2, "Aircraft_ID", "INT", 0, null, 2]], "primary_keys": ["Airport_ID", "Aircraft_ID"], "foreign_keys": [[0, 0, "aircraft", "Aircraft_ID", "Aircraft_ID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "airport", "Airport_ID", "Airport_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 1, "Airport_ID"], [1, 2, "Aircraft_ID"]]], "check_constraints": []}}
CREATE TABLE pilot (
    Pilot_Id int(11) NOT NULL  PRIMARY KEY,
    Name varchar(50) NOT NULL,
    Age int(11) NOT NULL,
    UNIQUE (Pilot_Id)
);

CREATE TABLE aircraft (
    Aircraft_ID int(11) NOT NULL  PRIMARY KEY,
    Aircraft varchar(50) NOT NULL,
    Description varchar(50) NOT NULL,
    Max_Gross_Weight varchar(50) NOT NULL,
    Total_disk_area varchar(50) NOT NULL,
    Max_disk_Loading varchar(50) NOT NULL,
    UNIQUE (Aircraft_ID)
);

CREATE TABLE match (
    Round REAL   PRIMARY KEY,
    Location TEXT,
    Country TEXT,
    Date TEXT,
    Fastest_Qualifying TEXT,
    Winning_Pilot TEXT,
    Winning_Aircraft TEXT,
    UNIQUE (Round),
    FOREIGN KEY (Winning_Pilot) REFERENCES pilot(Pilot_Id),
    FOREIGN KEY (Winning_Aircraft) REFERENCES aircraft(Aircraft_ID)
);

CREATE TABLE airport (
    Airport_ID INT   PRIMARY KEY,
    Airport_Name TEXT,
    Total_Passengers REAL,
    %_Change_2007 TEXT,
    International_Passengers REAL,
    Domestic_Passengers REAL,
    Transit_Passengers REAL,
    Aircraft_Movements REAL,
    Freight_Metric_Tonnes REAL,
    UNIQUE (Airport_ID)
);

CREATE TABLE airport_aircraft (
    ID INT,
    Airport_ID INT   PRIMARY KEY,
    Aircraft_ID INT   PRIMARY KEY,
    PRIMARY KEY (Airport_ID, Aircraft_ID),
    UNIQUE (Airport_ID, Aircraft_ID),
    FOREIGN KEY (Aircraft_ID) REFERENCES aircraft(Aircraft_ID),
    FOREIGN KEY (Airport_ID) REFERENCES airport(Airport_ID)
);