CREATE TABLE month (month_number INT, month_name TEXT)
CREATE TABLE flight_leg (flight_id INT, leg_number INT, leg_flight INT)
CREATE TABLE fare (fare_id INT, from_airport VARCHAR, to_airport VARCHAR, fare_basis_code TEXT, fare_airline TEXT, restriction_code TEXT, one_direction_cost INT, round_trip_cost INT, round_trip_required VARCHAR)
CREATE TABLE airport (airport_code VARCHAR, airport_name TEXT, airport_location TEXT, state_code VARCHAR, country_name VARCHAR, time_zone_code VARCHAR, minimum_connect_time INT)
CREATE TABLE time_interval (period TEXT, begin_time INT, end_time INT)
CREATE TABLE dual_carrier (main_airline VARCHAR, low_flight_number INT, high_flight_number INT, dual_airline VARCHAR, service_name TEXT)
CREATE TABLE flight (aircraft_code_sequence TEXT, airline_code VARCHAR, airline_flight TEXT, arrival_time INT, connections INT, departure_time INT, dual_carrier TEXT, flight_days TEXT, flight_id INT, flight_number INT, from_airport VARCHAR, meal_code TEXT, stops INT, time_elapsed INT, to_airport VARCHAR)
CREATE TABLE date_day (month_number INT, day_number INT, year INT, day_name VARCHAR)
CREATE TABLE airline (airline_code VARCHAR, airline_name TEXT, note TEXT)
CREATE TABLE ground_service (city_code TEXT, airport_code TEXT, transport_type TEXT, ground_fare INT)
CREATE TABLE time_zone (time_zone_code TEXT, time_zone_name TEXT, hours_from_gmt INT)
CREATE TABLE code_description (code VARCHAR, description TEXT)
CREATE TABLE flight_fare (flight_id INT, fare_id INT)
CREATE TABLE restriction (restriction_code TEXT, advance_purchase INT, stopovers TEXT, saturday_stay_required TEXT, minimum_stay INT, maximum_stay INT, application TEXT, no_discounts TEXT)
CREATE TABLE city (city_code VARCHAR, city_name VARCHAR, state_code VARCHAR, country_name VARCHAR, time_zone_code VARCHAR)
CREATE TABLE class_of_service (booking_class VARCHAR, rank INT, class_description TEXT)
CREATE TABLE fare_basis (fare_basis_code TEXT, booking_class TEXT, class_type TEXT, premium TEXT, economy TEXT, discounted TEXT, night TEXT, season TEXT, basis_days TEXT)
CREATE TABLE flight_stop (flight_id INT, stop_number INT, stop_days TEXT, stop_airport TEXT, arrival_time INT, arrival_airline TEXT, arrival_flight_number INT, departure_time INT, departure_airline TEXT, departure_flight_number INT, stop_time INT)
CREATE TABLE airport_service (city_code VARCHAR, airport_code VARCHAR, miles_distant INT, direction VARCHAR, minutes_distant INT)
CREATE TABLE aircraft (aircraft_code VARCHAR, aircraft_description VARCHAR, manufacturer VARCHAR, basic_type VARCHAR, engines INT, propulsion VARCHAR, wide_body VARCHAR, wing_span INT, length INT, weight INT, capacity INT, pay_load INT, cruising_speed INT, range_miles INT, pressurized VARCHAR)
CREATE TABLE compartment_class (compartment VARCHAR, class_type VARCHAR)
CREATE TABLE food_service (meal_code TEXT, meal_number INT, compartment TEXT, meal_description VARCHAR)
CREATE TABLE state (state_code TEXT, state_name TEXT, country_name TEXT)
CREATE TABLE days (days_code VARCHAR, day_name VARCHAR)
CREATE TABLE equipment_sequence (aircraft_code_sequence VARCHAR, aircraft_code VARCHAR)

show me weekday flights from MILWAUKEE to ORLANDO one way
SELECT DISTINCT flight_id FROM flight WHERE (((((((flight_days IN (SELECT DAYSalias6.days_code FROM days AS DAYSalias6 WHERE DAYSalias6.day_name = 'THURSDAY') AND flight_id IN (SELECT FLIGHT_FAREalias3.flight_id FROM flight_fare AS FLIGHT_FAREalias3 WHERE FLIGHT_FAREalias3.fare_id IN (SELECT FAREalias3.fare_id FROM fare AS FAREalias3 WHERE (FAREalias3.fare_basis_code IN (SELECT FARE_BASISalias3.fare_basis_code FROM fare_basis AS FARE_BASISalias3 WHERE FARE_BASISalias3.basis_days IN (SELECT DAYSalias7.days_code FROM days AS DAYSalias7 WHERE DAYSalias7.day_name = 'THURSDAY')) AND FAREalias3.round_trip_required = 'NO')))) OR (flight_days IN (SELECT DAYSalias8.days_code FROM days AS DAYSalias8 WHERE DAYSalias8.day_name = 'FRIDAY') AND flight_id IN (SELECT FLIGHT_FAREalias4.flight_id FROM flight_fare AS FLIGHT_FAREalias4 WHERE FLIGHT_FAREalias4.fare_id IN (SELECT FAREalias4.fare_id FROM fare AS FAREalias4 WHERE (FAREalias4.fare_basis_code IN (SELECT FARE_BASISalias4.fare_basis_code FROM fare_basis AS FARE_BASISalias4 WHERE FARE_BASISalias4.basis_days IN (SELECT DAYSalias9.days_code FROM days AS DAYSalias9 WHERE DAYSalias9.day_name = 'FRIDAY')) AND FAREalias4.round_trip_required = 'NO'))))) OR (flight_days IN (SELECT DAYSalias4.days_code FROM days AS DAYSalias4 WHERE DAYSalias4.day_name = 'WEDNESDAY') AND flight_id IN (SELECT FLIGHT_FAREalias2.flight_id FROM flight_fare AS FLIGHT_FAREalias2 WHERE FLIGHT_FAREalias2.fare_id IN (SELECT FAREalias2.fare_id FROM fare AS FAREalias2 WHERE (FAREalias2.fare_basis_code IN (SELECT FARE_BASISalias2.fare_basis_code FROM fare_basis AS FARE_BASISalias2 WHERE FARE_BASISalias2.basis_days IN (SELECT DAYSalias5.days_code FROM days AS DAYSalias5 WHERE DAYSalias5.day_name = 'WEDNESDAY')) AND FAREalias2.round_trip_required = 'NO'))))) OR (flight_days IN (SELECT DAYSalias2.days_code FROM days AS DAYSalias2 WHERE DAYSalias2.day_name = 'TUESDAY') AND flight_id IN (SELECT FLIGHT_FAREalias1.flight_id FROM flight_fare AS FLIGHT_FAREalias1 WHERE FLIGHT_FAREalias1.fare_id IN (SELECT FAREalias1.fare_id FROM fare AS FAREalias1 WHERE (FAREalias1.fare_basis_code IN (SELECT FARE_BASISalias1.fare_basis_code FROM fare_basis AS FARE_BASISalias1 WHERE FARE_BASISalias1.basis_days IN (SELECT DAYSalias3.days_code FROM days AS DAYSalias3 WHERE DAYSalias3.day_name = 'TUESDAY')) AND FAREalias1.round_trip_required = 'NO'))))) OR (flight_days IN (SELECT DAYSalias0.days_code FROM days AS DAYSalias0 WHERE DAYSalias0.day_name = 'MONDAY') AND flight_id IN (SELECT FLIGHT_FAREalias0.flight_id FROM flight_fare AS FLIGHT_FAREalias0 WHERE FLIGHT_FAREalias0.fare_id IN (SELECT FAREalias0.fare_id FROM fare AS FAREalias0 WHERE (FAREalias0.fare_basis_code IN (SELECT FARE_BASISalias0.fare_basis_code FROM fare_basis AS FARE_BASISalias0 WHERE FARE_BASISalias0.basis_days IN (SELECT DAYSalias1.days_code FROM days AS DAYSalias1 WHERE DAYSalias1.day_name = 'MONDAY')) AND FAREalias0.round_trip_required = 'NO'))))) AND to_airport IN (SELECT AIRPORT_SERVICEalias1.airport_code FROM airport_service AS AIRPORT_SERVICEalias1 WHERE AIRPORT_SERVICEalias1.city_code IN (SELECT CITYalias1.city_code FROM city AS CITYalias1 WHERE CITYalias1.city_name = 'ORLANDO'))) AND from_airport IN (SELECT AIRPORT_SERVICEalias0.airport_code FROM airport_service AS AIRPORT_SERVICEalias0 WHERE AIRPORT_SERVICEalias0.city_code IN (SELECT CITYalias0.city_code FROM city AS CITYalias0 WHERE CITYalias0.city_name = 'MILWAUKEE')))
WITH "_u_0" AS (SELECT "DAYSalias6"."days_code" FROM "days" AS "DAYSalias6" WHERE "DAYSalias6"."day_name" = 'THURSDAY' GROUP BY "days_code"), "_u_10" AS (SELECT "DAYSalias4"."days_code" FROM "days" AS "DAYSalias4" WHERE "DAYSalias4"."day_name" = 'WEDNESDAY' GROUP BY "days_code"), "_u_11" AS (SELECT "DAYSalias5"."days_code" FROM "days" AS "DAYSalias5" WHERE "DAYSalias5"."day_name" = 'WEDNESDAY' GROUP BY "days_code"), "_u_12" AS (SELECT "FARE_BASISalias2"."fare_basis_code" FROM "fare_basis" AS "FARE_BASISalias2" LEFT JOIN "_u_11" AS "_u_11" ON "FARE_BASISalias2"."basis_days" = "_u_11"."" WHERE NOT "_u_11"."" IS NULL GROUP BY "fare_basis_code"), "_u_13" AS (SELECT "FAREalias2"."fare_id" FROM "fare" AS "FAREalias2" LEFT JOIN "_u_12" AS "_u_12" ON "FAREalias2"."fare_basis_code" = "_u_12"."" WHERE "FAREalias2"."round_trip_required" = 'NO' AND NOT "_u_12"."" IS NULL GROUP BY "fare_id"), "_u_14" AS (SELECT "FLIGHT_FAREalias2"."flight_id" FROM "flight_fare" AS "FLIGHT_FAREalias2" LEFT JOIN "_u_13" AS "_u_13" ON "FLIGHT_FAREalias2"."fare_id" = "_u_13"."" WHERE NOT "_u_13"."" IS NULL GROUP BY "flight_id"), "_u_15" AS (SELECT "DAYSalias2"."days_code" FROM "days" AS "DAYSalias2" WHERE "DAYSalias2"."day_name" = 'TUESDAY' GROUP BY "days_code"), "_u_16" AS (SELECT "DAYSalias3"."days_code" FROM "days" AS "DAYSalias3" WHERE "DAYSalias3"."day_name" = 'TUESDAY' GROUP BY "days_code"), "_u_17" AS (SELECT "FARE_BASISalias1"."fare_basis_code" FROM "fare_basis" AS "FARE_BASISalias1" LEFT JOIN "_u_16" AS "_u_16" ON "FARE_BASISalias1"."basis_days" = "_u_16"."" WHERE NOT "_u_16"."" IS NULL GROUP BY "fare_basis_code"), "_u_18" AS (SELECT "FAREalias1"."fare_id" FROM "fare" AS "FAREalias1" LEFT JOIN "_u_17" AS "_u_17" ON "FAREalias1"."fare_basis_code" = "_u_17"."" WHERE "FAREalias1"."round_trip_required" = 'NO' AND NOT "_u_17"."" IS NULL GROUP BY "fare_id"), "_u_19" AS (SELECT "FLIGHT_FAREalias1"."flight_id" FROM "flight_fare" AS "FLIGHT_FAREalias1" LEFT JOIN "_u_18" AS "_u_18" ON "FLIGHT_FAREalias1"."fare_id" = "_u_18"."" WHERE NOT "_u_18"."" IS NULL GROUP BY "flight_id"), "_u_20" AS (SELECT "DAYSalias0"."days_code" FROM "days" AS "DAYSalias0" WHERE "DAYSalias0"."day_name" = 'MONDAY' GROUP BY "days_code"), "_u_21" AS (SELECT "DAYSalias1"."days_code" FROM "days" AS "DAYSalias1" WHERE "DAYSalias1"."day_name" = 'MONDAY' GROUP BY "days_code"), "_u_22" AS (SELECT "FARE_BASISalias0"."fare_basis_code" FROM "fare_basis" AS "FARE_BASISalias0" LEFT JOIN "_u_21" AS "_u_21" ON "FARE_BASISalias0"."basis_days" = "_u_21"."" WHERE NOT "_u_21"."" IS NULL GROUP BY "fare_basis_code"), "_u_23" AS (SELECT "FAREalias0"."fare_id" FROM "fare" AS "FAREalias0" LEFT JOIN "_u_22" AS "_u_22" ON "FAREalias0"."fare_basis_code" = "_u_22"."" WHERE "FAREalias0"."round_trip_required" = 'NO' AND NOT "_u_22"."" IS NULL GROUP BY "fare_id"), "_u_24" AS (SELECT "FLIGHT_FAREalias0"."flight_id" FROM "flight_fare" AS "FLIGHT_FAREalias0" LEFT JOIN "_u_23" AS "_u_23" ON "FLIGHT_FAREalias0"."fare_id" = "_u_23"."" WHERE NOT "_u_23"."" IS NULL GROUP BY "flight_id"), "_u_25" AS (SELECT "CITYalias1"."city_code" FROM "city" AS "CITYalias1" WHERE "CITYalias1"."city_name" = 'ORLANDO' GROUP BY "city_code"), "_u_26" AS (SELECT "AIRPORT_SERVICEalias1"."airport_code" FROM "airport_service" AS "AIRPORT_SERVICEalias1" LEFT JOIN "_u_25" AS "_u_25" ON "AIRPORT_SERVICEalias1"."city_code" = "_u_25"."" WHERE NOT "_u_25"."" IS NULL GROUP BY "airport_code"), "_u_27" AS (SELECT "CITYalias0"."city_code" FROM "city" AS "CITYalias0" WHERE "CITYalias0"."city_name" = 'MILWAUKEE' GROUP BY "city_code"), "_u_28" AS (SELECT "AIRPORT_SERVICEalias0"."airport_code" FROM "airport_service" AS "AIRPORT_SERVICEalias0" LEFT JOIN "_u_27" AS "_u_27" ON "AIRPORT_SERVICEalias0"."city_code" = "_u_27"."" WHERE NOT "_u_27"."" IS NULL GROUP BY "airport_code"), "_u_1" AS (SELECT "DAYSalias7"."days_code" FROM "days" AS "DAYSalias7" WHERE "DAYSalias7"."day_name" = 'THURSDAY' GROUP BY "days_code"), "_u_2" AS (SELECT "FARE_BASISalias3"."fare_basis_code" FROM "fare_basis" AS "FARE_BASISalias3" LEFT JOIN "_u_1" AS "_u_1" ON "FARE_BASISalias3"."basis_days" = "_u_1"."" WHERE NOT "_u_1"."" IS NULL GROUP BY "fare_basis_code"), "_u_3" AS (SELECT "FAREalias3"."fare_id" FROM "fare" AS "FAREalias3" LEFT JOIN "_u_2" AS "_u_2" ON "FAREalias3"."fare_basis_code" = "_u_2"."" WHERE "FAREalias3"."round_trip_required" = 'NO' AND NOT "_u_2"."" IS NULL GROUP BY "fare_id"), "_u_4" AS (SELECT "FLIGHT_FAREalias3"."flight_id" FROM "flight_fare" AS "FLIGHT_FAREalias3" LEFT JOIN "_u_3" AS "_u_3" ON "FLIGHT_FAREalias3"."fare_id" = "_u_3"."" WHERE NOT "_u_3"."" IS NULL GROUP BY "flight_id"), "_u_5" AS (SELECT "DAYSalias8"."days_code" FROM "days" AS "DAYSalias8" WHERE "DAYSalias8"."day_name" = 'FRIDAY' GROUP BY "days_code"), "_u_6" AS (SELECT "DAYSalias9"."days_code" FROM "days" AS "DAYSalias9" WHERE "DAYSalias9"."day_name" = 'FRIDAY' GROUP BY "days_code"), "_u_7" AS (SELECT "FARE_BASISalias4"."fare_basis_code" FROM "fare_basis" AS "FARE_BASISalias4" LEFT JOIN "_u_6" AS "_u_6" ON "FARE_BASISalias4"."basis_days" = "_u_6"."" WHERE NOT "_u_6"."" IS NULL GROUP BY "fare_basis_code"), "_u_8" AS (SELECT "FAREalias4"."fare_id" FROM "fare" AS "FAREalias4" LEFT JOIN "_u_7" AS "_u_7" ON "FAREalias4"."fare_basis_code" = "_u_7"."" WHERE "FAREalias4"."round_trip_required" = 'NO' AND NOT "_u_7"."" IS NULL GROUP BY "fare_id"), "_u_9" AS (SELECT "FLIGHT_FAREalias4"."flight_id" FROM "flight_fare" AS "FLIGHT_FAREalias4" LEFT JOIN "_u_8" AS "_u_8" ON "FLIGHT_FAREalias4"."fare_id" = "_u_8"."" WHERE NOT "_u_8"."" IS NULL GROUP BY "flight_id") SELECT DISTINCT "flight_id" FROM "flight" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "flight_days" LEFT JOIN "_u_10" AS "_u_10" ON "_u_10"."" = "flight_days" LEFT JOIN "_u_14" AS "_u_14" ON "_u_14"."" = "flight_id" LEFT JOIN "_u_15" AS "_u_15" ON "_u_15"."" = "flight_days" LEFT JOIN "_u_19" AS "_u_19" ON "_u_19"."" = "flight_id" LEFT JOIN "_u_20" AS "_u_20" ON "_u_20"."" = "flight_days" LEFT JOIN "_u_24" AS "_u_24" ON "_u_24"."" = "flight_id" LEFT JOIN "_u_26" AS "_u_26" ON "_u_26"."" = "to_airport" LEFT JOIN "_u_28" AS "_u_28" ON "_u_28"."" = "from_airport" LEFT JOIN "_u_4" AS "_u_4" ON "_u_4"."" = "flight_id" LEFT JOIN "_u_5" AS "_u_5" ON "_u_5"."" = "flight_days" LEFT JOIN "_u_9" AS "_u_9" ON "_u_9"."" = "flight_id" WHERE ((NOT "_u_0"."" IS NULL AND NOT "_u_4"."" IS NULL) OR (NOT "_u_10"."" IS NULL AND NOT "_u_14"."" IS NULL) OR (NOT "_u_15"."" IS NULL AND NOT "_u_19"."" IS NULL) OR (NOT "_u_20"."" IS NULL AND NOT "_u_24"."" IS NULL) OR (NOT "_u_5"."" IS NULL AND NOT "_u_9"."" IS NULL)) AND NOT "_u_26"."" IS NULL AND NOT "_u_28"."" IS NULL