CREATE TABLE time_zone (time_zone_code TEXT, time_zone_name TEXT, hours_from_gmt INT)
CREATE TABLE date_day (month_number INT, day_number INT, year INT, day_name VARCHAR)
CREATE TABLE state (state_code TEXT, state_name TEXT, country_name TEXT)
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 dual_carrier (main_airline VARCHAR, low_flight_number INT, high_flight_number INT, dual_airline VARCHAR, service_name TEXT)
CREATE TABLE code_description (code VARCHAR, description TEXT)
CREATE TABLE flight_fare (flight_id INT, fare_id INT)
CREATE TABLE ground_service (city_code TEXT, airport_code TEXT, transport_type TEXT, ground_fare INT)
CREATE TABLE equipment_sequence (aircraft_code_sequence VARCHAR, aircraft_code VARCHAR)
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 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 food_service (meal_code TEXT, meal_number INT, compartment TEXT, meal_description VARCHAR)
CREATE TABLE compartment_class (compartment VARCHAR, class_type VARCHAR)
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 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 airline (airline_code VARCHAR, airline_name TEXT, note TEXT)
CREATE TABLE airport_service (city_code VARCHAR, airport_code VARCHAR, miles_distant INT, direction VARCHAR, minutes_distant INT)
CREATE TABLE time_interval (period TEXT, begin_time INT, end_time INT)
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 flight_leg (flight_id INT, leg_number INT, leg_flight 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 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 month (month_number INT, month_name TEXT)
CREATE TABLE days (days_code VARCHAR, day_name VARCHAR)

i'd like to see flights from BALTIMORE to ATLANTA that arrive before 1200 and i'd like to see flights from DENVER to ATLANTA that arrive before 1200
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE ((CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) OR (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code)) AND flight.arrival_time < 1200
SELECT DISTINCT "flight"."flight_id" FROM "airport_service" AS "AIRPORT_SERVICE_0" JOIN "city" AS "CITY_0" ON "AIRPORT_SERVICE_0"."city_code" = "CITY_0"."city_code" AND ("CITY_0"."city_name" = 'BALTIMORE' OR "CITY_0"."city_name" = 'DENVER') JOIN "flight" ON "AIRPORT_SERVICE_0"."airport_code" = "flight"."from_airport" AND "flight"."arrival_time" < 1200 JOIN "airport_service" AS "AIRPORT_SERVICE_1" ON "AIRPORT_SERVICE_1"."airport_code" = "flight"."to_airport" JOIN "city" AS "CITY_1" ON "AIRPORT_SERVICE_1"."city_code" = "CITY_1"."city_code" AND "CITY_1"."city_name" = 'ATLANTA'