text2SQL
stringlengths
192
7.27k
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE semester ( semester_id, semester, year ) CREATE TABLE course ( course_id, name, department, number, credits, advisory_requirement, enforced_requirement, description, num_semesters, num_enrolled, has_discussion, has_lab, has_projects, has_exams, num_reviews, clarity_score, easiness_score, helpfulness_score ) CREATE TABLE gsi ( course_offering_id, student_id ) CREATE TABLE course_prerequisite ( pre_course_id, course_id ) CREATE TABLE area ( course_id, area ) CREATE TABLE instructor ( instructor_id, name, uniqname ) CREATE TABLE program ( program_id, name, college, introduction ) CREATE TABLE program_course ( program_id, course_id, workload, category ) CREATE TABLE requirement ( requirement_id, requirement, college ) CREATE TABLE comment_instructor ( instructor_id, student_id, score, comment_text ) CREATE TABLE ta ( campus_job_id, student_id, location ) CREATE TABLE offering_instructor ( offering_instructor_id, offering_id, instructor_id ) CREATE TABLE course_tags_count ( course_id, clear_grading, pop_quiz, group_projects, inspirational, long_lectures, extra_credit, few_tests, good_feedback, tough_tests, heavy_papers, cares_for_students, heavy_assignments, respected, participation, heavy_reading, tough_grader, hilarious, would_take_again, good_lecture, no_skip ) CREATE TABLE program_requirement ( program_id, category, min_credit, additional_req ) CREATE TABLE jobs ( job_id, job_title, description, requirement, city, state, country, zip ) CREATE TABLE course_offering ( offering_id, course_id, semester, section_number, start_time, end_time, monday, tuesday, wednesday, thursday, friday, saturday, sunday, has_final_project, has_final_exam, textbook, class_address, allow_audit ) CREATE TABLE student ( student_id, lastname, firstname, program_id, declare_major, total_credit, total_gpa, entered_as, admit_term, predicted_graduation_semester, degree, minor, internship ) CREATE TABLE student_record ( student_id, course_id, semester, grade, how, transfer_source, earn_credit, repeat_term, test_id ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Would MUSPERF 591 fulfill any requirements besides general elective ? SELECT### Response: SELECT DISTINCT program_course.category FROM course, program_course WHERE course.department = 'MUSPERF' AND course.number = 591 AND program_course.course_id = course.course_id.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE compartment_class ( compartment, class_type ) CREATE TABLE dual_carrier ( main_airline, low_flight_number, high_flight_number, dual_airline, service_name ) CREATE TABLE code_description ( code, description ) CREATE TABLE ground_service ( city_code, airport_code, transport_type, ground_fare ) CREATE TABLE days ( days_code, day_name ) CREATE TABLE flight_fare ( flight_id, fare_id ) CREATE TABLE flight_leg ( flight_id, leg_number, leg_flight ) CREATE TABLE airline ( airline_code, airline_name, note ) CREATE TABLE flight_stop ( flight_id, stop_number, stop_days, stop_airport, arrival_time, arrival_airline, arrival_flight_number, departure_time, departure_airline, departure_flight_number, stop_time ) CREATE TABLE aircraft ( aircraft_code, aircraft_description, manufacturer, basic_type, engines, propulsion, wide_body, wing_span, length, weight, capacity, pay_load, cruising_speed, range_miles, pressurized ) CREATE TABLE time_zone ( time_zone_code, time_zone_name, hours_from_gmt ) CREATE TABLE date_day ( month_number, day_number, year, day_name ) CREATE TABLE city ( city_code, city_name, state_code, country_name, time_zone_code ) CREATE TABLE flight ( aircraft_code_sequence, airline_code, airline_flight, arrival_time, connections, departure_time, dual_carrier, flight_days, flight_id, flight_number, from_airport, meal_code, stops, time_elapsed, to_airport ) CREATE TABLE restriction ( restriction_code, advance_purchase, stopovers, saturday_stay_required, minimum_stay, maximum_stay, application, no_discounts ) CREATE TABLE fare_basis ( fare_basis_code, booking_class, class_type, premium, economy, discounted, night, season, basis_days ) CREATE TABLE food_service ( meal_code, meal_number, compartment, meal_description ) CREATE TABLE airport_service ( city_code, airport_code, miles_distant, direction, minutes_distant ) CREATE TABLE state ( state_code, state_name, country_name ) CREATE TABLE class_of_service ( booking_class, rank, class_description ) CREATE TABLE fare ( fare_id, from_airport, to_airport, fare_basis_code, fare_airline, restriction_code, one_direction_cost, round_trip_cost, round_trip_required ) CREATE TABLE month ( month_number, month_name ) CREATE TABLE airport ( airport_code, airport_name, airport_location, state_code, country_name, time_zone_code, minimum_connect_time ) CREATE TABLE equipment_sequence ( aircraft_code_sequence, aircraft_code ) CREATE TABLE time_interval ( period, begin_time, end_time ) -- Using valid SQLite, answer the following questions for the tables provided above. -- i'm trying to find a flight from KANSAS CITY to BURBANK on saturday the twenty second SELECT### Response: 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, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BURBANK' AND date_day.day_number = 26 AND date_day.month_number = 7 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'KANSAS CITY' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE flight_fare ( flight_id, fare_id ) CREATE TABLE time_interval ( period, begin_time, end_time ) CREATE TABLE flight ( aircraft_code_sequence, airline_code, airline_flight, arrival_time, connections, departure_time, dual_carrier, flight_days, flight_id, flight_number, from_airport, meal_code, stops, time_elapsed, to_airport ) CREATE TABLE class_of_service ( booking_class, rank, class_description ) CREATE TABLE equipment_sequence ( aircraft_code_sequence, aircraft_code ) CREATE TABLE fare_basis ( fare_basis_code, booking_class, class_type, premium, economy, discounted, night, season, basis_days ) CREATE TABLE airport ( airport_code, airport_name, airport_location, state_code, country_name, time_zone_code, minimum_connect_time ) CREATE TABLE fare ( fare_id, from_airport, to_airport, fare_basis_code, fare_airline, restriction_code, one_direction_cost, round_trip_cost, round_trip_required ) CREATE TABLE restriction ( restriction_code, advance_purchase, stopovers, saturday_stay_required, minimum_stay, maximum_stay, application, no_discounts ) CREATE TABLE airport_service ( city_code, airport_code, miles_distant, direction, minutes_distant ) CREATE TABLE date_day ( month_number, day_number, year, day_name ) CREATE TABLE dual_carrier ( main_airline, low_flight_number, high_flight_number, dual_airline, service_name ) CREATE TABLE state ( state_code, state_name, country_name ) CREATE TABLE airline ( airline_code, airline_name, note ) CREATE TABLE code_description ( code, description ) CREATE TABLE aircraft ( aircraft_code, aircraft_description, manufacturer, basic_type, engines, propulsion, wide_body, wing_span, length, weight, capacity, pay_load, cruising_speed, range_miles, pressurized ) CREATE TABLE food_service ( meal_code, meal_number, compartment, meal_description ) CREATE TABLE compartment_class ( compartment, class_type ) CREATE TABLE flight_leg ( flight_id, leg_number, leg_flight ) CREATE TABLE time_zone ( time_zone_code, time_zone_name, hours_from_gmt ) CREATE TABLE flight_stop ( flight_id, stop_number, stop_days, stop_airport, arrival_time, arrival_airline, arrival_flight_number, departure_time, departure_airline, departure_flight_number, stop_time ) CREATE TABLE city ( city_code, city_name, state_code, country_name, time_zone_code ) CREATE TABLE days ( days_code, day_name ) CREATE TABLE ground_service ( city_code, airport_code, transport_type, ground_fare ) CREATE TABLE month ( month_number, month_name ) -- Using valid SQLite, answer the following questions for the tables provided above. -- i will be staying downtown in ATLANTA for two hours could you tell me what the ground transportation is available SELECT### Response: SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'ATLANTA' AND ground_service.city_code = city.city_code.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE dataset ( datasetid, datasetname ) CREATE TABLE author ( authorid, authorname ) CREATE TABLE cite ( citingpaperid, citedpaperid ) CREATE TABLE paperdataset ( paperid, datasetid ) CREATE TABLE writes ( paperid, authorid ) CREATE TABLE paperkeyphrase ( paperid, keyphraseid ) CREATE TABLE paperfield ( fieldid, paperid ) CREATE TABLE field ( fieldid ) CREATE TABLE paper ( paperid, title, venueid, year, numciting, numcitedby, journalid ) CREATE TABLE keyphrase ( keyphraseid, keyphrasename ) CREATE TABLE journal ( journalid, journalname ) CREATE TABLE venue ( venueid, venuename ) -- Using valid SQLite, answer the following questions for the tables provided above. -- object recognition papers SELECT### Response: SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'object recognition' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE flight_fare ( flight_id, fare_id ) CREATE TABLE date_day ( month_number, day_number, year, day_name ) CREATE TABLE equipment_sequence ( aircraft_code_sequence, aircraft_code ) CREATE TABLE compartment_class ( compartment, class_type ) CREATE TABLE code_description ( code, description ) CREATE TABLE state ( state_code, state_name, country_name ) CREATE TABLE fare ( fare_id, from_airport, to_airport, fare_basis_code, fare_airline, restriction_code, one_direction_cost, round_trip_cost, round_trip_required ) CREATE TABLE dual_carrier ( main_airline, low_flight_number, high_flight_number, dual_airline, service_name ) CREATE TABLE flight ( aircraft_code_sequence, airline_code, airline_flight, arrival_time, connections, departure_time, dual_carrier, flight_days, flight_id, flight_number, from_airport, meal_code, stops, time_elapsed, to_airport ) CREATE TABLE airline ( airline_code, airline_name, note ) CREATE TABLE time_zone ( time_zone_code, time_zone_name, hours_from_gmt ) CREATE TABLE days ( days_code, day_name ) CREATE TABLE airport_service ( city_code, airport_code, miles_distant, direction, minutes_distant ) CREATE TABLE food_service ( meal_code, meal_number, compartment, meal_description ) CREATE TABLE flight_stop ( flight_id, stop_number, stop_days, stop_airport, arrival_time, arrival_airline, arrival_flight_number, departure_time, departure_airline, departure_flight_number, stop_time ) CREATE TABLE ground_service ( city_code, airport_code, transport_type, ground_fare ) CREATE TABLE flight_leg ( flight_id, leg_number, leg_flight ) CREATE TABLE aircraft ( aircraft_code, aircraft_description, manufacturer, basic_type, engines, propulsion, wide_body, wing_span, length, weight, capacity, pay_load, cruising_speed, range_miles, pressurized ) CREATE TABLE restriction ( restriction_code, advance_purchase, stopovers, saturday_stay_required, minimum_stay, maximum_stay, application, no_discounts ) CREATE TABLE fare_basis ( fare_basis_code, booking_class, class_type, premium, economy, discounted, night, season, basis_days ) CREATE TABLE month ( month_number, month_name ) CREATE TABLE time_interval ( period, begin_time, end_time ) CREATE TABLE airport ( airport_code, airport_name, airport_location, state_code, country_name, time_zone_code, minimum_connect_time ) CREATE TABLE city ( city_code, city_name, state_code, country_name, time_zone_code ) CREATE TABLE class_of_service ( booking_class, rank, class_description ) -- Using valid SQLite, answer the following questions for the tables provided above. -- show me the cities served by CP SELECT### Response: SELECT DISTINCT city.city_code FROM airport_service, city, flight WHERE city.city_code = airport_service.city_code AND flight.airline_code = 'CP' AND flight.from_airport = airport_service.airport_code.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE highlow ( state_name, highest_point, highest_elevation, lowest_point, lowest_elevation ) CREATE TABLE river ( river_name, length, traverse, country_name ) CREATE TABLE city ( city_name, state_name, population, country_name ) CREATE TABLE road ( road_name, state_name ) CREATE TABLE border_info ( state_name, border ) CREATE TABLE lake ( lake_name, area, state_name, country_name ) CREATE TABLE state ( state_name, capital, population, area, country_name, density ) CREATE TABLE mountain ( mountain_name, mountain_altitude, state_name, country_name ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the city in texas with the largest population SELECT### Response: SELECT city_name FROM city WHERE population = (SELECT MAX(CITYalias1.population) FROM city AS CITYalias1 WHERE CITYalias1.state_name = 'texas') AND state_name = 'texas'.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE flight_fare ( flight_id, fare_id ) CREATE TABLE fare ( fare_id, from_airport, to_airport, fare_basis_code, fare_airline, restriction_code, one_direction_cost, round_trip_cost, round_trip_required ) CREATE TABLE flight ( aircraft_code_sequence, airline_code, airline_flight, arrival_time, connections, departure_time, dual_carrier, flight_days, flight_id, flight_number, from_airport, meal_code, stops, time_elapsed, to_airport ) CREATE TABLE state ( state_code, state_name, country_name ) CREATE TABLE airline ( airline_code, airline_name, note ) CREATE TABLE airport_service ( city_code, airport_code, miles_distant, direction, minutes_distant ) CREATE TABLE date_day ( month_number, day_number, year, day_name ) CREATE TABLE city ( city_code, city_name, state_code, country_name, time_zone_code ) CREATE TABLE food_service ( meal_code, meal_number, compartment, meal_description ) CREATE TABLE time_interval ( period, begin_time, end_time ) CREATE TABLE flight_leg ( flight_id, leg_number, leg_flight ) CREATE TABLE dual_carrier ( main_airline, low_flight_number, high_flight_number, dual_airline, service_name ) CREATE TABLE class_of_service ( booking_class, rank, class_description ) CREATE TABLE aircraft ( aircraft_code, aircraft_description, manufacturer, basic_type, engines, propulsion, wide_body, wing_span, length, weight, capacity, pay_load, cruising_speed, range_miles, pressurized ) CREATE TABLE flight_stop ( flight_id, stop_number, stop_days, stop_airport, arrival_time, arrival_airline, arrival_flight_number, departure_time, departure_airline, departure_flight_number, stop_time ) CREATE TABLE ground_service ( city_code, airport_code, transport_type, ground_fare ) CREATE TABLE month ( month_number, month_name ) CREATE TABLE code_description ( code, description ) CREATE TABLE airport ( airport_code, airport_name, airport_location, state_code, country_name, time_zone_code, minimum_connect_time ) CREATE TABLE compartment_class ( compartment, class_type ) CREATE TABLE equipment_sequence ( aircraft_code_sequence, aircraft_code ) CREATE TABLE restriction ( restriction_code, advance_purchase, stopovers, saturday_stay_required, minimum_stay, maximum_stay, application, no_discounts ) CREATE TABLE time_zone ( time_zone_code, time_zone_name, hours_from_gmt ) CREATE TABLE days ( days_code, day_name ) CREATE TABLE fare_basis ( fare_basis_code, booking_class, class_type, premium, economy, discounted, night, season, basis_days ) -- Using valid SQLite, answer the following questions for the tables provided above. -- show me flights from DENVER to SAN FRANCISCO on wednesday SELECT### Response: 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, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE student_record ( student_id, course_id, semester, grade, how, transfer_source, earn_credit, repeat_term, test_id ) CREATE TABLE instructor ( instructor_id, name, uniqname ) CREATE TABLE jobs ( job_id, job_title, description, requirement, city, state, country, zip ) CREATE TABLE course_offering ( offering_id, course_id, semester, section_number, start_time, end_time, monday, tuesday, wednesday, thursday, friday, saturday, sunday, has_final_project, has_final_exam, textbook, class_address, allow_audit ) CREATE TABLE program ( program_id, name, college, introduction ) CREATE TABLE offering_instructor ( offering_instructor_id, offering_id, instructor_id ) CREATE TABLE student ( student_id, lastname, firstname, program_id, declare_major, total_credit, total_gpa, entered_as, admit_term, predicted_graduation_semester, degree, minor, internship ) CREATE TABLE gsi ( course_offering_id, student_id ) CREATE TABLE comment_instructor ( instructor_id, student_id, score, comment_text ) CREATE TABLE area ( course_id, area ) CREATE TABLE requirement ( requirement_id, requirement, college ) CREATE TABLE program_course ( program_id, course_id, workload, category ) CREATE TABLE course_prerequisite ( pre_course_id, course_id ) CREATE TABLE course ( course_id, name, department, number, credits, advisory_requirement, enforced_requirement, description, num_semesters, num_enrolled, has_discussion, has_lab, has_projects, has_exams, num_reviews, clarity_score, easiness_score, helpfulness_score ) CREATE TABLE course_tags_count ( course_id, clear_grading, pop_quiz, group_projects, inspirational, long_lectures, extra_credit, few_tests, good_feedback, tough_tests, heavy_papers, cares_for_students, heavy_assignments, respected, participation, heavy_reading, tough_grader, hilarious, would_take_again, good_lecture, no_skip ) CREATE TABLE semester ( semester_id, semester, year ) CREATE TABLE ta ( campus_job_id, student_id, location ) CREATE TABLE program_requirement ( program_id, category, min_credit, additional_req ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If I wanted to earn 13 credits per course , which courses should I select ? SELECT### Response: SELECT DISTINCT name, number FROM course WHERE credits = 13 AND department = 'EECS'.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE code_description ( code, description ) CREATE TABLE days ( days_code, day_name ) CREATE TABLE aircraft ( aircraft_code, aircraft_description, manufacturer, basic_type, engines, propulsion, wide_body, wing_span, length, weight, capacity, pay_load, cruising_speed, range_miles, pressurized ) CREATE TABLE time_interval ( period, begin_time, end_time ) CREATE TABLE airport_service ( city_code, airport_code, miles_distant, direction, minutes_distant ) CREATE TABLE state ( state_code, state_name, country_name ) CREATE TABLE fare_basis ( fare_basis_code, booking_class, class_type, premium, economy, discounted, night, season, basis_days ) CREATE TABLE flight_fare ( flight_id, fare_id ) CREATE TABLE date_day ( month_number, day_number, year, day_name ) CREATE TABLE ground_service ( city_code, airport_code, transport_type, ground_fare ) CREATE TABLE time_zone ( time_zone_code, time_zone_name, hours_from_gmt ) CREATE TABLE fare ( fare_id, from_airport, to_airport, fare_basis_code, fare_airline, restriction_code, one_direction_cost, round_trip_cost, round_trip_required ) CREATE TABLE airport ( airport_code, airport_name, airport_location, state_code, country_name, time_zone_code, minimum_connect_time ) CREATE TABLE food_service ( meal_code, meal_number, compartment, meal_description ) CREATE TABLE airline ( airline_code, airline_name, note ) CREATE TABLE equipment_sequence ( aircraft_code_sequence, aircraft_code ) CREATE TABLE city ( city_code, city_name, state_code, country_name, time_zone_code ) CREATE TABLE class_of_service ( booking_class, rank, class_description ) CREATE TABLE flight ( aircraft_code_sequence, airline_code, airline_flight, arrival_time, connections, departure_time, dual_carrier, flight_days, flight_id, flight_number, from_airport, meal_code, stops, time_elapsed, to_airport ) CREATE TABLE flight_stop ( flight_id, stop_number, stop_days, stop_airport, arrival_time, arrival_airline, arrival_flight_number, departure_time, departure_airline, departure_flight_number, stop_time ) CREATE TABLE compartment_class ( compartment, class_type ) CREATE TABLE dual_carrier ( main_airline, low_flight_number, high_flight_number, dual_airline, service_name ) CREATE TABLE restriction ( restriction_code, advance_purchase, stopovers, saturday_stay_required, minimum_stay, maximum_stay, application, no_discounts ) CREATE TABLE flight_leg ( flight_id, leg_number, leg_flight ) CREATE TABLE month ( month_number, month_name ) -- Using valid SQLite, answer the following questions for the tables provided above. -- UA flights stopping in DENVER before 1200 SELECT### Response: SELECT DISTINCT flight.flight_id FROM airport_service, city, flight, flight_stop WHERE city.city_code = airport_service.city_code AND city.city_name = 'DENVER' AND flight_stop.arrival_time < 1200 AND flight_stop.stop_airport = airport_service.airport_code AND flight.airline_code = 'UA' AND flight.flight_id = flight_stop.flight_id.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE fare ( fare_id, from_airport, to_airport, fare_basis_code, fare_airline, restriction_code, one_direction_cost, round_trip_cost, round_trip_required ) CREATE TABLE airport_service ( city_code, airport_code, miles_distant, direction, minutes_distant ) CREATE TABLE time_zone ( time_zone_code, time_zone_name, hours_from_gmt ) CREATE TABLE days ( days_code, day_name ) CREATE TABLE code_description ( code, description ) CREATE TABLE class_of_service ( booking_class, rank, class_description ) CREATE TABLE city ( city_code, city_name, state_code, country_name, time_zone_code ) CREATE TABLE food_service ( meal_code, meal_number, compartment, meal_description ) CREATE TABLE aircraft ( aircraft_code, aircraft_description, manufacturer, basic_type, engines, propulsion, wide_body, wing_span, length, weight, capacity, pay_load, cruising_speed, range_miles, pressurized ) CREATE TABLE month ( month_number, month_name ) CREATE TABLE airport ( airport_code, airport_name, airport_location, state_code, country_name, time_zone_code, minimum_connect_time ) CREATE TABLE ground_service ( city_code, airport_code, transport_type, ground_fare ) CREATE TABLE compartment_class ( compartment, class_type ) CREATE TABLE flight ( aircraft_code_sequence, airline_code, airline_flight, arrival_time, connections, departure_time, dual_carrier, flight_days, flight_id, flight_number, from_airport, meal_code, stops, time_elapsed, to_airport ) CREATE TABLE flight_fare ( flight_id, fare_id ) CREATE TABLE time_interval ( period, begin_time, end_time ) CREATE TABLE flight_leg ( flight_id, leg_number, leg_flight ) CREATE TABLE flight_stop ( flight_id, stop_number, stop_days, stop_airport, arrival_time, arrival_airline, arrival_flight_number, departure_time, departure_airline, departure_flight_number, stop_time ) CREATE TABLE dual_carrier ( main_airline, low_flight_number, high_flight_number, dual_airline, service_name ) CREATE TABLE date_day ( month_number, day_number, year, day_name ) CREATE TABLE state ( state_code, state_name, country_name ) CREATE TABLE airline ( airline_code, airline_name, note ) CREATE TABLE restriction ( restriction_code, advance_purchase, stopovers, saturday_stay_required, minimum_stay, maximum_stay, application, no_discounts ) CREATE TABLE equipment_sequence ( aircraft_code_sequence, aircraft_code ) CREATE TABLE fare_basis ( fare_basis_code, booking_class, class_type, premium, economy, discounted, night, season, basis_days ) -- Using valid SQLite, answer the following questions for the tables provided above. -- show me the flights from SALT LAKE CITY to ST. PETERSBURG on wednesday SELECT### Response: 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, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ST. PETERSBURG' AND date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SALT LAKE CITY' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE city ( city_name, state_name, population, country_name ) CREATE TABLE lake ( lake_name, area, state_name, country_name ) CREATE TABLE state ( state_name, capital, population, area, country_name, density ) CREATE TABLE road ( road_name, state_name ) CREATE TABLE highlow ( state_name, highest_point, highest_elevation, lowest_point, lowest_elevation ) CREATE TABLE river ( river_name, length, traverse, country_name ) CREATE TABLE mountain ( mountain_name, mountain_altitude, state_name, country_name ) CREATE TABLE border_info ( state_name, border ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the highest point in the country SELECT### Response: SELECT highest_point FROM highlow WHERE highest_elevation = (SELECT MAX(HIGHLOWalias1.highest_elevation) FROM highlow AS HIGHLOWalias1).
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE restriction ( restriction_code, advance_purchase, stopovers, saturday_stay_required, minimum_stay, maximum_stay, application, no_discounts ) CREATE TABLE city ( city_code, city_name, state_code, country_name, time_zone_code ) CREATE TABLE food_service ( meal_code, meal_number, compartment, meal_description ) CREATE TABLE fare_basis ( fare_basis_code, booking_class, class_type, premium, economy, discounted, night, season, basis_days ) CREATE TABLE class_of_service ( booking_class, rank, class_description ) CREATE TABLE airport_service ( city_code, airport_code, miles_distant, direction, minutes_distant ) CREATE TABLE state ( state_code, state_name, country_name ) CREATE TABLE flight_stop ( flight_id, stop_number, stop_days, stop_airport, arrival_time, arrival_airline, arrival_flight_number, departure_time, departure_airline, departure_flight_number, stop_time ) CREATE TABLE month ( month_number, month_name ) CREATE TABLE airline ( airline_code, airline_name, note ) CREATE TABLE flight ( aircraft_code_sequence, airline_code, airline_flight, arrival_time, connections, departure_time, dual_carrier, flight_days, flight_id, flight_number, from_airport, meal_code, stops, time_elapsed, to_airport ) CREATE TABLE flight_fare ( flight_id, fare_id ) CREATE TABLE days ( days_code, day_name ) CREATE TABLE dual_carrier ( main_airline, low_flight_number, high_flight_number, dual_airline, service_name ) CREATE TABLE equipment_sequence ( aircraft_code_sequence, aircraft_code ) CREATE TABLE time_interval ( period, begin_time, end_time ) CREATE TABLE time_zone ( time_zone_code, time_zone_name, hours_from_gmt ) CREATE TABLE ground_service ( city_code, airport_code, transport_type, ground_fare ) CREATE TABLE fare ( fare_id, from_airport, to_airport, fare_basis_code, fare_airline, restriction_code, one_direction_cost, round_trip_cost, round_trip_required ) CREATE TABLE compartment_class ( compartment, class_type ) CREATE TABLE flight_leg ( flight_id, leg_number, leg_flight ) CREATE TABLE date_day ( month_number, day_number, year, day_name ) CREATE TABLE airport ( airport_code, airport_name, airport_location, state_code, country_name, time_zone_code, minimum_connect_time ) CREATE TABLE aircraft ( aircraft_code, aircraft_description, manufacturer, basic_type, engines, propulsion, wide_body, wing_span, length, weight, capacity, pay_load, cruising_speed, range_miles, pressurized ) CREATE TABLE code_description ( code, description ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what are the flights from MILWAUKEE to SEATTLE SELECT### Response: 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 = 'MILWAUKEE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SEATTLE' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE program_requirement ( program_id, category, min_credit, additional_req ) CREATE TABLE student ( student_id, lastname, firstname, program_id, declare_major, total_credit, total_gpa, entered_as, admit_term, predicted_graduation_semester, degree, minor, internship ) CREATE TABLE course ( course_id, name, department, number, credits, advisory_requirement, enforced_requirement, description, num_semesters, num_enrolled, has_discussion, has_lab, has_projects, has_exams, num_reviews, clarity_score, easiness_score, helpfulness_score ) CREATE TABLE ta ( campus_job_id, student_id, location ) CREATE TABLE course_offering ( offering_id, course_id, semester, section_number, start_time, end_time, monday, tuesday, wednesday, thursday, friday, saturday, sunday, has_final_project, has_final_exam, textbook, class_address, allow_audit ) CREATE TABLE semester ( semester_id, semester, year ) CREATE TABLE comment_instructor ( instructor_id, student_id, score, comment_text ) CREATE TABLE student_record ( student_id, course_id, semester, grade, how, transfer_source, earn_credit, repeat_term, test_id ) CREATE TABLE program_course ( program_id, course_id, workload, category ) CREATE TABLE program ( program_id, name, college, introduction ) CREATE TABLE requirement ( requirement_id, requirement, college ) CREATE TABLE gsi ( course_offering_id, student_id ) CREATE TABLE course_prerequisite ( pre_course_id, course_id ) CREATE TABLE area ( course_id, area ) CREATE TABLE jobs ( job_id, job_title, description, requirement, city, state, country, zip ) CREATE TABLE offering_instructor ( offering_instructor_id, offering_id, instructor_id ) CREATE TABLE course_tags_count ( course_id, clear_grading, pop_quiz, group_projects, inspirational, long_lectures, extra_credit, few_tests, good_feedback, tough_tests, heavy_papers, cares_for_students, heavy_assignments, respected, participation, heavy_reading, tough_grader, hilarious, would_take_again, good_lecture, no_skip ) CREATE TABLE instructor ( instructor_id, name, uniqname ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where can I start taking a computing infrastructure course ? SELECT### Response: SELECT DISTINCT course.department, course.name, course.number FROM area, course WHERE area.area LIKE '%computing infrastructure%' AND course.course_id = area.course_id.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE date_day ( month_number, day_number, year, day_name ) CREATE TABLE fare_basis ( fare_basis_code, booking_class, class_type, premium, economy, discounted, night, season, basis_days ) CREATE TABLE flight_fare ( flight_id, fare_id ) CREATE TABLE state ( state_code, state_name, country_name ) CREATE TABLE ground_service ( city_code, airport_code, transport_type, ground_fare ) CREATE TABLE month ( month_number, month_name ) CREATE TABLE airline ( airline_code, airline_name, note ) CREATE TABLE fare ( fare_id, from_airport, to_airport, fare_basis_code, fare_airline, restriction_code, one_direction_cost, round_trip_cost, round_trip_required ) CREATE TABLE flight ( aircraft_code_sequence, airline_code, airline_flight, arrival_time, connections, departure_time, dual_carrier, flight_days, flight_id, flight_number, from_airport, meal_code, stops, time_elapsed, to_airport ) CREATE TABLE days ( days_code, day_name ) CREATE TABLE flight_leg ( flight_id, leg_number, leg_flight ) CREATE TABLE airport_service ( city_code, airport_code, miles_distant, direction, minutes_distant ) CREATE TABLE compartment_class ( compartment, class_type ) CREATE TABLE restriction ( restriction_code, advance_purchase, stopovers, saturday_stay_required, minimum_stay, maximum_stay, application, no_discounts ) CREATE TABLE time_zone ( time_zone_code, time_zone_name, hours_from_gmt ) CREATE TABLE city ( city_code, city_name, state_code, country_name, time_zone_code ) CREATE TABLE aircraft ( aircraft_code, aircraft_description, manufacturer, basic_type, engines, propulsion, wide_body, wing_span, length, weight, capacity, pay_load, cruising_speed, range_miles, pressurized ) CREATE TABLE time_interval ( period, begin_time, end_time ) CREATE TABLE equipment_sequence ( aircraft_code_sequence, aircraft_code ) CREATE TABLE flight_stop ( flight_id, stop_number, stop_days, stop_airport, arrival_time, arrival_airline, arrival_flight_number, departure_time, departure_airline, departure_flight_number, stop_time ) CREATE TABLE dual_carrier ( main_airline, low_flight_number, high_flight_number, dual_airline, service_name ) CREATE TABLE airport ( airport_code, airport_name, airport_location, state_code, country_name, time_zone_code, minimum_connect_time ) CREATE TABLE food_service ( meal_code, meal_number, compartment, meal_description ) CREATE TABLE code_description ( code, description ) CREATE TABLE class_of_service ( booking_class, rank, class_description ) -- Using valid SQLite, answer the following questions for the tables provided above. -- all flights from CLEVELAND to NEWARK SELECT### Response: 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 = 'CLEVELAND' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'NEWARK' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE airport_service ( city_code, airport_code, miles_distant, direction, minutes_distant ) CREATE TABLE code_description ( code, description ) CREATE TABLE days ( days_code, day_name ) CREATE TABLE restriction ( restriction_code, advance_purchase, stopovers, saturday_stay_required, minimum_stay, maximum_stay, application, no_discounts ) CREATE TABLE date_day ( month_number, day_number, year, day_name ) CREATE TABLE class_of_service ( booking_class, rank, class_description ) CREATE TABLE compartment_class ( compartment, class_type ) CREATE TABLE aircraft ( aircraft_code, aircraft_description, manufacturer, basic_type, engines, propulsion, wide_body, wing_span, length, weight, capacity, pay_load, cruising_speed, range_miles, pressurized ) CREATE TABLE month ( month_number, month_name ) CREATE TABLE flight_stop ( flight_id, stop_number, stop_days, stop_airport, arrival_time, arrival_airline, arrival_flight_number, departure_time, departure_airline, departure_flight_number, stop_time ) CREATE TABLE city ( city_code, city_name, state_code, country_name, time_zone_code ) CREATE TABLE flight_leg ( flight_id, leg_number, leg_flight ) CREATE TABLE flight ( aircraft_code_sequence, airline_code, airline_flight, arrival_time, connections, departure_time, dual_carrier, flight_days, flight_id, flight_number, from_airport, meal_code, stops, time_elapsed, to_airport ) CREATE TABLE flight_fare ( flight_id, fare_id ) CREATE TABLE state ( state_code, state_name, country_name ) CREATE TABLE time_zone ( time_zone_code, time_zone_name, hours_from_gmt ) CREATE TABLE airport ( airport_code, airport_name, airport_location, state_code, country_name, time_zone_code, minimum_connect_time ) CREATE TABLE food_service ( meal_code, meal_number, compartment, meal_description ) CREATE TABLE dual_carrier ( main_airline, low_flight_number, high_flight_number, dual_airline, service_name ) CREATE TABLE equipment_sequence ( aircraft_code_sequence, aircraft_code ) CREATE TABLE fare ( fare_id, from_airport, to_airport, fare_basis_code, fare_airline, restriction_code, one_direction_cost, round_trip_cost, round_trip_required ) CREATE TABLE airline ( airline_code, airline_name, note ) CREATE TABLE ground_service ( city_code, airport_code, transport_type, ground_fare ) CREATE TABLE fare_basis ( fare_basis_code, booking_class, class_type, premium, economy, discounted, night, season, basis_days ) CREATE TABLE time_interval ( period, begin_time, end_time ) -- Using valid SQLite, answer the following questions for the tables provided above. -- i want to find a flight from BOSTON to ATLANTA SELECT### Response: 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 = 'BOSTON' 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.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE airport ( airport_code, airport_name, airport_location, state_code, country_name, time_zone_code, minimum_connect_time ) CREATE TABLE ground_service ( city_code, airport_code, transport_type, ground_fare ) CREATE TABLE flight_stop ( flight_id, stop_number, stop_days, stop_airport, arrival_time, arrival_airline, arrival_flight_number, departure_time, departure_airline, departure_flight_number, stop_time ) CREATE TABLE flight ( aircraft_code_sequence, airline_code, airline_flight, arrival_time, connections, departure_time, dual_carrier, flight_days, flight_id, flight_number, from_airport, meal_code, stops, time_elapsed, to_airport ) CREATE TABLE dual_carrier ( main_airline, low_flight_number, high_flight_number, dual_airline, service_name ) CREATE TABLE time_zone ( time_zone_code, time_zone_name, hours_from_gmt ) CREATE TABLE month ( month_number, month_name ) CREATE TABLE date_day ( month_number, day_number, year, day_name ) CREATE TABLE fare ( fare_id, from_airport, to_airport, fare_basis_code, fare_airline, restriction_code, one_direction_cost, round_trip_cost, round_trip_required ) CREATE TABLE days ( days_code, day_name ) CREATE TABLE food_service ( meal_code, meal_number, compartment, meal_description ) CREATE TABLE class_of_service ( booking_class, rank, class_description ) CREATE TABLE city ( city_code, city_name, state_code, country_name, time_zone_code ) CREATE TABLE aircraft ( aircraft_code, aircraft_description, manufacturer, basic_type, engines, propulsion, wide_body, wing_span, length, weight, capacity, pay_load, cruising_speed, range_miles, pressurized ) CREATE TABLE state ( state_code, state_name, country_name ) CREATE TABLE restriction ( restriction_code, advance_purchase, stopovers, saturday_stay_required, minimum_stay, maximum_stay, application, no_discounts ) CREATE TABLE flight_fare ( flight_id, fare_id ) CREATE TABLE time_interval ( period, begin_time, end_time ) CREATE TABLE compartment_class ( compartment, class_type ) CREATE TABLE equipment_sequence ( aircraft_code_sequence, aircraft_code ) CREATE TABLE code_description ( code, description ) CREATE TABLE airline ( airline_code, airline_name, note ) CREATE TABLE flight_leg ( flight_id, leg_number, leg_flight ) CREATE TABLE airport_service ( city_code, airport_code, miles_distant, direction, minutes_distant ) CREATE TABLE fare_basis ( fare_basis_code, booking_class, class_type, premium, economy, discounted, night, season, basis_days ) -- Using valid SQLite, answer the following questions for the tables provided above. -- i want information on flights from ATLANTA to WASHINGTON give me information on flights after 1600 on wednesday SELECT### Response: 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, date_day, days, flight WHERE ((date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time > 1600 AND flight.flight_days = days.days_code) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHINGTON' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE publication ( abstract, cid, citation_num, jid, pid, reference_num, title, year ) CREATE TABLE publication_keyword ( kid, pid ) CREATE TABLE keyword ( keyword, kid ) CREATE TABLE domain_conference ( cid, did ) CREATE TABLE writes ( aid, pid ) CREATE TABLE domain_author ( aid, did ) CREATE TABLE domain ( did, name ) CREATE TABLE domain_keyword ( did, kid ) CREATE TABLE journal ( homepage, jid, name ) CREATE TABLE domain_journal ( did, jid ) CREATE TABLE domain_publication ( did, pid ) CREATE TABLE conference ( cid, homepage, name ) CREATE TABLE cite ( cited, citing ) CREATE TABLE author ( aid, homepage, name, oid ) CREATE TABLE organization ( continent, homepage, name, oid ) -- Using valid SQLite, answer the following questions for the tables provided above. -- return me the number of papers in PVLDB in ' University of Michigan ' . SELECT### Response: SELECT COUNT(DISTINCT (publication.title)) FROM author, journal, organization, publication, writes WHERE journal.name = 'PVLDB' AND organization.name = 'University of Michigan' AND organization.oid = author.oid AND publication.jid = journal.jid AND writes.aid = author.aid AND writes.pid = publication.pid.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE fare_basis ( fare_basis_code, booking_class, class_type, premium, economy, discounted, night, season, basis_days ) CREATE TABLE flight_leg ( flight_id, leg_number, leg_flight ) CREATE TABLE ground_service ( city_code, airport_code, transport_type, ground_fare ) CREATE TABLE city ( city_code, city_name, state_code, country_name, time_zone_code ) CREATE TABLE restriction ( restriction_code, advance_purchase, stopovers, saturday_stay_required, minimum_stay, maximum_stay, application, no_discounts ) CREATE TABLE dual_carrier ( main_airline, low_flight_number, high_flight_number, dual_airline, service_name ) CREATE TABLE equipment_sequence ( aircraft_code_sequence, aircraft_code ) CREATE TABLE days ( days_code, day_name ) CREATE TABLE aircraft ( aircraft_code, aircraft_description, manufacturer, basic_type, engines, propulsion, wide_body, wing_span, length, weight, capacity, pay_load, cruising_speed, range_miles, pressurized ) CREATE TABLE food_service ( meal_code, meal_number, compartment, meal_description ) CREATE TABLE time_zone ( time_zone_code, time_zone_name, hours_from_gmt ) CREATE TABLE flight ( aircraft_code_sequence, airline_code, airline_flight, arrival_time, connections, departure_time, dual_carrier, flight_days, flight_id, flight_number, from_airport, meal_code, stops, time_elapsed, to_airport ) CREATE TABLE fare ( fare_id, from_airport, to_airport, fare_basis_code, fare_airline, restriction_code, one_direction_cost, round_trip_cost, round_trip_required ) CREATE TABLE class_of_service ( booking_class, rank, class_description ) CREATE TABLE airline ( airline_code, airline_name, note ) CREATE TABLE time_interval ( period, begin_time, end_time ) CREATE TABLE month ( month_number, month_name ) CREATE TABLE flight_stop ( flight_id, stop_number, stop_days, stop_airport, arrival_time, arrival_airline, arrival_flight_number, departure_time, departure_airline, departure_flight_number, stop_time ) CREATE TABLE state ( state_code, state_name, country_name ) CREATE TABLE compartment_class ( compartment, class_type ) CREATE TABLE airport ( airport_code, airport_name, airport_location, state_code, country_name, time_zone_code, minimum_connect_time ) CREATE TABLE flight_fare ( flight_id, fare_id ) CREATE TABLE date_day ( month_number, day_number, year, day_name ) CREATE TABLE airport_service ( city_code, airport_code, miles_distant, direction, minutes_distant ) CREATE TABLE code_description ( code, description ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what ground transportation is available into WASHINGTON SELECT### Response: SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'WASHINGTON' AND ground_service.city_code = city.city_code.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE ground_service ( city_code, airport_code, transport_type, ground_fare ) CREATE TABLE compartment_class ( compartment, class_type ) CREATE TABLE flight ( aircraft_code_sequence, airline_code, airline_flight, arrival_time, connections, departure_time, dual_carrier, flight_days, flight_id, flight_number, from_airport, meal_code, stops, time_elapsed, to_airport ) CREATE TABLE airline ( airline_code, airline_name, note ) CREATE TABLE dual_carrier ( main_airline, low_flight_number, high_flight_number, dual_airline, service_name ) CREATE TABLE food_service ( meal_code, meal_number, compartment, meal_description ) CREATE TABLE aircraft ( aircraft_code, aircraft_description, manufacturer, basic_type, engines, propulsion, wide_body, wing_span, length, weight, capacity, pay_load, cruising_speed, range_miles, pressurized ) CREATE TABLE fare_basis ( fare_basis_code, booking_class, class_type, premium, economy, discounted, night, season, basis_days ) CREATE TABLE time_zone ( time_zone_code, time_zone_name, hours_from_gmt ) CREATE TABLE flight_leg ( flight_id, leg_number, leg_flight ) CREATE TABLE time_interval ( period, begin_time, end_time ) CREATE TABLE flight_fare ( flight_id, fare_id ) CREATE TABLE fare ( fare_id, from_airport, to_airport, fare_basis_code, fare_airline, restriction_code, one_direction_cost, round_trip_cost, round_trip_required ) CREATE TABLE date_day ( month_number, day_number, year, day_name ) CREATE TABLE state ( state_code, state_name, country_name ) CREATE TABLE code_description ( code, description ) CREATE TABLE month ( month_number, month_name ) CREATE TABLE restriction ( restriction_code, advance_purchase, stopovers, saturday_stay_required, minimum_stay, maximum_stay, application, no_discounts ) CREATE TABLE equipment_sequence ( aircraft_code_sequence, aircraft_code ) CREATE TABLE flight_stop ( flight_id, stop_number, stop_days, stop_airport, arrival_time, arrival_airline, arrival_flight_number, departure_time, departure_airline, departure_flight_number, stop_time ) CREATE TABLE class_of_service ( booking_class, rank, class_description ) CREATE TABLE airport ( airport_code, airport_name, airport_location, state_code, country_name, time_zone_code, minimum_connect_time ) CREATE TABLE days ( days_code, day_name ) CREATE TABLE airport_service ( city_code, airport_code, miles_distant, direction, minutes_distant ) CREATE TABLE city ( city_code, city_name, state_code, country_name, time_zone_code ) -- Using valid SQLite, answer the following questions for the tables provided above. -- ground transportation WASHINGTON SELECT### Response: SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'WASHINGTON' AND ground_service.city_code = city.city_code.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE author ( authorid, authorname ) CREATE TABLE writes ( paperid, authorid ) CREATE TABLE journal ( journalid, journalname ) CREATE TABLE field ( fieldid ) CREATE TABLE paperdataset ( paperid, datasetid ) CREATE TABLE paper ( paperid, title, venueid, year, numciting, numcitedby, journalid ) CREATE TABLE cite ( citingpaperid, citedpaperid ) CREATE TABLE paperfield ( fieldid, paperid ) CREATE TABLE keyphrase ( keyphraseid, keyphrasename ) CREATE TABLE dataset ( datasetid, datasetname ) CREATE TABLE venue ( venueid, venuename ) CREATE TABLE paperkeyphrase ( paperid, keyphraseid ) -- Using valid SQLite, answer the following questions for the tables provided above. -- datasets for knn SELECT### Response: SELECT DISTINCT dataset.datasetid FROM dataset, keyphrase, paperdataset, paperkeyphrase WHERE keyphrase.keyphrasename = 'knn' AND paperdataset.datasetid = dataset.datasetid AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paperkeyphrase.paperid = paperdataset.paperid.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE compartment_class ( compartment, class_type ) CREATE TABLE class_of_service ( booking_class, rank, class_description ) CREATE TABLE time_zone ( time_zone_code, time_zone_name, hours_from_gmt ) CREATE TABLE flight_leg ( flight_id, leg_number, leg_flight ) CREATE TABLE dual_carrier ( main_airline, low_flight_number, high_flight_number, dual_airline, service_name ) CREATE TABLE days ( days_code, day_name ) CREATE TABLE aircraft ( aircraft_code, aircraft_description, manufacturer, basic_type, engines, propulsion, wide_body, wing_span, length, weight, capacity, pay_load, cruising_speed, range_miles, pressurized ) CREATE TABLE time_interval ( period, begin_time, end_time ) CREATE TABLE ground_service ( city_code, airport_code, transport_type, ground_fare ) CREATE TABLE state ( state_code, state_name, country_name ) CREATE TABLE food_service ( meal_code, meal_number, compartment, meal_description ) CREATE TABLE flight ( aircraft_code_sequence, airline_code, airline_flight, arrival_time, connections, departure_time, dual_carrier, flight_days, flight_id, flight_number, from_airport, meal_code, stops, time_elapsed, to_airport ) CREATE TABLE fare ( fare_id, from_airport, to_airport, fare_basis_code, fare_airline, restriction_code, one_direction_cost, round_trip_cost, round_trip_required ) CREATE TABLE airport_service ( city_code, airport_code, miles_distant, direction, minutes_distant ) CREATE TABLE fare_basis ( fare_basis_code, booking_class, class_type, premium, economy, discounted, night, season, basis_days ) CREATE TABLE code_description ( code, description ) CREATE TABLE city ( city_code, city_name, state_code, country_name, time_zone_code ) CREATE TABLE restriction ( restriction_code, advance_purchase, stopovers, saturday_stay_required, minimum_stay, maximum_stay, application, no_discounts ) CREATE TABLE date_day ( month_number, day_number, year, day_name ) CREATE TABLE airline ( airline_code, airline_name, note ) CREATE TABLE equipment_sequence ( aircraft_code_sequence, aircraft_code ) CREATE TABLE month ( month_number, month_name ) CREATE TABLE airport ( airport_code, airport_name, airport_location, state_code, country_name, time_zone_code, minimum_connect_time ) CREATE TABLE flight_fare ( flight_id, fare_id ) CREATE TABLE flight_stop ( flight_id, stop_number, stop_days, stop_airport, arrival_time, arrival_airline, arrival_flight_number, departure_time, departure_airline, departure_flight_number, stop_time ) -- Using valid SQLite, answer the following questions for the tables provided above. -- when are the AA flights from PHOENIX to MILWAUKEE SELECT### Response: SELECT DISTINCT flight.departure_time 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 = 'PHOENIX' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MILWAUKEE' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND flight.airline_code = 'AA'.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE geographic ( city_name, county, region ) CREATE TABLE restaurant ( id, name, food_type, city_name, rating ) CREATE TABLE location ( restaurant_id, house_number, street_name, city_name ) -- Using valid SQLite, answer the following questions for the tables provided above. -- give me some good places for arabic on buchanan in san francisco ? SELECT### Response: SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'san francisco' AND location.street_name = 'buchanan' AND restaurant.food_type = 'arabic' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE geographic ( city_name, county, region ) CREATE TABLE restaurant ( id, name, food_type, city_name, rating ) CREATE TABLE location ( restaurant_id, house_number, street_name, city_name ) -- Using valid SQLite, answer the following questions for the tables provided above. -- give me a good restaurant on bethel island rd in bethel island ? SELECT### Response: SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'bethel island' AND location.street_name = 'bethel island rd' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE river ( river_name, length, traverse, country_name ) CREATE TABLE city ( city_name, state_name, population, country_name ) CREATE TABLE highlow ( state_name, highest_point, highest_elevation, lowest_point, lowest_elevation ) CREATE TABLE state ( state_name, capital, population, area, country_name, density ) CREATE TABLE lake ( lake_name, area, state_name, country_name ) CREATE TABLE border_info ( state_name, border ) CREATE TABLE mountain ( mountain_name, mountain_altitude, state_name, country_name ) CREATE TABLE road ( road_name, state_name ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what state that borders texas is the largest SELECT### Response: SELECT state_name FROM state WHERE area = (SELECT MAX(STATEalias1.area) FROM state AS STATEalias1 WHERE STATEalias1.state_name IN (SELECT BORDER_INFOalias0.border FROM border_info AS BORDER_INFOalias0 WHERE BORDER_INFOalias0.state_name = 'texas')) AND state_name IN (SELECT BORDER_INFOalias1.border FROM border_info AS BORDER_INFOalias1 WHERE BORDER_INFOalias1.state_name = 'texas').
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE course ( course_id, name, department, number, credits, advisory_requirement, enforced_requirement, description, num_semesters, num_enrolled, has_discussion, has_lab, has_projects, has_exams, num_reviews, clarity_score, easiness_score, helpfulness_score ) CREATE TABLE comment_instructor ( instructor_id, student_id, score, comment_text ) CREATE TABLE course_tags_count ( course_id, clear_grading, pop_quiz, group_projects, inspirational, long_lectures, extra_credit, few_tests, good_feedback, tough_tests, heavy_papers, cares_for_students, heavy_assignments, respected, participation, heavy_reading, tough_grader, hilarious, would_take_again, good_lecture, no_skip ) CREATE TABLE course_prerequisite ( pre_course_id, course_id ) CREATE TABLE requirement ( requirement_id, requirement, college ) CREATE TABLE gsi ( course_offering_id, student_id ) CREATE TABLE ta ( campus_job_id, student_id, location ) CREATE TABLE program_requirement ( program_id, category, min_credit, additional_req ) CREATE TABLE offering_instructor ( offering_instructor_id, offering_id, instructor_id ) CREATE TABLE instructor ( instructor_id, name, uniqname ) CREATE TABLE course_offering ( offering_id, course_id, semester, section_number, start_time, end_time, monday, tuesday, wednesday, thursday, friday, saturday, sunday, has_final_project, has_final_exam, textbook, class_address, allow_audit ) CREATE TABLE program ( program_id, name, college, introduction ) CREATE TABLE semester ( semester_id, semester, year ) CREATE TABLE jobs ( job_id, job_title, description, requirement, city, state, country, zip ) CREATE TABLE area ( course_id, area ) CREATE TABLE student ( student_id, lastname, firstname, program_id, declare_major, total_credit, total_gpa, entered_as, admit_term, predicted_graduation_semester, degree, minor, internship ) CREATE TABLE program_course ( program_id, course_id, workload, category ) CREATE TABLE student_record ( student_id, course_id, semester, grade, how, transfer_source, earn_credit, repeat_term, test_id ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which classes on intelligent systems are offered in Fall or Winter of 2003 ? SELECT### Response: SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE area.area LIKE '%intelligent systems%' AND semester.semester IN ('WN', 'FA') AND semester.year = 2003.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE equipment_sequence ( aircraft_code_sequence, aircraft_code ) CREATE TABLE fare_basis ( fare_basis_code, booking_class, class_type, premium, economy, discounted, night, season, basis_days ) CREATE TABLE dual_carrier ( main_airline, low_flight_number, high_flight_number, dual_airline, service_name ) CREATE TABLE flight ( aircraft_code_sequence, airline_code, airline_flight, arrival_time, connections, departure_time, dual_carrier, flight_days, flight_id, flight_number, from_airport, meal_code, stops, time_elapsed, to_airport ) CREATE TABLE date_day ( month_number, day_number, year, day_name ) CREATE TABLE code_description ( code, description ) CREATE TABLE airline ( airline_code, airline_name, note ) CREATE TABLE ground_service ( city_code, airport_code, transport_type, ground_fare ) CREATE TABLE compartment_class ( compartment, class_type ) CREATE TABLE days ( days_code, day_name ) CREATE TABLE city ( city_code, city_name, state_code, country_name, time_zone_code ) CREATE TABLE time_zone ( time_zone_code, time_zone_name, hours_from_gmt ) CREATE TABLE restriction ( restriction_code, advance_purchase, stopovers, saturday_stay_required, minimum_stay, maximum_stay, application, no_discounts ) CREATE TABLE fare ( fare_id, from_airport, to_airport, fare_basis_code, fare_airline, restriction_code, one_direction_cost, round_trip_cost, round_trip_required ) CREATE TABLE class_of_service ( booking_class, rank, class_description ) CREATE TABLE aircraft ( aircraft_code, aircraft_description, manufacturer, basic_type, engines, propulsion, wide_body, wing_span, length, weight, capacity, pay_load, cruising_speed, range_miles, pressurized ) CREATE TABLE food_service ( meal_code, meal_number, compartment, meal_description ) CREATE TABLE flight_stop ( flight_id, stop_number, stop_days, stop_airport, arrival_time, arrival_airline, arrival_flight_number, departure_time, departure_airline, departure_flight_number, stop_time ) CREATE TABLE airport ( airport_code, airport_name, airport_location, state_code, country_name, time_zone_code, minimum_connect_time ) CREATE TABLE month ( month_number, month_name ) CREATE TABLE time_interval ( period, begin_time, end_time ) CREATE TABLE state ( state_code, state_name, country_name ) CREATE TABLE flight_fare ( flight_id, fare_id ) CREATE TABLE airport_service ( city_code, airport_code, miles_distant, direction, minutes_distant ) CREATE TABLE flight_leg ( flight_id, leg_number, leg_flight ) -- Using valid SQLite, answer the following questions for the tables provided above. -- show morning flights from PHILADELPHIA to DALLAS SELECT### Response: 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 = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND flight.departure_time BETWEEN 0 AND 1200.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE location ( restaurant_id, house_number, street_name, city_name ) CREATE TABLE geographic ( city_name, county, region ) CREATE TABLE restaurant ( id, name, food_type, city_name, rating ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many places for french are there in palo alto ? SELECT### Response: SELECT COUNT(*) FROM location, restaurant WHERE location.city_name = 'palo alto' AND restaurant.food_type = 'french' AND restaurant.id = location.restaurant_id.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE days ( days_code, day_name ) CREATE TABLE flight_leg ( flight_id, leg_number, leg_flight ) CREATE TABLE time_zone ( time_zone_code, time_zone_name, hours_from_gmt ) CREATE TABLE month ( month_number, month_name ) CREATE TABLE state ( state_code, state_name, country_name ) CREATE TABLE ground_service ( city_code, airport_code, transport_type, ground_fare ) CREATE TABLE city ( city_code, city_name, state_code, country_name, time_zone_code ) CREATE TABLE fare ( fare_id, from_airport, to_airport, fare_basis_code, fare_airline, restriction_code, one_direction_cost, round_trip_cost, round_trip_required ) CREATE TABLE date_day ( month_number, day_number, year, day_name ) CREATE TABLE airport ( airport_code, airport_name, airport_location, state_code, country_name, time_zone_code, minimum_connect_time ) CREATE TABLE code_description ( code, description ) CREATE TABLE fare_basis ( fare_basis_code, booking_class, class_type, premium, economy, discounted, night, season, basis_days ) CREATE TABLE airline ( airline_code, airline_name, note ) CREATE TABLE time_interval ( period, begin_time, end_time ) CREATE TABLE aircraft ( aircraft_code, aircraft_description, manufacturer, basic_type, engines, propulsion, wide_body, wing_span, length, weight, capacity, pay_load, cruising_speed, range_miles, pressurized ) CREATE TABLE restriction ( restriction_code, advance_purchase, stopovers, saturday_stay_required, minimum_stay, maximum_stay, application, no_discounts ) CREATE TABLE airport_service ( city_code, airport_code, miles_distant, direction, minutes_distant ) CREATE TABLE flight_stop ( flight_id, stop_number, stop_days, stop_airport, arrival_time, arrival_airline, arrival_flight_number, departure_time, departure_airline, departure_flight_number, stop_time ) CREATE TABLE dual_carrier ( main_airline, low_flight_number, high_flight_number, dual_airline, service_name ) CREATE TABLE food_service ( meal_code, meal_number, compartment, meal_description ) CREATE TABLE equipment_sequence ( aircraft_code_sequence, aircraft_code ) CREATE TABLE flight ( aircraft_code_sequence, airline_code, airline_flight, arrival_time, connections, departure_time, dual_carrier, flight_days, flight_id, flight_number, from_airport, meal_code, stops, time_elapsed, to_airport ) CREATE TABLE compartment_class ( compartment, class_type ) CREATE TABLE flight_fare ( flight_id, fare_id ) CREATE TABLE class_of_service ( booking_class, rank, class_description ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the cheapest flight from SAN FRANCISCO to PITTSBURGH on sunday SELECT### Response: SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, airport_service AS AIRPORT_SERVICE_3, city AS CITY_0, city AS CITY_1, city AS CITY_2, city AS CITY_3, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE ((((CITY_3.city_code = AIRPORT_SERVICE_3.city_code AND CITY_3.city_name = 'PITTSBURGH' AND DATE_DAY_1.day_number = 27 AND DATE_DAY_1.month_number = 8 AND DATE_DAY_1.year = 1991 AND DAYS_1.day_name = DATE_DAY_1.day_name AND fare_basis.basis_days = DAYS_1.days_code AND fare.fare_basis_code = fare_basis.fare_basis_code AND fare.to_airport = AIRPORT_SERVICE_3.airport_code) AND CITY_2.city_code = AIRPORT_SERVICE_2.city_code AND CITY_2.city_name = 'SAN FRANCISCO' AND fare.from_airport = AIRPORT_SERVICE_2.airport_code) AND DATE_DAY_0.day_number = 27 AND DATE_DAY_0.month_number = 8 AND DATE_DAY_0.year = 1991 AND DAYS_0.day_name = DATE_DAY_0.day_name AND fare.one_direction_cost = (SELECT MIN(FAREalias1.one_direction_cost) FROM airport_service AS AIRPORT_SERVICEalias4, airport_service AS AIRPORT_SERVICEalias5, city AS CITYalias4, city AS CITYalias5, date_day AS DATE_DAYalias2, days AS DAYSalias2, fare AS FAREalias1, fare_basis AS FARE_BASISalias1 WHERE (CITYalias5.city_code = AIRPORT_SERVICEalias5.city_code AND CITYalias5.city_name = 'PITTSBURGH' AND DATE_DAYalias2.day_number = 27 AND DATE_DAYalias2.month_number = 8 AND DATE_DAYalias2.year = 1991 AND DAYSalias2.day_name = DATE_DAYalias2.day_name AND FARE_BASISalias1.basis_days = DAYSalias2.days_code AND FAREalias1.fare_basis_code = FARE_BASISalias1.fare_basis_code AND FAREalias1.to_airport = AIRPORT_SERVICEalias5.airport_code) AND CITYalias4.city_code = AIRPORT_SERVICEalias4.city_code AND CITYalias4.city_name = 'SAN FRANCISCO' AND FAREalias1.from_airport = AIRPORT_SERVICEalias4.airport_code) AND flight_fare.fare_id = fare.fare_id AND flight.flight_days = DAYS_0.days_code AND flight.flight_id = flight_fare.flight_id) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SAN FRANCISCO' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE cite ( cited, citing ) CREATE TABLE domain_keyword ( did, kid ) CREATE TABLE conference ( cid, homepage, name ) CREATE TABLE writes ( aid, pid ) CREATE TABLE keyword ( keyword, kid ) CREATE TABLE publication ( abstract, cid, citation_num, jid, pid, reference_num, title, year ) CREATE TABLE domain_publication ( did, pid ) CREATE TABLE organization ( continent, homepage, name, oid ) CREATE TABLE domain_conference ( cid, did ) CREATE TABLE author ( aid, homepage, name, oid ) CREATE TABLE publication_keyword ( kid, pid ) CREATE TABLE domain ( did, name ) CREATE TABLE journal ( homepage, jid, name ) CREATE TABLE domain_journal ( did, jid ) CREATE TABLE domain_author ( aid, did ) -- Using valid SQLite, answer the following questions for the tables provided above. -- return me the citations of ' Making database systems usable ' . SELECT### Response: SELECT citation_num FROM publication WHERE title = 'Making database systems usable'.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE instructor ( instructor_id, name, uniqname ) CREATE TABLE course_offering ( offering_id, course_id, semester, section_number, start_time, end_time, monday, tuesday, wednesday, thursday, friday, saturday, sunday, has_final_project, has_final_exam, textbook, class_address, allow_audit ) CREATE TABLE comment_instructor ( instructor_id, student_id, score, comment_text ) CREATE TABLE area ( course_id, area ) CREATE TABLE course_tags_count ( course_id, clear_grading, pop_quiz, group_projects, inspirational, long_lectures, extra_credit, few_tests, good_feedback, tough_tests, heavy_papers, cares_for_students, heavy_assignments, respected, participation, heavy_reading, tough_grader, hilarious, would_take_again, good_lecture, no_skip ) CREATE TABLE program ( program_id, name, college, introduction ) CREATE TABLE course_prerequisite ( pre_course_id, course_id ) CREATE TABLE requirement ( requirement_id, requirement, college ) CREATE TABLE course ( course_id, name, department, number, credits, advisory_requirement, enforced_requirement, description, num_semesters, num_enrolled, has_discussion, has_lab, has_projects, has_exams, num_reviews, clarity_score, easiness_score, helpfulness_score ) CREATE TABLE gsi ( course_offering_id, student_id ) CREATE TABLE semester ( semester_id, semester, year ) CREATE TABLE program_course ( program_id, course_id, workload, category ) CREATE TABLE student ( student_id, lastname, firstname, program_id, declare_major, total_credit, total_gpa, entered_as, admit_term, predicted_graduation_semester, degree, minor, internship ) CREATE TABLE offering_instructor ( offering_instructor_id, offering_id, instructor_id ) CREATE TABLE student_record ( student_id, course_id, semester, grade, how, transfer_source, earn_credit, repeat_term, test_id ) CREATE TABLE ta ( campus_job_id, student_id, location ) CREATE TABLE jobs ( job_id, job_title, description, requirement, city, state, country, zip ) CREATE TABLE program_requirement ( program_id, category, min_credit, additional_req ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who 's teaching computing infrastructure courses ? SELECT### Response: SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN area ON course_offering.course_id = area.course_id WHERE area.area LIKE '%computing infrastructure%'.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE class_of_service ( booking_class, rank, class_description ) CREATE TABLE food_service ( meal_code, meal_number, compartment, meal_description ) CREATE TABLE equipment_sequence ( aircraft_code_sequence, aircraft_code ) CREATE TABLE airport ( airport_code, airport_name, airport_location, state_code, country_name, time_zone_code, minimum_connect_time ) CREATE TABLE code_description ( code, description ) CREATE TABLE dual_carrier ( main_airline, low_flight_number, high_flight_number, dual_airline, service_name ) CREATE TABLE aircraft ( aircraft_code, aircraft_description, manufacturer, basic_type, engines, propulsion, wide_body, wing_span, length, weight, capacity, pay_load, cruising_speed, range_miles, pressurized ) CREATE TABLE compartment_class ( compartment, class_type ) CREATE TABLE airport_service ( city_code, airport_code, miles_distant, direction, minutes_distant ) CREATE TABLE ground_service ( city_code, airport_code, transport_type, ground_fare ) CREATE TABLE date_day ( month_number, day_number, year, day_name ) CREATE TABLE flight_fare ( flight_id, fare_id ) CREATE TABLE state ( state_code, state_name, country_name ) CREATE TABLE days ( days_code, day_name ) CREATE TABLE fare_basis ( fare_basis_code, booking_class, class_type, premium, economy, discounted, night, season, basis_days ) CREATE TABLE time_zone ( time_zone_code, time_zone_name, hours_from_gmt ) CREATE TABLE flight_leg ( flight_id, leg_number, leg_flight ) CREATE TABLE month ( month_number, month_name ) CREATE TABLE city ( city_code, city_name, state_code, country_name, time_zone_code ) CREATE TABLE time_interval ( period, begin_time, end_time ) CREATE TABLE flight_stop ( flight_id, stop_number, stop_days, stop_airport, arrival_time, arrival_airline, arrival_flight_number, departure_time, departure_airline, departure_flight_number, stop_time ) CREATE TABLE flight ( aircraft_code_sequence, airline_code, airline_flight, arrival_time, connections, departure_time, dual_carrier, flight_days, flight_id, flight_number, from_airport, meal_code, stops, time_elapsed, to_airport ) CREATE TABLE airline ( airline_code, airline_name, note ) CREATE TABLE fare ( fare_id, from_airport, to_airport, fare_basis_code, fare_airline, restriction_code, one_direction_cost, round_trip_cost, round_trip_required ) CREATE TABLE restriction ( restriction_code, advance_purchase, stopovers, saturday_stay_required, minimum_stay, maximum_stay, application, no_discounts ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what 's the cheapest round trip fare between DALLAS and BALTIMORE SELECT### Response: SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND fare.round_trip_cost = (SELECT MIN(FAREalias1.round_trip_cost) FROM airport_service AS AIRPORT_SERVICEalias2, airport_service AS AIRPORT_SERVICEalias3, city AS CITYalias2, city AS CITYalias3, fare AS FAREalias1, flight AS FLIGHTalias1, flight_fare AS FLIGHT_FAREalias1 WHERE CITYalias2.city_code = AIRPORT_SERVICEalias2.city_code AND CITYalias2.city_name = 'DALLAS' AND CITYalias3.city_code = AIRPORT_SERVICEalias3.city_code AND CITYalias3.city_name = 'BALTIMORE' AND FLIGHT_FAREalias1.fare_id = FAREalias1.fare_id AND FLIGHTalias1.flight_id = FLIGHT_FAREalias1.flight_id AND FLIGHTalias1.from_airport = AIRPORT_SERVICEalias2.airport_code AND FLIGHTalias1.to_airport = AIRPORT_SERVICEalias3.airport_code) AND flight_fare.fare_id = fare.fare_id AND flight.flight_id = flight_fare.flight_id AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE instructor ( instructor_id, name, uniqname ) CREATE TABLE comment_instructor ( instructor_id, student_id, score, comment_text ) CREATE TABLE course_offering ( offering_id, course_id, semester, section_number, start_time, end_time, monday, tuesday, wednesday, thursday, friday, saturday, sunday, has_final_project, has_final_exam, textbook, class_address, allow_audit ) CREATE TABLE program ( program_id, name, college, introduction ) CREATE TABLE ta ( campus_job_id, student_id, location ) CREATE TABLE course_tags_count ( course_id, clear_grading, pop_quiz, group_projects, inspirational, long_lectures, extra_credit, few_tests, good_feedback, tough_tests, heavy_papers, cares_for_students, heavy_assignments, respected, participation, heavy_reading, tough_grader, hilarious, would_take_again, good_lecture, no_skip ) CREATE TABLE requirement ( requirement_id, requirement, college ) CREATE TABLE program_requirement ( program_id, category, min_credit, additional_req ) CREATE TABLE program_course ( program_id, course_id, workload, category ) CREATE TABLE area ( course_id, area ) CREATE TABLE course_prerequisite ( pre_course_id, course_id ) CREATE TABLE course ( course_id, name, department, number, credits, advisory_requirement, enforced_requirement, description, num_semesters, num_enrolled, has_discussion, has_lab, has_projects, has_exams, num_reviews, clarity_score, easiness_score, helpfulness_score ) CREATE TABLE student ( student_id, lastname, firstname, program_id, declare_major, total_credit, total_gpa, entered_as, admit_term, predicted_graduation_semester, degree, minor, internship ) CREATE TABLE gsi ( course_offering_id, student_id ) CREATE TABLE student_record ( student_id, course_id, semester, grade, how, transfer_source, earn_credit, repeat_term, test_id ) CREATE TABLE jobs ( job_id, job_title, description, requirement, city, state, country, zip ) CREATE TABLE offering_instructor ( offering_instructor_id, offering_id, instructor_id ) CREATE TABLE semester ( semester_id, semester, year ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Out of all the upper level classes , what number have labs ? SELECT### Response: SELECT COUNT(DISTINCT course.course_id) FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.has_lab = 'Y' AND program_course.category LIKE '%ULCS%'.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE lake ( lake_name, area, state_name, country_name ) CREATE TABLE border_info ( state_name, border ) CREATE TABLE mountain ( mountain_name, mountain_altitude, state_name, country_name ) CREATE TABLE river ( river_name, length, traverse, country_name ) CREATE TABLE road ( road_name, state_name ) CREATE TABLE state ( state_name, capital, population, area, country_name, density ) CREATE TABLE city ( city_name, state_name, population, country_name ) CREATE TABLE highlow ( state_name, highest_point, highest_elevation, lowest_point, lowest_elevation ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many major cities are in states bordering nebraska SELECT### Response: SELECT COUNT(city_name) FROM city WHERE population > 150000 AND state_name IN (SELECT BORDER_INFOalias0.border FROM border_info AS BORDER_INFOalias0 WHERE BORDER_INFOalias0.state_name = 'nebraska').
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE program_course ( program_id, course_id, workload, category ) CREATE TABLE requirement ( requirement_id, requirement, college ) CREATE TABLE course ( course_id, name, department, number, credits, advisory_requirement, enforced_requirement, description, num_semesters, num_enrolled, has_discussion, has_lab, has_projects, has_exams, num_reviews, clarity_score, easiness_score, helpfulness_score ) CREATE TABLE offering_instructor ( offering_instructor_id, offering_id, instructor_id ) CREATE TABLE student ( student_id, lastname, firstname, program_id, declare_major, total_credit, total_gpa, entered_as, admit_term, predicted_graduation_semester, degree, minor, internship ) CREATE TABLE program_requirement ( program_id, category, min_credit, additional_req ) CREATE TABLE instructor ( instructor_id, name, uniqname ) CREATE TABLE ta ( campus_job_id, student_id, location ) CREATE TABLE gsi ( course_offering_id, student_id ) CREATE TABLE area ( course_id, area ) CREATE TABLE course_tags_count ( course_id, clear_grading, pop_quiz, group_projects, inspirational, long_lectures, extra_credit, few_tests, good_feedback, tough_tests, heavy_papers, cares_for_students, heavy_assignments, respected, participation, heavy_reading, tough_grader, hilarious, would_take_again, good_lecture, no_skip ) CREATE TABLE jobs ( job_id, job_title, description, requirement, city, state, country, zip ) CREATE TABLE course_prerequisite ( pre_course_id, course_id ) CREATE TABLE program ( program_id, name, college, introduction ) CREATE TABLE student_record ( student_id, course_id, semester, grade, how, transfer_source, earn_credit, repeat_term, test_id ) CREATE TABLE semester ( semester_id, semester, year ) CREATE TABLE comment_instructor ( instructor_id, student_id, score, comment_text ) CREATE TABLE course_offering ( offering_id, course_id, semester, section_number, start_time, end_time, monday, tuesday, wednesday, thursday, friday, saturday, sunday, has_final_project, has_final_exam, textbook, class_address, allow_audit ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For class RCIDIV 390 , how often does it meet ? SELECT### Response: SELECT DISTINCT course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'RCIDIV' AND course.number = 390 AND semester.semester = 'WN' AND semester.year = 2016.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE time_zone ( time_zone_code, time_zone_name, hours_from_gmt ) CREATE TABLE days ( days_code, day_name ) CREATE TABLE flight_fare ( flight_id, fare_id ) CREATE TABLE date_day ( month_number, day_number, year, day_name ) CREATE TABLE fare_basis ( fare_basis_code, booking_class, class_type, premium, economy, discounted, night, season, basis_days ) CREATE TABLE airport_service ( city_code, airport_code, miles_distant, direction, minutes_distant ) CREATE TABLE restriction ( restriction_code, advance_purchase, stopovers, saturday_stay_required, minimum_stay, maximum_stay, application, no_discounts ) CREATE TABLE month ( month_number, month_name ) CREATE TABLE class_of_service ( booking_class, rank, class_description ) CREATE TABLE compartment_class ( compartment, class_type ) CREATE TABLE equipment_sequence ( aircraft_code_sequence, aircraft_code ) CREATE TABLE fare ( fare_id, from_airport, to_airport, fare_basis_code, fare_airline, restriction_code, one_direction_cost, round_trip_cost, round_trip_required ) CREATE TABLE aircraft ( aircraft_code, aircraft_description, manufacturer, basic_type, engines, propulsion, wide_body, wing_span, length, weight, capacity, pay_load, cruising_speed, range_miles, pressurized ) CREATE TABLE airline ( airline_code, airline_name, note ) CREATE TABLE flight ( aircraft_code_sequence, airline_code, airline_flight, arrival_time, connections, departure_time, dual_carrier, flight_days, flight_id, flight_number, from_airport, meal_code, stops, time_elapsed, to_airport ) CREATE TABLE state ( state_code, state_name, country_name ) CREATE TABLE flight_leg ( flight_id, leg_number, leg_flight ) CREATE TABLE dual_carrier ( main_airline, low_flight_number, high_flight_number, dual_airline, service_name ) CREATE TABLE airport ( airport_code, airport_name, airport_location, state_code, country_name, time_zone_code, minimum_connect_time ) CREATE TABLE city ( city_code, city_name, state_code, country_name, time_zone_code ) CREATE TABLE flight_stop ( flight_id, stop_number, stop_days, stop_airport, arrival_time, arrival_airline, arrival_flight_number, departure_time, departure_airline, departure_flight_number, stop_time ) CREATE TABLE code_description ( code, description ) CREATE TABLE ground_service ( city_code, airport_code, transport_type, ground_fare ) CREATE TABLE food_service ( meal_code, meal_number, compartment, meal_description ) CREATE TABLE time_interval ( period, begin_time, end_time ) -- Using valid SQLite, answer the following questions for the tables provided above. -- from PHOENIX to DENVER on a MONDAY SELECT### Response: 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, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND days.day_name = 'MONDAY' AND flight.flight_days = days.days_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PHOENIX' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE state ( state_code, state_name, country_name ) CREATE TABLE time_zone ( time_zone_code, time_zone_name, hours_from_gmt ) CREATE TABLE flight ( aircraft_code_sequence, airline_code, airline_flight, arrival_time, connections, departure_time, dual_carrier, flight_days, flight_id, flight_number, from_airport, meal_code, stops, time_elapsed, to_airport ) CREATE TABLE restriction ( restriction_code, advance_purchase, stopovers, saturday_stay_required, minimum_stay, maximum_stay, application, no_discounts ) CREATE TABLE aircraft ( aircraft_code, aircraft_description, manufacturer, basic_type, engines, propulsion, wide_body, wing_span, length, weight, capacity, pay_load, cruising_speed, range_miles, pressurized ) CREATE TABLE flight_fare ( flight_id, fare_id ) CREATE TABLE ground_service ( city_code, airport_code, transport_type, ground_fare ) CREATE TABLE fare ( fare_id, from_airport, to_airport, fare_basis_code, fare_airline, restriction_code, one_direction_cost, round_trip_cost, round_trip_required ) CREATE TABLE airport_service ( city_code, airport_code, miles_distant, direction, minutes_distant ) CREATE TABLE equipment_sequence ( aircraft_code_sequence, aircraft_code ) CREATE TABLE airport ( airport_code, airport_name, airport_location, state_code, country_name, time_zone_code, minimum_connect_time ) CREATE TABLE fare_basis ( fare_basis_code, booking_class, class_type, premium, economy, discounted, night, season, basis_days ) CREATE TABLE dual_carrier ( main_airline, low_flight_number, high_flight_number, dual_airline, service_name ) CREATE TABLE compartment_class ( compartment, class_type ) CREATE TABLE month ( month_number, month_name ) CREATE TABLE flight_leg ( flight_id, leg_number, leg_flight ) CREATE TABLE code_description ( code, description ) CREATE TABLE flight_stop ( flight_id, stop_number, stop_days, stop_airport, arrival_time, arrival_airline, arrival_flight_number, departure_time, departure_airline, departure_flight_number, stop_time ) CREATE TABLE food_service ( meal_code, meal_number, compartment, meal_description ) CREATE TABLE date_day ( month_number, day_number, year, day_name ) CREATE TABLE time_interval ( period, begin_time, end_time ) CREATE TABLE class_of_service ( booking_class, rank, class_description ) CREATE TABLE days ( days_code, day_name ) CREATE TABLE airline ( airline_code, airline_name, note ) CREATE TABLE city ( city_code, city_name, state_code, country_name, time_zone_code ) -- Using valid SQLite, answer the following questions for the tables provided above. -- find any flight from BOSTON to OAKLAND stopping in DENVER SELECT### Response: SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'OAKLAND' AND CITY_2.city_code = AIRPORT_SERVICE_2.city_code AND CITY_2.city_name = 'DENVER' AND flight_stop.stop_airport = AIRPORT_SERVICE_2.airport_code AND flight.flight_id = flight_stop.flight_id AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE flight_leg ( flight_id, leg_number, leg_flight ) CREATE TABLE code_description ( code, description ) CREATE TABLE state ( state_code, state_name, country_name ) CREATE TABLE equipment_sequence ( aircraft_code_sequence, aircraft_code ) CREATE TABLE time_interval ( period, begin_time, end_time ) CREATE TABLE fare_basis ( fare_basis_code, booking_class, class_type, premium, economy, discounted, night, season, basis_days ) CREATE TABLE fare ( fare_id, from_airport, to_airport, fare_basis_code, fare_airline, restriction_code, one_direction_cost, round_trip_cost, round_trip_required ) CREATE TABLE compartment_class ( compartment, class_type ) CREATE TABLE flight ( aircraft_code_sequence, airline_code, airline_flight, arrival_time, connections, departure_time, dual_carrier, flight_days, flight_id, flight_number, from_airport, meal_code, stops, time_elapsed, to_airport ) CREATE TABLE city ( city_code, city_name, state_code, country_name, time_zone_code ) CREATE TABLE flight_stop ( flight_id, stop_number, stop_days, stop_airport, arrival_time, arrival_airline, arrival_flight_number, departure_time, departure_airline, departure_flight_number, stop_time ) CREATE TABLE days ( days_code, day_name ) CREATE TABLE flight_fare ( flight_id, fare_id ) CREATE TABLE aircraft ( aircraft_code, aircraft_description, manufacturer, basic_type, engines, propulsion, wide_body, wing_span, length, weight, capacity, pay_load, cruising_speed, range_miles, pressurized ) CREATE TABLE month ( month_number, month_name ) CREATE TABLE time_zone ( time_zone_code, time_zone_name, hours_from_gmt ) CREATE TABLE airport ( airport_code, airport_name, airport_location, state_code, country_name, time_zone_code, minimum_connect_time ) CREATE TABLE restriction ( restriction_code, advance_purchase, stopovers, saturday_stay_required, minimum_stay, maximum_stay, application, no_discounts ) CREATE TABLE date_day ( month_number, day_number, year, day_name ) CREATE TABLE dual_carrier ( main_airline, low_flight_number, high_flight_number, dual_airline, service_name ) CREATE TABLE food_service ( meal_code, meal_number, compartment, meal_description ) CREATE TABLE class_of_service ( booking_class, rank, class_description ) CREATE TABLE ground_service ( city_code, airport_code, transport_type, ground_fare ) CREATE TABLE airport_service ( city_code, airport_code, miles_distant, direction, minutes_distant ) CREATE TABLE airline ( airline_code, airline_name, note ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what flights go from SAN FRANCISCO to DENVER on MONDAY SELECT### Response: 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, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND days.day_name = 'MONDAY' AND flight.flight_days = days.days_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SAN FRANCISCO' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE fare_basis ( fare_basis_code, booking_class, class_type, premium, economy, discounted, night, season, basis_days ) CREATE TABLE time_zone ( time_zone_code, time_zone_name, hours_from_gmt ) CREATE TABLE dual_carrier ( main_airline, low_flight_number, high_flight_number, dual_airline, service_name ) CREATE TABLE flight_leg ( flight_id, leg_number, leg_flight ) CREATE TABLE time_interval ( period, begin_time, end_time ) CREATE TABLE flight ( aircraft_code_sequence, airline_code, airline_flight, arrival_time, connections, departure_time, dual_carrier, flight_days, flight_id, flight_number, from_airport, meal_code, stops, time_elapsed, to_airport ) CREATE TABLE days ( days_code, day_name ) CREATE TABLE equipment_sequence ( aircraft_code_sequence, aircraft_code ) CREATE TABLE ground_service ( city_code, airport_code, transport_type, ground_fare ) CREATE TABLE restriction ( restriction_code, advance_purchase, stopovers, saturday_stay_required, minimum_stay, maximum_stay, application, no_discounts ) CREATE TABLE code_description ( code, description ) CREATE TABLE city ( city_code, city_name, state_code, country_name, time_zone_code ) CREATE TABLE compartment_class ( compartment, class_type ) CREATE TABLE airport ( airport_code, airport_name, airport_location, state_code, country_name, time_zone_code, minimum_connect_time ) CREATE TABLE fare ( fare_id, from_airport, to_airport, fare_basis_code, fare_airline, restriction_code, one_direction_cost, round_trip_cost, round_trip_required ) CREATE TABLE airport_service ( city_code, airport_code, miles_distant, direction, minutes_distant ) CREATE TABLE month ( month_number, month_name ) CREATE TABLE state ( state_code, state_name, country_name ) CREATE TABLE flight_fare ( flight_id, fare_id ) CREATE TABLE date_day ( month_number, day_number, year, day_name ) CREATE TABLE airline ( airline_code, airline_name, note ) CREATE TABLE food_service ( meal_code, meal_number, compartment, meal_description ) CREATE TABLE aircraft ( aircraft_code, aircraft_description, manufacturer, basic_type, engines, propulsion, wide_body, wing_span, length, weight, capacity, pay_load, cruising_speed, range_miles, pressurized ) CREATE TABLE flight_stop ( flight_id, stop_number, stop_days, stop_airport, arrival_time, arrival_airline, arrival_flight_number, departure_time, departure_airline, departure_flight_number, stop_time ) CREATE TABLE class_of_service ( booking_class, rank, class_description ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what time does flight AA 459 depart SELECT### Response: SELECT DISTINCT flight.departure_time FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.flight_number = 459 AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PHILADELPHIA' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code) AND flight.airline_code = 'AA'.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE program ( program_id, name, college, introduction ) CREATE TABLE offering_instructor ( offering_instructor_id, offering_id, instructor_id ) CREATE TABLE course ( course_id, name, department, number, credits, advisory_requirement, enforced_requirement, description, num_semesters, num_enrolled, has_discussion, has_lab, has_projects, has_exams, num_reviews, clarity_score, easiness_score, helpfulness_score ) CREATE TABLE program_course ( program_id, course_id, workload, category ) CREATE TABLE ta ( campus_job_id, student_id, location ) CREATE TABLE jobs ( job_id, job_title, description, requirement, city, state, country, zip ) CREATE TABLE program_requirement ( program_id, category, min_credit, additional_req ) CREATE TABLE comment_instructor ( instructor_id, student_id, score, comment_text ) CREATE TABLE gsi ( course_offering_id, student_id ) CREATE TABLE semester ( semester_id, semester, year ) CREATE TABLE course_prerequisite ( pre_course_id, course_id ) CREATE TABLE course_offering ( offering_id, course_id, semester, section_number, start_time, end_time, monday, tuesday, wednesday, thursday, friday, saturday, sunday, has_final_project, has_final_exam, textbook, class_address, allow_audit ) CREATE TABLE course_tags_count ( course_id, clear_grading, pop_quiz, group_projects, inspirational, long_lectures, extra_credit, few_tests, good_feedback, tough_tests, heavy_papers, cares_for_students, heavy_assignments, respected, participation, heavy_reading, tough_grader, hilarious, would_take_again, good_lecture, no_skip ) CREATE TABLE requirement ( requirement_id, requirement, college ) CREATE TABLE instructor ( instructor_id, name, uniqname ) CREATE TABLE student_record ( student_id, course_id, semester, grade, how, transfer_source, earn_credit, repeat_term, test_id ) CREATE TABLE student ( student_id, lastname, firstname, program_id, declare_major, total_credit, total_gpa, entered_as, admit_term, predicted_graduation_semester, degree, minor, internship ) CREATE TABLE area ( course_id, area ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When is 511 offered next semester ? SELECT### Response: SELECT DISTINCT course_offering.end_time, course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.start_time, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 511 AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE course ( course_id, name, department, number, credits, advisory_requirement, enforced_requirement, description, num_semesters, num_enrolled, has_discussion, has_lab, has_projects, has_exams, num_reviews, clarity_score, easiness_score, helpfulness_score ) CREATE TABLE program ( program_id, name, college, introduction ) CREATE TABLE jobs ( job_id, job_title, description, requirement, city, state, country, zip ) CREATE TABLE requirement ( requirement_id, requirement, college ) CREATE TABLE ta ( campus_job_id, student_id, location ) CREATE TABLE course_prerequisite ( pre_course_id, course_id ) CREATE TABLE student ( student_id, lastname, firstname, program_id, declare_major, total_credit, total_gpa, entered_as, admit_term, predicted_graduation_semester, degree, minor, internship ) CREATE TABLE gsi ( course_offering_id, student_id ) CREATE TABLE course_tags_count ( course_id, clear_grading, pop_quiz, group_projects, inspirational, long_lectures, extra_credit, few_tests, good_feedback, tough_tests, heavy_papers, cares_for_students, heavy_assignments, respected, participation, heavy_reading, tough_grader, hilarious, would_take_again, good_lecture, no_skip ) CREATE TABLE student_record ( student_id, course_id, semester, grade, how, transfer_source, earn_credit, repeat_term, test_id ) CREATE TABLE course_offering ( offering_id, course_id, semester, section_number, start_time, end_time, monday, tuesday, wednesday, thursday, friday, saturday, sunday, has_final_project, has_final_exam, textbook, class_address, allow_audit ) CREATE TABLE comment_instructor ( instructor_id, student_id, score, comment_text ) CREATE TABLE instructor ( instructor_id, name, uniqname ) CREATE TABLE program_course ( program_id, course_id, workload, category ) CREATE TABLE program_requirement ( program_id, category, min_credit, additional_req ) CREATE TABLE area ( course_id, area ) CREATE TABLE offering_instructor ( offering_instructor_id, offering_id, instructor_id ) CREATE TABLE semester ( semester_id, semester, year ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Between EECS 485 and 529 , which one is easier to get through ? SELECT### Response: SELECT DISTINCT course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (course.number = 485 OR course.number = 529) AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 INNER JOIN course AS COURSEalias1 ON PROGRAM_COURSEalias1.course_id = COURSEalias1.course_id WHERE (COURSEalias1.number = 485 OR COURSEalias1.number = 529) AND COURSEalias1.department = 'EECS').
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE time_zone ( time_zone_code, time_zone_name, hours_from_gmt ) CREATE TABLE ground_service ( city_code, airport_code, transport_type, ground_fare ) CREATE TABLE flight ( aircraft_code_sequence, airline_code, airline_flight, arrival_time, connections, departure_time, dual_carrier, flight_days, flight_id, flight_number, from_airport, meal_code, stops, time_elapsed, to_airport ) CREATE TABLE city ( city_code, city_name, state_code, country_name, time_zone_code ) CREATE TABLE restriction ( restriction_code, advance_purchase, stopovers, saturday_stay_required, minimum_stay, maximum_stay, application, no_discounts ) CREATE TABLE fare ( fare_id, from_airport, to_airport, fare_basis_code, fare_airline, restriction_code, one_direction_cost, round_trip_cost, round_trip_required ) CREATE TABLE food_service ( meal_code, meal_number, compartment, meal_description ) CREATE TABLE flight_fare ( flight_id, fare_id ) CREATE TABLE flight_leg ( flight_id, leg_number, leg_flight ) CREATE TABLE airport ( airport_code, airport_name, airport_location, state_code, country_name, time_zone_code, minimum_connect_time ) CREATE TABLE date_day ( month_number, day_number, year, day_name ) CREATE TABLE airline ( airline_code, airline_name, note ) CREATE TABLE flight_stop ( flight_id, stop_number, stop_days, stop_airport, arrival_time, arrival_airline, arrival_flight_number, departure_time, departure_airline, departure_flight_number, stop_time ) CREATE TABLE fare_basis ( fare_basis_code, booking_class, class_type, premium, economy, discounted, night, season, basis_days ) CREATE TABLE days ( days_code, day_name ) CREATE TABLE compartment_class ( compartment, class_type ) CREATE TABLE month ( month_number, month_name ) CREATE TABLE time_interval ( period, begin_time, end_time ) CREATE TABLE airport_service ( city_code, airport_code, miles_distant, direction, minutes_distant ) CREATE TABLE class_of_service ( booking_class, rank, class_description ) CREATE TABLE code_description ( code, description ) CREATE TABLE state ( state_code, state_name, country_name ) CREATE TABLE equipment_sequence ( aircraft_code_sequence, aircraft_code ) CREATE TABLE aircraft ( aircraft_code, aircraft_description, manufacturer, basic_type, engines, propulsion, wide_body, wing_span, length, weight, capacity, pay_load, cruising_speed, range_miles, pressurized ) CREATE TABLE dual_carrier ( main_airline, low_flight_number, high_flight_number, dual_airline, service_name ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which flights are serviced by AA SELECT### Response: SELECT DISTINCT flight_id FROM flight WHERE airline_code = 'AA'.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE river ( river_name, length, traverse, country_name ) CREATE TABLE border_info ( state_name, border ) CREATE TABLE city ( city_name, state_name, population, country_name ) CREATE TABLE mountain ( mountain_name, mountain_altitude, state_name, country_name ) CREATE TABLE highlow ( state_name, highest_point, highest_elevation, lowest_point, lowest_elevation ) CREATE TABLE road ( road_name, state_name ) CREATE TABLE state ( state_name, capital, population, area, country_name, density ) CREATE TABLE lake ( lake_name, area, state_name, country_name ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what states border states that border states that border states that border texas SELECT### Response: SELECT BORDER_INFO_0.border FROM border_info AS BORDER_INFO_0, border_info AS BORDER_INFO_1, border_info AS BORDER_INFO_2, border_info AS BORDER_INFO_3 WHERE BORDER_INFO_1.border = BORDER_INFO_0.state_name AND BORDER_INFO_2.border = BORDER_INFO_1.state_name AND BORDER_INFO_3.border = BORDER_INFO_2.state_name AND BORDER_INFO_3.state_name = 'texas'.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE student ( student_id, lastname, firstname, program_id, declare_major, total_credit, total_gpa, entered_as, admit_term, predicted_graduation_semester, degree, minor, internship ) CREATE TABLE offering_instructor ( offering_instructor_id, offering_id, instructor_id ) CREATE TABLE program_requirement ( program_id, category, min_credit, additional_req ) CREATE TABLE program ( program_id, name, college, introduction ) CREATE TABLE course_offering ( offering_id, course_id, semester, section_number, start_time, end_time, monday, tuesday, wednesday, thursday, friday, saturday, sunday, has_final_project, has_final_exam, textbook, class_address, allow_audit ) CREATE TABLE gsi ( course_offering_id, student_id ) CREATE TABLE instructor ( instructor_id, name, uniqname ) CREATE TABLE student_record ( student_id, course_id, semester, grade, how, transfer_source, earn_credit, repeat_term, test_id ) CREATE TABLE comment_instructor ( instructor_id, student_id, score, comment_text ) CREATE TABLE program_course ( program_id, course_id, workload, category ) CREATE TABLE requirement ( requirement_id, requirement, college ) CREATE TABLE course ( course_id, name, department, number, credits, advisory_requirement, enforced_requirement, description, num_semesters, num_enrolled, has_discussion, has_lab, has_projects, has_exams, num_reviews, clarity_score, easiness_score, helpfulness_score ) CREATE TABLE jobs ( job_id, job_title, description, requirement, city, state, country, zip ) CREATE TABLE ta ( campus_job_id, student_id, location ) CREATE TABLE course_tags_count ( course_id, clear_grading, pop_quiz, group_projects, inspirational, long_lectures, extra_credit, few_tests, good_feedback, tough_tests, heavy_papers, cares_for_students, heavy_assignments, respected, participation, heavy_reading, tough_grader, hilarious, would_take_again, good_lecture, no_skip ) CREATE TABLE semester ( semester_id, semester, year ) CREATE TABLE area ( course_id, area ) CREATE TABLE course_prerequisite ( pre_course_id, course_id ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For my graduation is LHC 750 essential ? SELECT### Response: SELECT COUNT(*) > 0 FROM course, program_course WHERE course.department = 'LHC' AND course.number = 750 AND program_course.category LIKE '%Core%' AND program_course.course_id = course.course_id.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE offering_instructor ( offering_instructor_id, offering_id, instructor_id ) CREATE TABLE program ( program_id, name, college, introduction ) CREATE TABLE student_record ( student_id, course_id, semester, grade, how, transfer_source, earn_credit, repeat_term, test_id ) CREATE TABLE student ( student_id, lastname, firstname, program_id, declare_major, total_credit, total_gpa, entered_as, admit_term, predicted_graduation_semester, degree, minor, internship ) CREATE TABLE gsi ( course_offering_id, student_id ) CREATE TABLE course_tags_count ( course_id, clear_grading, pop_quiz, group_projects, inspirational, long_lectures, extra_credit, few_tests, good_feedback, tough_tests, heavy_papers, cares_for_students, heavy_assignments, respected, participation, heavy_reading, tough_grader, hilarious, would_take_again, good_lecture, no_skip ) CREATE TABLE course_prerequisite ( pre_course_id, course_id ) CREATE TABLE comment_instructor ( instructor_id, student_id, score, comment_text ) CREATE TABLE area ( course_id, area ) CREATE TABLE course_offering ( offering_id, course_id, semester, section_number, start_time, end_time, monday, tuesday, wednesday, thursday, friday, saturday, sunday, has_final_project, has_final_exam, textbook, class_address, allow_audit ) CREATE TABLE requirement ( requirement_id, requirement, college ) CREATE TABLE course ( course_id, name, department, number, credits, advisory_requirement, enforced_requirement, description, num_semesters, num_enrolled, has_discussion, has_lab, has_projects, has_exams, num_reviews, clarity_score, easiness_score, helpfulness_score ) CREATE TABLE program_course ( program_id, course_id, workload, category ) CREATE TABLE program_requirement ( program_id, category, min_credit, additional_req ) CREATE TABLE semester ( semester_id, semester, year ) CREATE TABLE ta ( campus_job_id, student_id, location ) CREATE TABLE instructor ( instructor_id, name, uniqname ) CREATE TABLE jobs ( job_id, job_title, description, requirement, city, state, country, zip ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What classes for computational science will be available in the Winter or Fall 2006 ? SELECT### Response: SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE area.area LIKE '%computational science%' AND semester.semester IN ('WN', 'FA') AND semester.year = 2006.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE dual_carrier ( main_airline, low_flight_number, high_flight_number, dual_airline, service_name ) CREATE TABLE airport_service ( city_code, airport_code, miles_distant, direction, minutes_distant ) CREATE TABLE aircraft ( aircraft_code, aircraft_description, manufacturer, basic_type, engines, propulsion, wide_body, wing_span, length, weight, capacity, pay_load, cruising_speed, range_miles, pressurized ) CREATE TABLE compartment_class ( compartment, class_type ) CREATE TABLE class_of_service ( booking_class, rank, class_description ) CREATE TABLE airline ( airline_code, airline_name, note ) CREATE TABLE month ( month_number, month_name ) CREATE TABLE days ( days_code, day_name ) CREATE TABLE flight_fare ( flight_id, fare_id ) CREATE TABLE food_service ( meal_code, meal_number, compartment, meal_description ) CREATE TABLE flight_stop ( flight_id, stop_number, stop_days, stop_airport, arrival_time, arrival_airline, arrival_flight_number, departure_time, departure_airline, departure_flight_number, stop_time ) CREATE TABLE city ( city_code, city_name, state_code, country_name, time_zone_code ) CREATE TABLE flight ( aircraft_code_sequence, airline_code, airline_flight, arrival_time, connections, departure_time, dual_carrier, flight_days, flight_id, flight_number, from_airport, meal_code, stops, time_elapsed, to_airport ) CREATE TABLE restriction ( restriction_code, advance_purchase, stopovers, saturday_stay_required, minimum_stay, maximum_stay, application, no_discounts ) CREATE TABLE ground_service ( city_code, airport_code, transport_type, ground_fare ) CREATE TABLE date_day ( month_number, day_number, year, day_name ) CREATE TABLE flight_leg ( flight_id, leg_number, leg_flight ) CREATE TABLE fare ( fare_id, from_airport, to_airport, fare_basis_code, fare_airline, restriction_code, one_direction_cost, round_trip_cost, round_trip_required ) CREATE TABLE airport ( airport_code, airport_name, airport_location, state_code, country_name, time_zone_code, minimum_connect_time ) CREATE TABLE state ( state_code, state_name, country_name ) CREATE TABLE time_zone ( time_zone_code, time_zone_name, hours_from_gmt ) CREATE TABLE fare_basis ( fare_basis_code, booking_class, class_type, premium, economy, discounted, night, season, basis_days ) CREATE TABLE time_interval ( period, begin_time, end_time ) CREATE TABLE code_description ( code, description ) CREATE TABLE equipment_sequence ( aircraft_code_sequence, aircraft_code ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which airlines fly from BOSTON to WASHINGTON SELECT### Response: SELECT DISTINCT airline.airline_code FROM airline, 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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHINGTON' AND flight.airline_code = airline.airline_code AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE restaurant ( id, name, food_type, city_name, rating ) CREATE TABLE geographic ( city_name, county, region ) CREATE TABLE location ( restaurant_id, house_number, street_name, city_name ) -- Using valid SQLite, answer the following questions for the tables provided above. -- where is a good arabic in mountain view ? SELECT### Response: SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'mountain view' AND restaurant.food_type = 'arabic' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE program ( program_id, name, college, introduction ) CREATE TABLE course_prerequisite ( pre_course_id, course_id ) CREATE TABLE comment_instructor ( instructor_id, student_id, score, comment_text ) CREATE TABLE instructor ( instructor_id, name, uniqname ) CREATE TABLE requirement ( requirement_id, requirement, college ) CREATE TABLE gsi ( course_offering_id, student_id ) CREATE TABLE semester ( semester_id, semester, year ) CREATE TABLE program_course ( program_id, course_id, workload, category ) CREATE TABLE program_requirement ( program_id, category, min_credit, additional_req ) CREATE TABLE student_record ( student_id, course_id, semester, grade, how, transfer_source, earn_credit, repeat_term, test_id ) CREATE TABLE jobs ( job_id, job_title, description, requirement, city, state, country, zip ) CREATE TABLE ta ( campus_job_id, student_id, location ) CREATE TABLE student ( student_id, lastname, firstname, program_id, declare_major, total_credit, total_gpa, entered_as, admit_term, predicted_graduation_semester, degree, minor, internship ) CREATE TABLE course_offering ( offering_id, course_id, semester, section_number, start_time, end_time, monday, tuesday, wednesday, thursday, friday, saturday, sunday, has_final_project, has_final_exam, textbook, class_address, allow_audit ) CREATE TABLE course ( course_id, name, department, number, credits, advisory_requirement, enforced_requirement, description, num_semesters, num_enrolled, has_discussion, has_lab, has_projects, has_exams, num_reviews, clarity_score, easiness_score, helpfulness_score ) CREATE TABLE offering_instructor ( offering_instructor_id, offering_id, instructor_id ) CREATE TABLE course_tags_count ( course_id, clear_grading, pop_quiz, group_projects, inspirational, long_lectures, extra_credit, few_tests, good_feedback, tough_tests, heavy_papers, cares_for_students, heavy_assignments, respected, participation, heavy_reading, tough_grader, hilarious, would_take_again, good_lecture, no_skip ) CREATE TABLE area ( course_id, area ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Last time she taught it , did Prof. Mijin Yoon set an exam for 181 ? SELECT### Response: SELECT DISTINCT course_offering.has_final_exam FROM course_offering INNER JOIN course ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE course_offering.semester = (SELECT MAX(SEMESTERalias0.semester_id) FROM semester AS SEMESTERalias0 INNER JOIN course_offering AS COURSE_OFFERINGalias1 ON SEMESTERalias0.semester_id = COURSE_OFFERINGalias1.semester INNER JOIN course AS COURSEalias1 ON COURSEalias1.course_id = COURSE_OFFERINGalias1.course_id INNER JOIN offering_instructor AS OFFERING_INSTRUCTORalias1 ON OFFERING_INSTRUCTORalias1.offering_id = COURSE_OFFERINGalias1.offering_id INNER JOIN instructor AS INSTRUCTORalias1 ON OFFERING_INSTRUCTORalias1.instructor_id = INSTRUCTORalias1.instructor_id WHERE COURSEalias1.department = 'EECS' AND COURSEalias1.number = 181 AND INSTRUCTORalias1.name LIKE '%Mijin Yoon%' AND SEMESTERalias0.year < 2016) AND course.department = 'EECS' AND course.number = 181 AND instructor.name LIKE '%Mijin Yoon%'.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE days ( days_code, day_name ) CREATE TABLE flight_stop ( flight_id, stop_number, stop_days, stop_airport, arrival_time, arrival_airline, arrival_flight_number, departure_time, departure_airline, departure_flight_number, stop_time ) CREATE TABLE aircraft ( aircraft_code, aircraft_description, manufacturer, basic_type, engines, propulsion, wide_body, wing_span, length, weight, capacity, pay_load, cruising_speed, range_miles, pressurized ) CREATE TABLE dual_carrier ( main_airline, low_flight_number, high_flight_number, dual_airline, service_name ) CREATE TABLE fare_basis ( fare_basis_code, booking_class, class_type, premium, economy, discounted, night, season, basis_days ) CREATE TABLE ground_service ( city_code, airport_code, transport_type, ground_fare ) CREATE TABLE class_of_service ( booking_class, rank, class_description ) CREATE TABLE restriction ( restriction_code, advance_purchase, stopovers, saturday_stay_required, minimum_stay, maximum_stay, application, no_discounts ) CREATE TABLE code_description ( code, description ) CREATE TABLE airline ( airline_code, airline_name, note ) CREATE TABLE fare ( fare_id, from_airport, to_airport, fare_basis_code, fare_airline, restriction_code, one_direction_cost, round_trip_cost, round_trip_required ) CREATE TABLE flight_fare ( flight_id, fare_id ) CREATE TABLE month ( month_number, month_name ) CREATE TABLE compartment_class ( compartment, class_type ) CREATE TABLE state ( state_code, state_name, country_name ) CREATE TABLE airport_service ( city_code, airport_code, miles_distant, direction, minutes_distant ) CREATE TABLE airport ( airport_code, airport_name, airport_location, state_code, country_name, time_zone_code, minimum_connect_time ) CREATE TABLE flight_leg ( flight_id, leg_number, leg_flight ) CREATE TABLE food_service ( meal_code, meal_number, compartment, meal_description ) CREATE TABLE time_zone ( time_zone_code, time_zone_name, hours_from_gmt ) CREATE TABLE time_interval ( period, begin_time, end_time ) CREATE TABLE flight ( aircraft_code_sequence, airline_code, airline_flight, arrival_time, connections, departure_time, dual_carrier, flight_days, flight_id, flight_number, from_airport, meal_code, stops, time_elapsed, to_airport ) CREATE TABLE date_day ( month_number, day_number, year, day_name ) CREATE TABLE equipment_sequence ( aircraft_code_sequence, aircraft_code ) CREATE TABLE city ( city_code, city_name, state_code, country_name, time_zone_code ) -- Using valid SQLite, answer the following questions for the tables provided above. -- list the airports in LOS ANGELES SELECT### Response: SELECT DISTINCT airport.airport_code FROM airport, airport_service, city WHERE airport.airport_code = airport_service.airport_code AND city.city_code = airport_service.city_code AND city.city_name = 'LOS ANGELES'.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE area ( course_id, area ) CREATE TABLE gsi ( course_offering_id, student_id ) CREATE TABLE course_offering ( offering_id, course_id, semester, section_number, start_time, end_time, monday, tuesday, wednesday, thursday, friday, saturday, sunday, has_final_project, has_final_exam, textbook, class_address, allow_audit ) CREATE TABLE course_tags_count ( course_id, clear_grading, pop_quiz, group_projects, inspirational, long_lectures, extra_credit, few_tests, good_feedback, tough_tests, heavy_papers, cares_for_students, heavy_assignments, respected, participation, heavy_reading, tough_grader, hilarious, would_take_again, good_lecture, no_skip ) CREATE TABLE program ( program_id, name, college, introduction ) CREATE TABLE program_course ( program_id, course_id, workload, category ) CREATE TABLE requirement ( requirement_id, requirement, college ) CREATE TABLE student_record ( student_id, course_id, semester, grade, how, transfer_source, earn_credit, repeat_term, test_id ) CREATE TABLE instructor ( instructor_id, name, uniqname ) CREATE TABLE student ( student_id, lastname, firstname, program_id, declare_major, total_credit, total_gpa, entered_as, admit_term, predicted_graduation_semester, degree, minor, internship ) CREATE TABLE course_prerequisite ( pre_course_id, course_id ) CREATE TABLE offering_instructor ( offering_instructor_id, offering_id, instructor_id ) CREATE TABLE ta ( campus_job_id, student_id, location ) CREATE TABLE course ( course_id, name, department, number, credits, advisory_requirement, enforced_requirement, description, num_semesters, num_enrolled, has_discussion, has_lab, has_projects, has_exams, num_reviews, clarity_score, easiness_score, helpfulness_score ) CREATE TABLE comment_instructor ( instructor_id, student_id, score, comment_text ) CREATE TABLE program_requirement ( program_id, category, min_credit, additional_req ) CREATE TABLE jobs ( job_id, job_title, description, requirement, city, state, country, zip ) CREATE TABLE semester ( semester_id, semester, year ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who are upper-level classes taught by ? SELECT### Response: SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE program_course.category LIKE '%ULCS%'.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE class_of_service ( booking_class, rank, class_description ) CREATE TABLE airport ( airport_code, airport_name, airport_location, state_code, country_name, time_zone_code, minimum_connect_time ) CREATE TABLE time_zone ( time_zone_code, time_zone_name, hours_from_gmt ) CREATE TABLE airport_service ( city_code, airport_code, miles_distant, direction, minutes_distant ) CREATE TABLE city ( city_code, city_name, state_code, country_name, time_zone_code ) CREATE TABLE aircraft ( aircraft_code, aircraft_description, manufacturer, basic_type, engines, propulsion, wide_body, wing_span, length, weight, capacity, pay_load, cruising_speed, range_miles, pressurized ) CREATE TABLE code_description ( code, description ) CREATE TABLE food_service ( meal_code, meal_number, compartment, meal_description ) CREATE TABLE days ( days_code, day_name ) CREATE TABLE fare ( fare_id, from_airport, to_airport, fare_basis_code, fare_airline, restriction_code, one_direction_cost, round_trip_cost, round_trip_required ) CREATE TABLE restriction ( restriction_code, advance_purchase, stopovers, saturday_stay_required, minimum_stay, maximum_stay, application, no_discounts ) CREATE TABLE state ( state_code, state_name, country_name ) CREATE TABLE date_day ( month_number, day_number, year, day_name ) CREATE TABLE flight_fare ( flight_id, fare_id ) CREATE TABLE flight ( aircraft_code_sequence, airline_code, airline_flight, arrival_time, connections, departure_time, dual_carrier, flight_days, flight_id, flight_number, from_airport, meal_code, stops, time_elapsed, to_airport ) CREATE TABLE airline ( airline_code, airline_name, note ) CREATE TABLE dual_carrier ( main_airline, low_flight_number, high_flight_number, dual_airline, service_name ) CREATE TABLE flight_stop ( flight_id, stop_number, stop_days, stop_airport, arrival_time, arrival_airline, arrival_flight_number, departure_time, departure_airline, departure_flight_number, stop_time ) CREATE TABLE compartment_class ( compartment, class_type ) CREATE TABLE fare_basis ( fare_basis_code, booking_class, class_type, premium, economy, discounted, night, season, basis_days ) CREATE TABLE month ( month_number, month_name ) CREATE TABLE time_interval ( period, begin_time, end_time ) CREATE TABLE equipment_sequence ( aircraft_code_sequence, aircraft_code ) CREATE TABLE ground_service ( city_code, airport_code, transport_type, ground_fare ) CREATE TABLE flight_leg ( flight_id, leg_number, leg_flight ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what are the cities served by DL SELECT### Response: SELECT DISTINCT city.city_code FROM airport_service, city, flight WHERE city.city_code = airport_service.city_code AND flight.airline_code = 'DL' AND flight.from_airport = airport_service.airport_code.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE area ( course_id, area ) CREATE TABLE course_prerequisite ( pre_course_id, course_id ) CREATE TABLE student ( student_id, lastname, firstname, program_id, declare_major, total_credit, total_gpa, entered_as, admit_term, predicted_graduation_semester, degree, minor, internship ) CREATE TABLE course ( course_id, name, department, number, credits, advisory_requirement, enforced_requirement, description, num_semesters, num_enrolled, has_discussion, has_lab, has_projects, has_exams, num_reviews, clarity_score, easiness_score, helpfulness_score ) CREATE TABLE semester ( semester_id, semester, year ) CREATE TABLE jobs ( job_id, job_title, description, requirement, city, state, country, zip ) CREATE TABLE offering_instructor ( offering_instructor_id, offering_id, instructor_id ) CREATE TABLE program ( program_id, name, college, introduction ) CREATE TABLE instructor ( instructor_id, name, uniqname ) CREATE TABLE ta ( campus_job_id, student_id, location ) CREATE TABLE gsi ( course_offering_id, student_id ) CREATE TABLE requirement ( requirement_id, requirement, college ) CREATE TABLE course_tags_count ( course_id, clear_grading, pop_quiz, group_projects, inspirational, long_lectures, extra_credit, few_tests, good_feedback, tough_tests, heavy_papers, cares_for_students, heavy_assignments, respected, participation, heavy_reading, tough_grader, hilarious, would_take_again, good_lecture, no_skip ) CREATE TABLE course_offering ( offering_id, course_id, semester, section_number, start_time, end_time, monday, tuesday, wednesday, thursday, friday, saturday, sunday, has_final_project, has_final_exam, textbook, class_address, allow_audit ) CREATE TABLE comment_instructor ( instructor_id, student_id, score, comment_text ) CREATE TABLE program_course ( program_id, course_id, workload, category ) CREATE TABLE program_requirement ( program_id, category, min_credit, additional_req ) CREATE TABLE student_record ( student_id, course_id, semester, grade, how, transfer_source, earn_credit, repeat_term, test_id ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When comparing to ARTDES 182 , is ARTDES 181 more difficult ? SELECT### Response: SELECT COUNT(*) > 0 FROM course AS COURSE_0, course AS COURSE_1, program_course AS PROGRAM_COURSE_0, program_course AS PROGRAM_COURSE_1 WHERE COURSE_0.department = 'ARTDES' AND COURSE_0.number = 181 AND COURSE_1.department = 'ARTDES' AND COURSE_1.number = 182 AND PROGRAM_COURSE_0.course_id = COURSE_0.course_id AND PROGRAM_COURSE_0.workload < PROGRAM_COURSE_1.workload AND PROGRAM_COURSE_1.course_id = COURSE_1.course_id.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE airline ( airline_code, airline_name, note ) CREATE TABLE equipment_sequence ( aircraft_code_sequence, aircraft_code ) CREATE TABLE flight_fare ( flight_id, fare_id ) CREATE TABLE month ( month_number, month_name ) CREATE TABLE city ( city_code, city_name, state_code, country_name, time_zone_code ) CREATE TABLE aircraft ( aircraft_code, aircraft_description, manufacturer, basic_type, engines, propulsion, wide_body, wing_span, length, weight, capacity, pay_load, cruising_speed, range_miles, pressurized ) CREATE TABLE days ( days_code, day_name ) CREATE TABLE airport_service ( city_code, airport_code, miles_distant, direction, minutes_distant ) CREATE TABLE class_of_service ( booking_class, rank, class_description ) CREATE TABLE fare_basis ( fare_basis_code, booking_class, class_type, premium, economy, discounted, night, season, basis_days ) CREATE TABLE food_service ( meal_code, meal_number, compartment, meal_description ) CREATE TABLE ground_service ( city_code, airport_code, transport_type, ground_fare ) CREATE TABLE flight_leg ( flight_id, leg_number, leg_flight ) CREATE TABLE restriction ( restriction_code, advance_purchase, stopovers, saturday_stay_required, minimum_stay, maximum_stay, application, no_discounts ) CREATE TABLE flight_stop ( flight_id, stop_number, stop_days, stop_airport, arrival_time, arrival_airline, arrival_flight_number, departure_time, departure_airline, departure_flight_number, stop_time ) CREATE TABLE airport ( airport_code, airport_name, airport_location, state_code, country_name, time_zone_code, minimum_connect_time ) CREATE TABLE state ( state_code, state_name, country_name ) CREATE TABLE date_day ( month_number, day_number, year, day_name ) CREATE TABLE code_description ( code, description ) CREATE TABLE flight ( aircraft_code_sequence, airline_code, airline_flight, arrival_time, connections, departure_time, dual_carrier, flight_days, flight_id, flight_number, from_airport, meal_code, stops, time_elapsed, to_airport ) CREATE TABLE time_interval ( period, begin_time, end_time ) CREATE TABLE dual_carrier ( main_airline, low_flight_number, high_flight_number, dual_airline, service_name ) CREATE TABLE time_zone ( time_zone_code, time_zone_name, hours_from_gmt ) CREATE TABLE fare ( fare_id, from_airport, to_airport, fare_basis_code, fare_airline, restriction_code, one_direction_cost, round_trip_cost, round_trip_required ) CREATE TABLE compartment_class ( compartment, class_type ) -- Using valid SQLite, answer the following questions for the tables provided above. -- all round trip flights between NEW YORK and MIAMI that are FIRST class SELECT### Response: 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, fare, fare_basis, flight, flight_fare WHERE ((fare_basis.class_type = 'FIRST' AND fare.fare_basis_code = fare_basis.fare_basis_code) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MIAMI' AND NOT fare.round_trip_cost IS NULL AND flight_fare.fare_id = fare.fare_id AND flight.flight_id = flight_fare.flight_id AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'NEW YORK' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE month ( month_number, month_name ) CREATE TABLE flight_leg ( flight_id, leg_number, leg_flight ) CREATE TABLE city ( city_code, city_name, state_code, country_name, time_zone_code ) CREATE TABLE class_of_service ( booking_class, rank, class_description ) CREATE TABLE airport_service ( city_code, airport_code, miles_distant, direction, minutes_distant ) CREATE TABLE dual_carrier ( main_airline, low_flight_number, high_flight_number, dual_airline, service_name ) CREATE TABLE compartment_class ( compartment, class_type ) CREATE TABLE code_description ( code, description ) CREATE TABLE state ( state_code, state_name, country_name ) CREATE TABLE time_zone ( time_zone_code, time_zone_name, hours_from_gmt ) CREATE TABLE date_day ( month_number, day_number, year, day_name ) CREATE TABLE food_service ( meal_code, meal_number, compartment, meal_description ) CREATE TABLE flight_fare ( flight_id, fare_id ) CREATE TABLE time_interval ( period, begin_time, end_time ) CREATE TABLE fare_basis ( fare_basis_code, booking_class, class_type, premium, economy, discounted, night, season, basis_days ) CREATE TABLE flight_stop ( flight_id, stop_number, stop_days, stop_airport, arrival_time, arrival_airline, arrival_flight_number, departure_time, departure_airline, departure_flight_number, stop_time ) CREATE TABLE fare ( fare_id, from_airport, to_airport, fare_basis_code, fare_airline, restriction_code, one_direction_cost, round_trip_cost, round_trip_required ) CREATE TABLE airport ( airport_code, airport_name, airport_location, state_code, country_name, time_zone_code, minimum_connect_time ) CREATE TABLE airline ( airline_code, airline_name, note ) CREATE TABLE flight ( aircraft_code_sequence, airline_code, airline_flight, arrival_time, connections, departure_time, dual_carrier, flight_days, flight_id, flight_number, from_airport, meal_code, stops, time_elapsed, to_airport ) CREATE TABLE aircraft ( aircraft_code, aircraft_description, manufacturer, basic_type, engines, propulsion, wide_body, wing_span, length, weight, capacity, pay_load, cruising_speed, range_miles, pressurized ) CREATE TABLE equipment_sequence ( aircraft_code_sequence, aircraft_code ) CREATE TABLE ground_service ( city_code, airport_code, transport_type, ground_fare ) CREATE TABLE restriction ( restriction_code, advance_purchase, stopovers, saturday_stay_required, minimum_stay, maximum_stay, application, no_discounts ) CREATE TABLE days ( days_code, day_name ) -- Using valid SQLite, answer the following questions for the tables provided above. -- of the flights available from DALLAS to BALTIMORE on 8 3 which airline has the least expensive flight SELECT### Response: SELECT DISTINCT airline.airline_code FROM airline, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, fare, flight, flight_fare WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND date_day.day_number = 3 AND date_day.month_number = 8 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DALLAS' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code) AND fare.one_direction_cost = (SELECT MIN(FAREalias1.one_direction_cost) FROM airport_service AS AIRPORT_SERVICEalias2, airport_service AS AIRPORT_SERVICEalias3, city AS CITYalias2, city AS CITYalias3, date_day AS DATE_DAYalias1, days AS DAYSalias1, fare AS FAREalias1, flight AS FLIGHTalias1, flight_fare AS FLIGHT_FAREalias1 WHERE (CITYalias3.city_code = AIRPORT_SERVICEalias3.city_code AND CITYalias3.city_name = 'BALTIMORE' AND DATE_DAYalias1.day_number = 3 AND DATE_DAYalias1.month_number = 8 AND DATE_DAYalias1.year = 1991 AND DAYSalias1.day_name = DATE_DAYalias1.day_name AND FLIGHTalias1.flight_days = DAYSalias1.days_code AND FLIGHTalias1.to_airport = AIRPORT_SERVICEalias3.airport_code) AND CITYalias2.city_code = AIRPORT_SERVICEalias2.city_code AND CITYalias2.city_name = 'DALLAS' AND FLIGHT_FAREalias1.fare_id = FAREalias1.fare_id AND FLIGHTalias1.flight_id = FLIGHT_FAREalias1.flight_id AND FLIGHTalias1.from_airport = AIRPORT_SERVICEalias2.airport_code) AND flight_fare.fare_id = fare.fare_id AND flight.airline_code = airline.airline_code AND flight.flight_id = flight_fare.flight_id.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE ta ( campus_job_id, student_id, location ) CREATE TABLE course_tags_count ( course_id, clear_grading, pop_quiz, group_projects, inspirational, long_lectures, extra_credit, few_tests, good_feedback, tough_tests, heavy_papers, cares_for_students, heavy_assignments, respected, participation, heavy_reading, tough_grader, hilarious, would_take_again, good_lecture, no_skip ) CREATE TABLE instructor ( instructor_id, name, uniqname ) CREATE TABLE program_course ( program_id, course_id, workload, category ) CREATE TABLE jobs ( job_id, job_title, description, requirement, city, state, country, zip ) CREATE TABLE requirement ( requirement_id, requirement, college ) CREATE TABLE course_offering ( offering_id, course_id, semester, section_number, start_time, end_time, monday, tuesday, wednesday, thursday, friday, saturday, sunday, has_final_project, has_final_exam, textbook, class_address, allow_audit ) CREATE TABLE gsi ( course_offering_id, student_id ) CREATE TABLE semester ( semester_id, semester, year ) CREATE TABLE program ( program_id, name, college, introduction ) CREATE TABLE offering_instructor ( offering_instructor_id, offering_id, instructor_id ) CREATE TABLE student_record ( student_id, course_id, semester, grade, how, transfer_source, earn_credit, repeat_term, test_id ) CREATE TABLE student ( student_id, lastname, firstname, program_id, declare_major, total_credit, total_gpa, entered_as, admit_term, predicted_graduation_semester, degree, minor, internship ) CREATE TABLE course_prerequisite ( pre_course_id, course_id ) CREATE TABLE area ( course_id, area ) CREATE TABLE comment_instructor ( instructor_id, student_id, score, comment_text ) CREATE TABLE program_requirement ( program_id, category, min_credit, additional_req ) CREATE TABLE course ( course_id, name, department, number, credits, advisory_requirement, enforced_requirement, description, num_semesters, num_enrolled, has_discussion, has_lab, has_projects, has_exams, num_reviews, clarity_score, easiness_score, helpfulness_score ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Are there any 16 -credit SM classes ? SELECT### Response: SELECT DISTINCT name, number FROM course WHERE department = 'SM' AND credits = 16.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE road ( road_name, state_name ) CREATE TABLE border_info ( state_name, border ) CREATE TABLE river ( river_name, length, traverse, country_name ) CREATE TABLE state ( state_name, capital, population, area, country_name, density ) CREATE TABLE highlow ( state_name, highest_point, highest_elevation, lowest_point, lowest_elevation ) CREATE TABLE city ( city_name, state_name, population, country_name ) CREATE TABLE lake ( lake_name, area, state_name, country_name ) CREATE TABLE mountain ( mountain_name, mountain_altitude, state_name, country_name ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the capital of the state with the highest point SELECT### Response: SELECT state.capital FROM highlow, state WHERE highlow.highest_elevation = (SELECT MAX(HIGHLOWalias1.highest_elevation) FROM highlow AS HIGHLOWalias1) AND state.state_name = highlow.state_name.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE ta ( campus_job_id, student_id, location ) CREATE TABLE instructor ( instructor_id, name, uniqname ) CREATE TABLE course_offering ( offering_id, course_id, semester, section_number, start_time, end_time, monday, tuesday, wednesday, thursday, friday, saturday, sunday, has_final_project, has_final_exam, textbook, class_address, allow_audit ) CREATE TABLE requirement ( requirement_id, requirement, college ) CREATE TABLE student_record ( student_id, course_id, semester, grade, how, transfer_source, earn_credit, repeat_term, test_id ) CREATE TABLE comment_instructor ( instructor_id, student_id, score, comment_text ) CREATE TABLE course_tags_count ( course_id, clear_grading, pop_quiz, group_projects, inspirational, long_lectures, extra_credit, few_tests, good_feedback, tough_tests, heavy_papers, cares_for_students, heavy_assignments, respected, participation, heavy_reading, tough_grader, hilarious, would_take_again, good_lecture, no_skip ) CREATE TABLE jobs ( job_id, job_title, description, requirement, city, state, country, zip ) CREATE TABLE course ( course_id, name, department, number, credits, advisory_requirement, enforced_requirement, description, num_semesters, num_enrolled, has_discussion, has_lab, has_projects, has_exams, num_reviews, clarity_score, easiness_score, helpfulness_score ) CREATE TABLE program ( program_id, name, college, introduction ) CREATE TABLE offering_instructor ( offering_instructor_id, offering_id, instructor_id ) CREATE TABLE student ( student_id, lastname, firstname, program_id, declare_major, total_credit, total_gpa, entered_as, admit_term, predicted_graduation_semester, degree, minor, internship ) CREATE TABLE semester ( semester_id, semester, year ) CREATE TABLE course_prerequisite ( pre_course_id, course_id ) CREATE TABLE program_requirement ( program_id, category, min_credit, additional_req ) CREATE TABLE gsi ( course_offering_id, student_id ) CREATE TABLE area ( course_id, area ) CREATE TABLE program_course ( program_id, course_id, workload, category ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How frequently does the class meet for MEMS 333 ? SELECT### Response: SELECT DISTINCT course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'MEMS' AND course.number = 333 AND semester.semester = 'WN' AND semester.year = 2016.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE fare ( fare_id, from_airport, to_airport, fare_basis_code, fare_airline, restriction_code, one_direction_cost, round_trip_cost, round_trip_required ) CREATE TABLE time_zone ( time_zone_code, time_zone_name, hours_from_gmt ) CREATE TABLE flight_stop ( flight_id, stop_number, stop_days, stop_airport, arrival_time, arrival_airline, arrival_flight_number, departure_time, departure_airline, departure_flight_number, stop_time ) CREATE TABLE compartment_class ( compartment, class_type ) CREATE TABLE state ( state_code, state_name, country_name ) CREATE TABLE equipment_sequence ( aircraft_code_sequence, aircraft_code ) CREATE TABLE time_interval ( period, begin_time, end_time ) CREATE TABLE restriction ( restriction_code, advance_purchase, stopovers, saturday_stay_required, minimum_stay, maximum_stay, application, no_discounts ) CREATE TABLE aircraft ( aircraft_code, aircraft_description, manufacturer, basic_type, engines, propulsion, wide_body, wing_span, length, weight, capacity, pay_load, cruising_speed, range_miles, pressurized ) CREATE TABLE airport_service ( city_code, airport_code, miles_distant, direction, minutes_distant ) CREATE TABLE flight ( aircraft_code_sequence, airline_code, airline_flight, arrival_time, connections, departure_time, dual_carrier, flight_days, flight_id, flight_number, from_airport, meal_code, stops, time_elapsed, to_airport ) CREATE TABLE airport ( airport_code, airport_name, airport_location, state_code, country_name, time_zone_code, minimum_connect_time ) CREATE TABLE flight_fare ( flight_id, fare_id ) CREATE TABLE days ( days_code, day_name ) CREATE TABLE dual_carrier ( main_airline, low_flight_number, high_flight_number, dual_airline, service_name ) CREATE TABLE fare_basis ( fare_basis_code, booking_class, class_type, premium, economy, discounted, night, season, basis_days ) CREATE TABLE ground_service ( city_code, airport_code, transport_type, ground_fare ) CREATE TABLE date_day ( month_number, day_number, year, day_name ) CREATE TABLE food_service ( meal_code, meal_number, compartment, meal_description ) CREATE TABLE city ( city_code, city_name, state_code, country_name, time_zone_code ) CREATE TABLE code_description ( code, description ) CREATE TABLE month ( month_number, month_name ) CREATE TABLE class_of_service ( booking_class, rank, class_description ) CREATE TABLE airline ( airline_code, airline_name, note ) CREATE TABLE flight_leg ( flight_id, leg_number, leg_flight ) -- Using valid SQLite, answer the following questions for the tables provided above. -- show me a list of all the airlines that offer BUSINESS class service SELECT### Response: SELECT DISTINCT airline.airline_code FROM airline, fare, fare_basis, flight, flight_fare WHERE fare_basis.class_type = 'BUSINESS' AND fare.fare_basis_code = fare_basis.fare_basis_code AND flight_fare.fare_id = fare.fare_id AND flight.airline_code = airline.airline_code AND flight.flight_id = flight_fare.flight_id.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE city ( city_code, city_name, state_code, country_name, time_zone_code ) CREATE TABLE flight_stop ( flight_id, stop_number, stop_days, stop_airport, arrival_time, arrival_airline, arrival_flight_number, departure_time, departure_airline, departure_flight_number, stop_time ) CREATE TABLE state ( state_code, state_name, country_name ) CREATE TABLE class_of_service ( booking_class, rank, class_description ) CREATE TABLE month ( month_number, month_name ) CREATE TABLE dual_carrier ( main_airline, low_flight_number, high_flight_number, dual_airline, service_name ) CREATE TABLE date_day ( month_number, day_number, year, day_name ) CREATE TABLE fare_basis ( fare_basis_code, booking_class, class_type, premium, economy, discounted, night, season, basis_days ) CREATE TABLE compartment_class ( compartment, class_type ) CREATE TABLE days ( days_code, day_name ) CREATE TABLE airport ( airport_code, airport_name, airport_location, state_code, country_name, time_zone_code, minimum_connect_time ) CREATE TABLE flight_leg ( flight_id, leg_number, leg_flight ) CREATE TABLE time_interval ( period, begin_time, end_time ) CREATE TABLE ground_service ( city_code, airport_code, transport_type, ground_fare ) CREATE TABLE time_zone ( time_zone_code, time_zone_name, hours_from_gmt ) CREATE TABLE food_service ( meal_code, meal_number, compartment, meal_description ) CREATE TABLE flight ( aircraft_code_sequence, airline_code, airline_flight, arrival_time, connections, departure_time, dual_carrier, flight_days, flight_id, flight_number, from_airport, meal_code, stops, time_elapsed, to_airport ) CREATE TABLE code_description ( code, description ) CREATE TABLE aircraft ( aircraft_code, aircraft_description, manufacturer, basic_type, engines, propulsion, wide_body, wing_span, length, weight, capacity, pay_load, cruising_speed, range_miles, pressurized ) CREATE TABLE airline ( airline_code, airline_name, note ) CREATE TABLE flight_fare ( flight_id, fare_id ) CREATE TABLE fare ( fare_id, from_airport, to_airport, fare_basis_code, fare_airline, restriction_code, one_direction_cost, round_trip_cost, round_trip_required ) CREATE TABLE restriction ( restriction_code, advance_purchase, stopovers, saturday_stay_required, minimum_stay, maximum_stay, application, no_discounts ) CREATE TABLE equipment_sequence ( aircraft_code_sequence, aircraft_code ) CREATE TABLE airport_service ( city_code, airport_code, miles_distant, direction, minutes_distant ) -- Using valid SQLite, answer the following questions for the tables provided above. -- show me the COACH fares from BALTIMORE to DALLAS SELECT### Response: SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, fare_basis, flight, flight_fare 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 = 'DALLAS' AND fare_basis.class_type = 'COACH' AND fare.fare_basis_code = fare_basis.fare_basis_code AND flight_fare.fare_id = fare.fare_id AND flight.flight_id = flight_fare.flight_id AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE category ( id, business_id, category_name ) CREATE TABLE tip ( tip_id, business_id, text, user_id, likes, year, month ) CREATE TABLE checkin ( cid, business_id, count, day ) CREATE TABLE business ( bid, business_id, name, full_address, city, latitude, longitude, review_count, is_open, rating, state ) CREATE TABLE review ( rid, business_id, user_id, rating, text, year, month ) CREATE TABLE neighborhood ( id, business_id, neighborhood_name ) CREATE TABLE user ( uid, user_id, name ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many businesses has Michelle reviewed in 2010 ? SELECT### Response: SELECT COUNT(DISTINCT (business.name)) FROM business, review, user WHERE review.business_id = business.business_id AND review.year = 2010 AND user.name = 'Michelle' AND user.user_id = review.user_id.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE requirement ( requirement_id, requirement, college ) CREATE TABLE instructor ( instructor_id, name, uniqname ) CREATE TABLE gsi ( course_offering_id, student_id ) CREATE TABLE program_requirement ( program_id, category, min_credit, additional_req ) CREATE TABLE course_prerequisite ( pre_course_id, course_id ) CREATE TABLE jobs ( job_id, job_title, description, requirement, city, state, country, zip ) CREATE TABLE program_course ( program_id, course_id, workload, category ) CREATE TABLE area ( course_id, area ) CREATE TABLE student_record ( student_id, course_id, semester, grade, how, transfer_source, earn_credit, repeat_term, test_id ) CREATE TABLE program ( program_id, name, college, introduction ) CREATE TABLE comment_instructor ( instructor_id, student_id, score, comment_text ) CREATE TABLE semester ( semester_id, semester, year ) CREATE TABLE course_offering ( offering_id, course_id, semester, section_number, start_time, end_time, monday, tuesday, wednesday, thursday, friday, saturday, sunday, has_final_project, has_final_exam, textbook, class_address, allow_audit ) CREATE TABLE ta ( campus_job_id, student_id, location ) CREATE TABLE course ( course_id, name, department, number, credits, advisory_requirement, enforced_requirement, description, num_semesters, num_enrolled, has_discussion, has_lab, has_projects, has_exams, num_reviews, clarity_score, easiness_score, helpfulness_score ) CREATE TABLE offering_instructor ( offering_instructor_id, offering_id, instructor_id ) CREATE TABLE course_tags_count ( course_id, clear_grading, pop_quiz, group_projects, inspirational, long_lectures, extra_credit, few_tests, good_feedback, tough_tests, heavy_papers, cares_for_students, heavy_assignments, respected, participation, heavy_reading, tough_grader, hilarious, would_take_again, good_lecture, no_skip ) CREATE TABLE student ( student_id, lastname, firstname, program_id, declare_major, total_credit, total_gpa, entered_as, admit_term, predicted_graduation_semester, degree, minor, internship ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What course would be the most difficult of the courses I 've taken ? SELECT### Response: SELECT DISTINCT course.department, course.name, course.number, program_course.workload FROM course INNER JOIN student_record ON student_record.course_id = course.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE program_course.workload = (SELECT MAX(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 INNER JOIN student_record AS STUDENT_RECORDalias1 ON STUDENT_RECORDalias1.course_id = PROGRAM_COURSEalias1.course_id WHERE STUDENT_RECORDalias1.student_id = 1) AND student_record.student_id = 1.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE month ( month_number, month_name ) CREATE TABLE compartment_class ( compartment, class_type ) CREATE TABLE flight ( aircraft_code_sequence, airline_code, airline_flight, arrival_time, connections, departure_time, dual_carrier, flight_days, flight_id, flight_number, from_airport, meal_code, stops, time_elapsed, to_airport ) CREATE TABLE flight_fare ( flight_id, fare_id ) CREATE TABLE class_of_service ( booking_class, rank, class_description ) CREATE TABLE days ( days_code, day_name ) CREATE TABLE aircraft ( aircraft_code, aircraft_description, manufacturer, basic_type, engines, propulsion, wide_body, wing_span, length, weight, capacity, pay_load, cruising_speed, range_miles, pressurized ) CREATE TABLE flight_leg ( flight_id, leg_number, leg_flight ) CREATE TABLE equipment_sequence ( aircraft_code_sequence, aircraft_code ) CREATE TABLE restriction ( restriction_code, advance_purchase, stopovers, saturday_stay_required, minimum_stay, maximum_stay, application, no_discounts ) CREATE TABLE food_service ( meal_code, meal_number, compartment, meal_description ) CREATE TABLE flight_stop ( flight_id, stop_number, stop_days, stop_airport, arrival_time, arrival_airline, arrival_flight_number, departure_time, departure_airline, departure_flight_number, stop_time ) CREATE TABLE ground_service ( city_code, airport_code, transport_type, ground_fare ) CREATE TABLE airport_service ( city_code, airport_code, miles_distant, direction, minutes_distant ) CREATE TABLE time_zone ( time_zone_code, time_zone_name, hours_from_gmt ) CREATE TABLE date_day ( month_number, day_number, year, day_name ) CREATE TABLE fare_basis ( fare_basis_code, booking_class, class_type, premium, economy, discounted, night, season, basis_days ) CREATE TABLE airline ( airline_code, airline_name, note ) CREATE TABLE time_interval ( period, begin_time, end_time ) CREATE TABLE code_description ( code, description ) CREATE TABLE city ( city_code, city_name, state_code, country_name, time_zone_code ) CREATE TABLE airport ( airport_code, airport_name, airport_location, state_code, country_name, time_zone_code, minimum_connect_time ) CREATE TABLE state ( state_code, state_name, country_name ) CREATE TABLE fare ( fare_id, from_airport, to_airport, fare_basis_code, fare_airline, restriction_code, one_direction_cost, round_trip_cost, round_trip_required ) CREATE TABLE dual_carrier ( main_airline, low_flight_number, high_flight_number, dual_airline, service_name ) -- Using valid SQLite, answer the following questions for the tables provided above. -- list flights and fares from TACOMA to ORLANDO round trip leaving saturday returning next saturday SELECT### Response: SELECT DISTINCT flight.flight_id FROM fare, flight, flight_fare WHERE (((flight.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 = 'TACOMA')) AND flight.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'))) OR (flight.from_airport IN (SELECT AIRPORT_SERVICEalias2.airport_code FROM airport_service AS AIRPORT_SERVICEalias2 WHERE AIRPORT_SERVICEalias2.city_code IN (SELECT CITYalias2.city_code FROM city AS CITYalias2 WHERE CITYalias2.city_name = 'ORLANDO')) AND flight.to_airport IN (SELECT AIRPORT_SERVICEalias3.airport_code FROM airport_service AS AIRPORT_SERVICEalias3 WHERE AIRPORT_SERVICEalias3.city_code IN (SELECT CITYalias3.city_code FROM city AS CITYalias3 WHERE CITYalias3.city_name = 'TACOMA')))) AND flight.flight_days IN (SELECT DAYSalias0.days_code FROM days AS DAYSalias0 WHERE DAYSalias0.day_name IN (SELECT DATE_DAYalias0.day_name FROM date_day AS DATE_DAYalias0 WHERE DATE_DAYalias0.day_number = 26 AND DATE_DAYalias0.month_number = 7 AND DATE_DAYalias0.year = 1991))) AND ((NOT fare.round_trip_cost IS NULL) AND fare.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 IN (SELECT DATE_DAYalias1.day_name FROM date_day AS DATE_DAYalias1 WHERE DATE_DAYalias1.day_number = 26 AND DATE_DAYalias1.month_number = 7 AND DATE_DAYalias1.year = 1991)))) AND flight_fare.fare_id = fare.fare_id AND flight.flight_id = flight_fare.flight_id.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE fare ( fare_id, from_airport, to_airport, fare_basis_code, fare_airline, restriction_code, one_direction_cost, round_trip_cost, round_trip_required ) CREATE TABLE aircraft ( aircraft_code, aircraft_description, manufacturer, basic_type, engines, propulsion, wide_body, wing_span, length, weight, capacity, pay_load, cruising_speed, range_miles, pressurized ) CREATE TABLE food_service ( meal_code, meal_number, compartment, meal_description ) CREATE TABLE days ( days_code, day_name ) CREATE TABLE date_day ( month_number, day_number, year, day_name ) CREATE TABLE flight_fare ( flight_id, fare_id ) CREATE TABLE class_of_service ( booking_class, rank, class_description ) CREATE TABLE equipment_sequence ( aircraft_code_sequence, aircraft_code ) CREATE TABLE airline ( airline_code, airline_name, note ) CREATE TABLE flight_leg ( flight_id, leg_number, leg_flight ) CREATE TABLE flight_stop ( flight_id, stop_number, stop_days, stop_airport, arrival_time, arrival_airline, arrival_flight_number, departure_time, departure_airline, departure_flight_number, stop_time ) CREATE TABLE restriction ( restriction_code, advance_purchase, stopovers, saturday_stay_required, minimum_stay, maximum_stay, application, no_discounts ) CREATE TABLE time_zone ( time_zone_code, time_zone_name, hours_from_gmt ) CREATE TABLE airport_service ( city_code, airport_code, miles_distant, direction, minutes_distant ) CREATE TABLE ground_service ( city_code, airport_code, transport_type, ground_fare ) CREATE TABLE flight ( aircraft_code_sequence, airline_code, airline_flight, arrival_time, connections, departure_time, dual_carrier, flight_days, flight_id, flight_number, from_airport, meal_code, stops, time_elapsed, to_airport ) CREATE TABLE month ( month_number, month_name ) CREATE TABLE compartment_class ( compartment, class_type ) CREATE TABLE state ( state_code, state_name, country_name ) CREATE TABLE code_description ( code, description ) CREATE TABLE fare_basis ( fare_basis_code, booking_class, class_type, premium, economy, discounted, night, season, basis_days ) CREATE TABLE dual_carrier ( main_airline, low_flight_number, high_flight_number, dual_airline, service_name ) CREATE TABLE city ( city_code, city_name, state_code, country_name, time_zone_code ) CREATE TABLE time_interval ( period, begin_time, end_time ) CREATE TABLE airport ( airport_code, airport_name, airport_location, state_code, country_name, time_zone_code, minimum_connect_time ) -- Using valid SQLite, answer the following questions for the tables provided above. -- display types of aircraft departing from CLEVELAND to DALLAS before 1200 SELECT### Response: SELECT DISTINCT aircraft.aircraft_code FROM aircraft, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, equipment_sequence, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS' AND flight.departure_time < 1200 AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'CLEVELAND' AND equipment_sequence.aircraft_code = aircraft.aircraft_code AND flight.aircraft_code_sequence = equipment_sequence.aircraft_code_sequence AND flight.from_airport = AIRPORT_SERVICE_0.airport_code.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE flight_fare ( flight_id, fare_id ) CREATE TABLE food_service ( meal_code, meal_number, compartment, meal_description ) CREATE TABLE equipment_sequence ( aircraft_code_sequence, aircraft_code ) CREATE TABLE flight_leg ( flight_id, leg_number, leg_flight ) CREATE TABLE state ( state_code, state_name, country_name ) CREATE TABLE flight_stop ( flight_id, stop_number, stop_days, stop_airport, arrival_time, arrival_airline, arrival_flight_number, departure_time, departure_airline, departure_flight_number, stop_time ) CREATE TABLE aircraft ( aircraft_code, aircraft_description, manufacturer, basic_type, engines, propulsion, wide_body, wing_span, length, weight, capacity, pay_load, cruising_speed, range_miles, pressurized ) CREATE TABLE restriction ( restriction_code, advance_purchase, stopovers, saturday_stay_required, minimum_stay, maximum_stay, application, no_discounts ) CREATE TABLE compartment_class ( compartment, class_type ) CREATE TABLE month ( month_number, month_name ) CREATE TABLE time_interval ( period, begin_time, end_time ) CREATE TABLE date_day ( month_number, day_number, year, day_name ) CREATE TABLE airline ( airline_code, airline_name, note ) CREATE TABLE class_of_service ( booking_class, rank, class_description ) CREATE TABLE code_description ( code, description ) CREATE TABLE dual_carrier ( main_airline, low_flight_number, high_flight_number, dual_airline, service_name ) CREATE TABLE city ( city_code, city_name, state_code, country_name, time_zone_code ) CREATE TABLE flight ( aircraft_code_sequence, airline_code, airline_flight, arrival_time, connections, departure_time, dual_carrier, flight_days, flight_id, flight_number, from_airport, meal_code, stops, time_elapsed, to_airport ) CREATE TABLE airport_service ( city_code, airport_code, miles_distant, direction, minutes_distant ) CREATE TABLE fare_basis ( fare_basis_code, booking_class, class_type, premium, economy, discounted, night, season, basis_days ) CREATE TABLE time_zone ( time_zone_code, time_zone_name, hours_from_gmt ) CREATE TABLE ground_service ( city_code, airport_code, transport_type, ground_fare ) CREATE TABLE days ( days_code, day_name ) CREATE TABLE fare ( fare_id, from_airport, to_airport, fare_basis_code, fare_airline, restriction_code, one_direction_cost, round_trip_cost, round_trip_required ) CREATE TABLE airport ( airport_code, airport_name, airport_location, state_code, country_name, time_zone_code, minimum_connect_time ) -- Using valid SQLite, answer the following questions for the tables provided above. -- flights from DENVER to PITTSBURGH on thursday SELECT### Response: 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, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND date_day.day_number = 24 AND date_day.month_number = 5 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE class_of_service ( booking_class, rank, class_description ) CREATE TABLE airport_service ( city_code, airport_code, miles_distant, direction, minutes_distant ) CREATE TABLE aircraft ( aircraft_code, aircraft_description, manufacturer, basic_type, engines, propulsion, wide_body, wing_span, length, weight, capacity, pay_load, cruising_speed, range_miles, pressurized ) CREATE TABLE airline ( airline_code, airline_name, note ) CREATE TABLE equipment_sequence ( aircraft_code_sequence, aircraft_code ) CREATE TABLE fare ( fare_id, from_airport, to_airport, fare_basis_code, fare_airline, restriction_code, one_direction_cost, round_trip_cost, round_trip_required ) CREATE TABLE restriction ( restriction_code, advance_purchase, stopovers, saturday_stay_required, minimum_stay, maximum_stay, application, no_discounts ) CREATE TABLE flight_leg ( flight_id, leg_number, leg_flight ) CREATE TABLE dual_carrier ( main_airline, low_flight_number, high_flight_number, dual_airline, service_name ) CREATE TABLE code_description ( code, description ) CREATE TABLE compartment_class ( compartment, class_type ) CREATE TABLE month ( month_number, month_name ) CREATE TABLE city ( city_code, city_name, state_code, country_name, time_zone_code ) CREATE TABLE flight_stop ( flight_id, stop_number, stop_days, stop_airport, arrival_time, arrival_airline, arrival_flight_number, departure_time, departure_airline, departure_flight_number, stop_time ) CREATE TABLE airport ( airport_code, airport_name, airport_location, state_code, country_name, time_zone_code, minimum_connect_time ) CREATE TABLE ground_service ( city_code, airport_code, transport_type, ground_fare ) CREATE TABLE date_day ( month_number, day_number, year, day_name ) CREATE TABLE flight ( aircraft_code_sequence, airline_code, airline_flight, arrival_time, connections, departure_time, dual_carrier, flight_days, flight_id, flight_number, from_airport, meal_code, stops, time_elapsed, to_airport ) CREATE TABLE time_interval ( period, begin_time, end_time ) CREATE TABLE days ( days_code, day_name ) CREATE TABLE food_service ( meal_code, meal_number, compartment, meal_description ) CREATE TABLE time_zone ( time_zone_code, time_zone_name, hours_from_gmt ) CREATE TABLE fare_basis ( fare_basis_code, booking_class, class_type, premium, economy, discounted, night, season, basis_days ) CREATE TABLE state ( state_code, state_name, country_name ) CREATE TABLE flight_fare ( flight_id, fare_id ) -- Using valid SQLite, answer the following questions for the tables provided above. -- flights from WASHINGTON to SEATTLE SELECT### Response: 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 = 'WASHINGTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SEATTLE' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE restriction ( restriction_code, advance_purchase, stopovers, saturday_stay_required, minimum_stay, maximum_stay, application, no_discounts ) CREATE TABLE city ( city_code, city_name, state_code, country_name, time_zone_code ) CREATE TABLE aircraft ( aircraft_code, aircraft_description, manufacturer, basic_type, engines, propulsion, wide_body, wing_span, length, weight, capacity, pay_load, cruising_speed, range_miles, pressurized ) CREATE TABLE class_of_service ( booking_class, rank, class_description ) CREATE TABLE airline ( airline_code, airline_name, note ) CREATE TABLE flight_stop ( flight_id, stop_number, stop_days, stop_airport, arrival_time, arrival_airline, arrival_flight_number, departure_time, departure_airline, departure_flight_number, stop_time ) CREATE TABLE month ( month_number, month_name ) CREATE TABLE flight ( aircraft_code_sequence, airline_code, airline_flight, arrival_time, connections, departure_time, dual_carrier, flight_days, flight_id, flight_number, from_airport, meal_code, stops, time_elapsed, to_airport ) CREATE TABLE time_interval ( period, begin_time, end_time ) CREATE TABLE airport_service ( city_code, airport_code, miles_distant, direction, minutes_distant ) CREATE TABLE days ( days_code, day_name ) CREATE TABLE dual_carrier ( main_airline, low_flight_number, high_flight_number, dual_airline, service_name ) CREATE TABLE time_zone ( time_zone_code, time_zone_name, hours_from_gmt ) CREATE TABLE airport ( airport_code, airport_name, airport_location, state_code, country_name, time_zone_code, minimum_connect_time ) CREATE TABLE code_description ( code, description ) CREATE TABLE food_service ( meal_code, meal_number, compartment, meal_description ) CREATE TABLE date_day ( month_number, day_number, year, day_name ) CREATE TABLE ground_service ( city_code, airport_code, transport_type, ground_fare ) CREATE TABLE equipment_sequence ( aircraft_code_sequence, aircraft_code ) CREATE TABLE fare ( fare_id, from_airport, to_airport, fare_basis_code, fare_airline, restriction_code, one_direction_cost, round_trip_cost, round_trip_required ) CREATE TABLE state ( state_code, state_name, country_name ) CREATE TABLE flight_leg ( flight_id, leg_number, leg_flight ) CREATE TABLE compartment_class ( compartment, class_type ) CREATE TABLE flight_fare ( flight_id, fare_id ) CREATE TABLE fare_basis ( fare_basis_code, booking_class, class_type, premium, economy, discounted, night, season, basis_days ) -- Using valid SQLite, answer the following questions for the tables provided above. -- i'm looking for a flight from CHARLOTTE to LAS VEGAS that stops in ST. LOUIS hopefully a DINNER flight how can i find that out SELECT### Response: SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop, food_service WHERE ((CITY_2.city_code = AIRPORT_SERVICE_2.city_code AND CITY_2.city_name = 'ST. LOUIS' AND flight_stop.stop_airport = AIRPORT_SERVICE_2.airport_code AND flight.flight_id = flight_stop.flight_id AND food_service.meal_code = flight.meal_code AND food_service.meal_description = 'DINNER') AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LAS VEGAS' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'CHARLOTTE' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE jobs ( job_id, job_title, description, requirement, city, state, country, zip ) CREATE TABLE student_record ( student_id, course_id, semester, grade, how, transfer_source, earn_credit, repeat_term, test_id ) CREATE TABLE ta ( campus_job_id, student_id, location ) CREATE TABLE course_tags_count ( course_id, clear_grading, pop_quiz, group_projects, inspirational, long_lectures, extra_credit, few_tests, good_feedback, tough_tests, heavy_papers, cares_for_students, heavy_assignments, respected, participation, heavy_reading, tough_grader, hilarious, would_take_again, good_lecture, no_skip ) CREATE TABLE gsi ( course_offering_id, student_id ) CREATE TABLE program_requirement ( program_id, category, min_credit, additional_req ) CREATE TABLE offering_instructor ( offering_instructor_id, offering_id, instructor_id ) CREATE TABLE student ( student_id, lastname, firstname, program_id, declare_major, total_credit, total_gpa, entered_as, admit_term, predicted_graduation_semester, degree, minor, internship ) CREATE TABLE course_prerequisite ( pre_course_id, course_id ) CREATE TABLE course ( course_id, name, department, number, credits, advisory_requirement, enforced_requirement, description, num_semesters, num_enrolled, has_discussion, has_lab, has_projects, has_exams, num_reviews, clarity_score, easiness_score, helpfulness_score ) CREATE TABLE comment_instructor ( instructor_id, student_id, score, comment_text ) CREATE TABLE instructor ( instructor_id, name, uniqname ) CREATE TABLE course_offering ( offering_id, course_id, semester, section_number, start_time, end_time, monday, tuesday, wednesday, thursday, friday, saturday, sunday, has_final_project, has_final_exam, textbook, class_address, allow_audit ) CREATE TABLE semester ( semester_id, semester, year ) CREATE TABLE requirement ( requirement_id, requirement, college ) CREATE TABLE program ( program_id, name, college, introduction ) CREATE TABLE area ( course_id, area ) CREATE TABLE program_course ( program_id, course_id, workload, category ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Regarding The Nature of Science , is there a class ? SELECT### Response: SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%The Nature of Science%' OR name LIKE '%The Nature of Science%') AND department = 'EECS'.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE area ( course_id, area ) CREATE TABLE student_record ( student_id, course_id, semester, grade, how, transfer_source, earn_credit, repeat_term, test_id ) CREATE TABLE program ( program_id, name, college, introduction ) CREATE TABLE requirement ( requirement_id, requirement, college ) CREATE TABLE ta ( campus_job_id, student_id, location ) CREATE TABLE course_tags_count ( course_id, clear_grading, pop_quiz, group_projects, inspirational, long_lectures, extra_credit, few_tests, good_feedback, tough_tests, heavy_papers, cares_for_students, heavy_assignments, respected, participation, heavy_reading, tough_grader, hilarious, would_take_again, good_lecture, no_skip ) CREATE TABLE comment_instructor ( instructor_id, student_id, score, comment_text ) CREATE TABLE course_prerequisite ( pre_course_id, course_id ) CREATE TABLE program_course ( program_id, course_id, workload, category ) CREATE TABLE instructor ( instructor_id, name, uniqname ) CREATE TABLE jobs ( job_id, job_title, description, requirement, city, state, country, zip ) CREATE TABLE course_offering ( offering_id, course_id, semester, section_number, start_time, end_time, monday, tuesday, wednesday, thursday, friday, saturday, sunday, has_final_project, has_final_exam, textbook, class_address, allow_audit ) CREATE TABLE semester ( semester_id, semester, year ) CREATE TABLE gsi ( course_offering_id, student_id ) CREATE TABLE offering_instructor ( offering_instructor_id, offering_id, instructor_id ) CREATE TABLE course ( course_id, name, department, number, credits, advisory_requirement, enforced_requirement, description, num_semesters, num_enrolled, has_discussion, has_lab, has_projects, has_exams, num_reviews, clarity_score, easiness_score, helpfulness_score ) CREATE TABLE student ( student_id, lastname, firstname, program_id, declare_major, total_credit, total_gpa, entered_as, admit_term, predicted_graduation_semester, degree, minor, internship ) CREATE TABLE program_requirement ( program_id, category, min_credit, additional_req ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In order to declare a major in DENT , what classes do I need to take ? SELECT### Response: SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%DENT%' AND program_course.category LIKE 'PreMajor' AND program_course.course_id = course.course_id.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE program_course ( program_id, course_id, workload, category ) CREATE TABLE ta ( campus_job_id, student_id, location ) CREATE TABLE course ( course_id, name, department, number, credits, advisory_requirement, enforced_requirement, description, num_semesters, num_enrolled, has_discussion, has_lab, has_projects, has_exams, num_reviews, clarity_score, easiness_score, helpfulness_score ) CREATE TABLE student_record ( student_id, course_id, semester, grade, how, transfer_source, earn_credit, repeat_term, test_id ) CREATE TABLE program ( program_id, name, college, introduction ) CREATE TABLE area ( course_id, area ) CREATE TABLE gsi ( course_offering_id, student_id ) CREATE TABLE student ( student_id, lastname, firstname, program_id, declare_major, total_credit, total_gpa, entered_as, admit_term, predicted_graduation_semester, degree, minor, internship ) CREATE TABLE course_prerequisite ( pre_course_id, course_id ) CREATE TABLE semester ( semester_id, semester, year ) CREATE TABLE instructor ( instructor_id, name, uniqname ) CREATE TABLE course_tags_count ( course_id, clear_grading, pop_quiz, group_projects, inspirational, long_lectures, extra_credit, few_tests, good_feedback, tough_tests, heavy_papers, cares_for_students, heavy_assignments, respected, participation, heavy_reading, tough_grader, hilarious, would_take_again, good_lecture, no_skip ) CREATE TABLE offering_instructor ( offering_instructor_id, offering_id, instructor_id ) CREATE TABLE program_requirement ( program_id, category, min_credit, additional_req ) CREATE TABLE requirement ( requirement_id, requirement, college ) CREATE TABLE course_offering ( offering_id, course_id, semester, section_number, start_time, end_time, monday, tuesday, wednesday, thursday, friday, saturday, sunday, has_final_project, has_final_exam, textbook, class_address, allow_audit ) CREATE TABLE jobs ( job_id, job_title, description, requirement, city, state, country, zip ) CREATE TABLE comment_instructor ( instructor_id, student_id, score, comment_text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What upper level classes next semester will not have to meet on Fridays ? SELECT### Response: SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course_offering.friday = 'N' AND course.course_id = course_offering.course_id AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE code_description ( code, description ) CREATE TABLE airport_service ( city_code, airport_code, miles_distant, direction, minutes_distant ) CREATE TABLE food_service ( meal_code, meal_number, compartment, meal_description ) CREATE TABLE time_interval ( period, begin_time, end_time ) CREATE TABLE equipment_sequence ( aircraft_code_sequence, aircraft_code ) CREATE TABLE restriction ( restriction_code, advance_purchase, stopovers, saturday_stay_required, minimum_stay, maximum_stay, application, no_discounts ) CREATE TABLE days ( days_code, day_name ) CREATE TABLE fare_basis ( fare_basis_code, booking_class, class_type, premium, economy, discounted, night, season, basis_days ) CREATE TABLE airport ( airport_code, airport_name, airport_location, state_code, country_name, time_zone_code, minimum_connect_time ) CREATE TABLE flight_stop ( flight_id, stop_number, stop_days, stop_airport, arrival_time, arrival_airline, arrival_flight_number, departure_time, departure_airline, departure_flight_number, stop_time ) CREATE TABLE airline ( airline_code, airline_name, note ) CREATE TABLE flight_leg ( flight_id, leg_number, leg_flight ) CREATE TABLE aircraft ( aircraft_code, aircraft_description, manufacturer, basic_type, engines, propulsion, wide_body, wing_span, length, weight, capacity, pay_load, cruising_speed, range_miles, pressurized ) CREATE TABLE class_of_service ( booking_class, rank, class_description ) CREATE TABLE date_day ( month_number, day_number, year, day_name ) CREATE TABLE dual_carrier ( main_airline, low_flight_number, high_flight_number, dual_airline, service_name ) CREATE TABLE month ( month_number, month_name ) CREATE TABLE city ( city_code, city_name, state_code, country_name, time_zone_code ) CREATE TABLE fare ( fare_id, from_airport, to_airport, fare_basis_code, fare_airline, restriction_code, one_direction_cost, round_trip_cost, round_trip_required ) CREATE TABLE time_zone ( time_zone_code, time_zone_name, hours_from_gmt ) CREATE TABLE state ( state_code, state_name, country_name ) CREATE TABLE flight_fare ( flight_id, fare_id ) CREATE TABLE compartment_class ( compartment, class_type ) CREATE TABLE ground_service ( city_code, airport_code, transport_type, ground_fare ) CREATE TABLE flight ( aircraft_code_sequence, airline_code, airline_flight, arrival_time, connections, departure_time, dual_carrier, flight_days, flight_id, flight_number, from_airport, meal_code, stops, time_elapsed, to_airport ) -- Using valid SQLite, answer the following questions for the tables provided above. -- can you list all nonstop flights departing from ST. PETERSBURG and arriving in CHARLOTTE SELECT### Response: 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 = 'ST. PETERSBURG' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CHARLOTTE' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND flight.stops = 0.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE flight_stop ( flight_id, stop_number, stop_days, stop_airport, arrival_time, arrival_airline, arrival_flight_number, departure_time, departure_airline, departure_flight_number, stop_time ) CREATE TABLE date_day ( month_number, day_number, year, day_name ) CREATE TABLE dual_carrier ( main_airline, low_flight_number, high_flight_number, dual_airline, service_name ) CREATE TABLE month ( month_number, month_name ) CREATE TABLE compartment_class ( compartment, class_type ) CREATE TABLE flight_fare ( flight_id, fare_id ) CREATE TABLE airline ( airline_code, airline_name, note ) CREATE TABLE food_service ( meal_code, meal_number, compartment, meal_description ) CREATE TABLE flight ( aircraft_code_sequence, airline_code, airline_flight, arrival_time, connections, departure_time, dual_carrier, flight_days, flight_id, flight_number, from_airport, meal_code, stops, time_elapsed, to_airport ) CREATE TABLE aircraft ( aircraft_code, aircraft_description, manufacturer, basic_type, engines, propulsion, wide_body, wing_span, length, weight, capacity, pay_load, cruising_speed, range_miles, pressurized ) CREATE TABLE days ( days_code, day_name ) CREATE TABLE flight_leg ( flight_id, leg_number, leg_flight ) CREATE TABLE state ( state_code, state_name, country_name ) CREATE TABLE time_zone ( time_zone_code, time_zone_name, hours_from_gmt ) CREATE TABLE class_of_service ( booking_class, rank, class_description ) CREATE TABLE airport ( airport_code, airport_name, airport_location, state_code, country_name, time_zone_code, minimum_connect_time ) CREATE TABLE ground_service ( city_code, airport_code, transport_type, ground_fare ) CREATE TABLE code_description ( code, description ) CREATE TABLE equipment_sequence ( aircraft_code_sequence, aircraft_code ) CREATE TABLE fare_basis ( fare_basis_code, booking_class, class_type, premium, economy, discounted, night, season, basis_days ) CREATE TABLE time_interval ( period, begin_time, end_time ) CREATE TABLE city ( city_code, city_name, state_code, country_name, time_zone_code ) CREATE TABLE fare ( fare_id, from_airport, to_airport, fare_basis_code, fare_airline, restriction_code, one_direction_cost, round_trip_cost, round_trip_required ) CREATE TABLE restriction ( restriction_code, advance_purchase, stopovers, saturday_stay_required, minimum_stay, maximum_stay, application, no_discounts ) CREATE TABLE airport_service ( city_code, airport_code, miles_distant, direction, minutes_distant ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what do you have tomorrow morning from PITTSBURGH to ATLANTA SELECT### Response: 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, date_day, days, flight WHERE (((flight.departure_time BETWEEN 0 AND 1200) AND date_day.day_number = 20 AND date_day.month_number = 1 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PITTSBURGH' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE fare_basis ( fare_basis_code, booking_class, class_type, premium, economy, discounted, night, season, basis_days ) CREATE TABLE airport ( airport_code, airport_name, airport_location, state_code, country_name, time_zone_code, minimum_connect_time ) CREATE TABLE food_service ( meal_code, meal_number, compartment, meal_description ) CREATE TABLE class_of_service ( booking_class, rank, class_description ) CREATE TABLE dual_carrier ( main_airline, low_flight_number, high_flight_number, dual_airline, service_name ) CREATE TABLE aircraft ( aircraft_code, aircraft_description, manufacturer, basic_type, engines, propulsion, wide_body, wing_span, length, weight, capacity, pay_load, cruising_speed, range_miles, pressurized ) CREATE TABLE flight_fare ( flight_id, fare_id ) CREATE TABLE month ( month_number, month_name ) CREATE TABLE restriction ( restriction_code, advance_purchase, stopovers, saturday_stay_required, minimum_stay, maximum_stay, application, no_discounts ) CREATE TABLE flight_stop ( flight_id, stop_number, stop_days, stop_airport, arrival_time, arrival_airline, arrival_flight_number, departure_time, departure_airline, departure_flight_number, stop_time ) CREATE TABLE equipment_sequence ( aircraft_code_sequence, aircraft_code ) CREATE TABLE compartment_class ( compartment, class_type ) CREATE TABLE time_interval ( period, begin_time, end_time ) CREATE TABLE airline ( airline_code, airline_name, note ) CREATE TABLE flight ( aircraft_code_sequence, airline_code, airline_flight, arrival_time, connections, departure_time, dual_carrier, flight_days, flight_id, flight_number, from_airport, meal_code, stops, time_elapsed, to_airport ) CREATE TABLE city ( city_code, city_name, state_code, country_name, time_zone_code ) CREATE TABLE time_zone ( time_zone_code, time_zone_name, hours_from_gmt ) CREATE TABLE ground_service ( city_code, airport_code, transport_type, ground_fare ) CREATE TABLE state ( state_code, state_name, country_name ) CREATE TABLE flight_leg ( flight_id, leg_number, leg_flight ) CREATE TABLE code_description ( code, description ) CREATE TABLE date_day ( month_number, day_number, year, day_name ) CREATE TABLE airport_service ( city_code, airport_code, miles_distant, direction, minutes_distant ) CREATE TABLE days ( days_code, day_name ) CREATE TABLE fare ( fare_id, from_airport, to_airport, fare_basis_code, fare_airline, restriction_code, one_direction_cost, round_trip_cost, round_trip_required ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what're the cheapest flights from NEW YORK to MIAMI SELECT### Response: 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, fare, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'NEW YORK' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MIAMI' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND fare.one_direction_cost = (SELECT MIN(FAREalias1.one_direction_cost) FROM airport_service AS AIRPORT_SERVICEalias2, airport_service AS AIRPORT_SERVICEalias3, city AS CITYalias2, city AS CITYalias3, fare AS FAREalias1, flight AS FLIGHTalias1, flight_fare AS FLIGHT_FAREalias1 WHERE CITYalias2.city_code = AIRPORT_SERVICEalias2.city_code AND CITYalias2.city_name = 'NEW YORK' AND CITYalias3.city_code = AIRPORT_SERVICEalias3.city_code AND CITYalias3.city_name = 'MIAMI' AND FLIGHT_FAREalias1.fare_id = FAREalias1.fare_id AND FLIGHTalias1.flight_id = FLIGHT_FAREalias1.flight_id AND FLIGHTalias1.from_airport = AIRPORT_SERVICEalias2.airport_code AND FLIGHTalias1.to_airport = AIRPORT_SERVICEalias3.airport_code) AND flight_fare.fare_id = fare.fare_id AND flight.flight_id = flight_fare.flight_id.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE organization ( continent, homepage, name, oid ) CREATE TABLE cite ( cited, citing ) CREATE TABLE publication ( abstract, cid, citation_num, jid, pid, reference_num, title, year ) CREATE TABLE domain_journal ( did, jid ) CREATE TABLE domain_keyword ( did, kid ) CREATE TABLE keyword ( keyword, kid ) CREATE TABLE domain_conference ( cid, did ) CREATE TABLE domain_publication ( did, pid ) CREATE TABLE conference ( cid, homepage, name ) CREATE TABLE domain ( did, name ) CREATE TABLE writes ( aid, pid ) CREATE TABLE author ( aid, homepage, name, oid ) CREATE TABLE domain_author ( aid, did ) CREATE TABLE journal ( homepage, jid, name ) CREATE TABLE publication_keyword ( kid, pid ) -- Using valid SQLite, answer the following questions for the tables provided above. -- return me the journal, which have the most number of papers by ' H. V. Jagadish ' . SELECT### Response: SELECT journal.name FROM author, journal, publication, writes WHERE author.name = 'H. V. Jagadish' AND publication.jid = journal.jid AND writes.aid = author.aid AND writes.pid = publication.pid GROUP BY journal.name ORDER BY COUNT(DISTINCT (publication.title)) DESC LIMIT 1.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE semester ( semester_id, semester, year ) CREATE TABLE requirement ( requirement_id, requirement, college ) CREATE TABLE course_tags_count ( course_id, clear_grading, pop_quiz, group_projects, inspirational, long_lectures, extra_credit, few_tests, good_feedback, tough_tests, heavy_papers, cares_for_students, heavy_assignments, respected, participation, heavy_reading, tough_grader, hilarious, would_take_again, good_lecture, no_skip ) CREATE TABLE program ( program_id, name, college, introduction ) CREATE TABLE program_course ( program_id, course_id, workload, category ) CREATE TABLE ta ( campus_job_id, student_id, location ) CREATE TABLE offering_instructor ( offering_instructor_id, offering_id, instructor_id ) CREATE TABLE course_prerequisite ( pre_course_id, course_id ) CREATE TABLE student_record ( student_id, course_id, semester, grade, how, transfer_source, earn_credit, repeat_term, test_id ) CREATE TABLE course_offering ( offering_id, course_id, semester, section_number, start_time, end_time, monday, tuesday, wednesday, thursday, friday, saturday, sunday, has_final_project, has_final_exam, textbook, class_address, allow_audit ) CREATE TABLE program_requirement ( program_id, category, min_credit, additional_req ) CREATE TABLE instructor ( instructor_id, name, uniqname ) CREATE TABLE jobs ( job_id, job_title, description, requirement, city, state, country, zip ) CREATE TABLE gsi ( course_offering_id, student_id ) CREATE TABLE comment_instructor ( instructor_id, student_id, score, comment_text ) CREATE TABLE area ( course_id, area ) CREATE TABLE course ( course_id, name, department, number, credits, advisory_requirement, enforced_requirement, description, num_semesters, num_enrolled, has_discussion, has_lab, has_projects, has_exams, num_reviews, clarity_score, easiness_score, helpfulness_score ) CREATE TABLE student ( student_id, lastname, firstname, program_id, declare_major, total_credit, total_gpa, entered_as, admit_term, predicted_graduation_semester, degree, minor, internship ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Are there any courses I can take in the Fall or Winter semester to satisfy my ULCS requirement ? SELECT### Response: SELECT DISTINCT COURSEalias0.department, COURSEalias0.name, COURSEalias0.number, SEMESTERalias0.semester FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, program_course AS PROGRAM_COURSEalias0, semester AS SEMESTERalias0 WHERE COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id AND NOT COURSEalias0.course_id IN (DERIVED_TABLEalias0.course_id) AND NOT COURSEalias0.course_id IN (SELECT DISTINCT COURSE_PREREQUISITEalias0.course_id FROM course_prerequisite AS COURSE_PREREQUISITEalias0 WHERE NOT COURSE_PREREQUISITEalias0.pre_course_id IN (DERIVED_TABLEalias0.course_id)) AND COURSEalias0.department = 'department0' AND PROGRAM_COURSEalias0.category LIKE '%ULCS%' AND PROGRAM_COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id AND SEMESTERalias0.semester IN ('FA', 'WN') AND SEMESTERalias0.semester_id = COURSE_OFFERINGalias0.semester AND SEMESTERalias0.year = 2016.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE program_course ( program_id, course_id, workload, category ) CREATE TABLE ta ( campus_job_id, student_id, location ) CREATE TABLE course_tags_count ( course_id, clear_grading, pop_quiz, group_projects, inspirational, long_lectures, extra_credit, few_tests, good_feedback, tough_tests, heavy_papers, cares_for_students, heavy_assignments, respected, participation, heavy_reading, tough_grader, hilarious, would_take_again, good_lecture, no_skip ) CREATE TABLE comment_instructor ( instructor_id, student_id, score, comment_text ) CREATE TABLE student ( student_id, lastname, firstname, program_id, declare_major, total_credit, total_gpa, entered_as, admit_term, predicted_graduation_semester, degree, minor, internship ) CREATE TABLE requirement ( requirement_id, requirement, college ) CREATE TABLE course_offering ( offering_id, course_id, semester, section_number, start_time, end_time, monday, tuesday, wednesday, thursday, friday, saturday, sunday, has_final_project, has_final_exam, textbook, class_address, allow_audit ) CREATE TABLE course_prerequisite ( pre_course_id, course_id ) CREATE TABLE offering_instructor ( offering_instructor_id, offering_id, instructor_id ) CREATE TABLE semester ( semester_id, semester, year ) CREATE TABLE course ( course_id, name, department, number, credits, advisory_requirement, enforced_requirement, description, num_semesters, num_enrolled, has_discussion, has_lab, has_projects, has_exams, num_reviews, clarity_score, easiness_score, helpfulness_score ) CREATE TABLE jobs ( job_id, job_title, description, requirement, city, state, country, zip ) CREATE TABLE program_requirement ( program_id, category, min_credit, additional_req ) CREATE TABLE gsi ( course_offering_id, student_id ) CREATE TABLE student_record ( student_id, course_id, semester, grade, how, transfer_source, earn_credit, repeat_term, test_id ) CREATE TABLE instructor ( instructor_id, name, uniqname ) CREATE TABLE program ( program_id, name, college, introduction ) CREATE TABLE area ( course_id, area ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Is there any lab for 533 ? SELECT### Response: SELECT COUNT(*) > 0 FROM course WHERE department = 'EECS' AND has_lab = 'Y' AND number = 533.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE time_zone ( time_zone_code, time_zone_name, hours_from_gmt ) CREATE TABLE time_interval ( period, begin_time, end_time ) CREATE TABLE equipment_sequence ( aircraft_code_sequence, aircraft_code ) CREATE TABLE date_day ( month_number, day_number, year, day_name ) CREATE TABLE airline ( airline_code, airline_name, note ) CREATE TABLE city ( city_code, city_name, state_code, country_name, time_zone_code ) CREATE TABLE aircraft ( aircraft_code, aircraft_description, manufacturer, basic_type, engines, propulsion, wide_body, wing_span, length, weight, capacity, pay_load, cruising_speed, range_miles, pressurized ) CREATE TABLE days ( days_code, day_name ) CREATE TABLE flight ( aircraft_code_sequence, airline_code, airline_flight, arrival_time, connections, departure_time, dual_carrier, flight_days, flight_id, flight_number, from_airport, meal_code, stops, time_elapsed, to_airport ) CREATE TABLE compartment_class ( compartment, class_type ) CREATE TABLE code_description ( code, description ) CREATE TABLE flight_leg ( flight_id, leg_number, leg_flight ) CREATE TABLE state ( state_code, state_name, country_name ) CREATE TABLE month ( month_number, month_name ) CREATE TABLE class_of_service ( booking_class, rank, class_description ) CREATE TABLE dual_carrier ( main_airline, low_flight_number, high_flight_number, dual_airline, service_name ) CREATE TABLE fare_basis ( fare_basis_code, booking_class, class_type, premium, economy, discounted, night, season, basis_days ) CREATE TABLE airport_service ( city_code, airport_code, miles_distant, direction, minutes_distant ) CREATE TABLE ground_service ( city_code, airport_code, transport_type, ground_fare ) CREATE TABLE flight_fare ( flight_id, fare_id ) CREATE TABLE airport ( airport_code, airport_name, airport_location, state_code, country_name, time_zone_code, minimum_connect_time ) CREATE TABLE fare ( fare_id, from_airport, to_airport, fare_basis_code, fare_airline, restriction_code, one_direction_cost, round_trip_cost, round_trip_required ) CREATE TABLE restriction ( restriction_code, advance_purchase, stopovers, saturday_stay_required, minimum_stay, maximum_stay, application, no_discounts ) CREATE TABLE food_service ( meal_code, meal_number, compartment, meal_description ) CREATE TABLE flight_stop ( flight_id, stop_number, stop_days, stop_airport, arrival_time, arrival_airline, arrival_flight_number, departure_time, departure_airline, departure_flight_number, stop_time ) -- Using valid SQLite, answer the following questions for the tables provided above. -- all flights PITTSBURGH to BALTIMORE on thursday arrival by 1000 SELECT### Response: 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, date_day, days, flight WHERE ((date_day.day_number = 24 AND date_day.month_number = 5 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.arrival_time <= 1000 AND flight.flight_days = days.days_code) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PITTSBURGH' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE paper ( paperid, title, venueid, year, numciting, numcitedby, journalid ) CREATE TABLE paperfield ( fieldid, paperid ) CREATE TABLE dataset ( datasetid, datasetname ) CREATE TABLE journal ( journalid, journalname ) CREATE TABLE author ( authorid, authorname ) CREATE TABLE field ( fieldid ) CREATE TABLE venue ( venueid, venuename ) CREATE TABLE writes ( paperid, authorid ) CREATE TABLE paperdataset ( paperid, datasetid ) CREATE TABLE keyphrase ( keyphraseid, keyphrasename ) CREATE TABLE paperkeyphrase ( paperid, keyphraseid ) CREATE TABLE cite ( citingpaperid, citedpaperid ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What papers were published at CVPR '16 about Class consistent multi-modal fusion with binary features applied to RGB-D Object Dataset ? SELECT### Response: SELECT DISTINCT paper.paperid FROM dataset, paper, paperdataset, venue WHERE dataset.datasetname = 'RGB-D Object Dataset' AND paperdataset.datasetid = dataset.datasetid AND paper.paperid = paperdataset.paperid AND paper.title = 'Class consistent multi-modal fusion with binary features' AND paper.year = 2016 AND venue.venueid = paper.venueid AND venue.venuename = 'CVPR'.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE time_interval ( period, begin_time, end_time ) CREATE TABLE flight_fare ( flight_id, fare_id ) CREATE TABLE aircraft ( aircraft_code, aircraft_description, manufacturer, basic_type, engines, propulsion, wide_body, wing_span, length, weight, capacity, pay_load, cruising_speed, range_miles, pressurized ) CREATE TABLE airport ( airport_code, airport_name, airport_location, state_code, country_name, time_zone_code, minimum_connect_time ) CREATE TABLE flight_leg ( flight_id, leg_number, leg_flight ) CREATE TABLE state ( state_code, state_name, country_name ) CREATE TABLE fare_basis ( fare_basis_code, booking_class, class_type, premium, economy, discounted, night, season, basis_days ) CREATE TABLE fare ( fare_id, from_airport, to_airport, fare_basis_code, fare_airline, restriction_code, one_direction_cost, round_trip_cost, round_trip_required ) CREATE TABLE city ( city_code, city_name, state_code, country_name, time_zone_code ) CREATE TABLE airline ( airline_code, airline_name, note ) CREATE TABLE month ( month_number, month_name ) CREATE TABLE ground_service ( city_code, airport_code, transport_type, ground_fare ) CREATE TABLE food_service ( meal_code, meal_number, compartment, meal_description ) CREATE TABLE compartment_class ( compartment, class_type ) CREATE TABLE equipment_sequence ( aircraft_code_sequence, aircraft_code ) CREATE TABLE airport_service ( city_code, airport_code, miles_distant, direction, minutes_distant ) CREATE TABLE flight ( aircraft_code_sequence, airline_code, airline_flight, arrival_time, connections, departure_time, dual_carrier, flight_days, flight_id, flight_number, from_airport, meal_code, stops, time_elapsed, to_airport ) CREATE TABLE time_zone ( time_zone_code, time_zone_name, hours_from_gmt ) CREATE TABLE days ( days_code, day_name ) CREATE TABLE flight_stop ( flight_id, stop_number, stop_days, stop_airport, arrival_time, arrival_airline, arrival_flight_number, departure_time, departure_airline, departure_flight_number, stop_time ) CREATE TABLE date_day ( month_number, day_number, year, day_name ) CREATE TABLE code_description ( code, description ) CREATE TABLE class_of_service ( booking_class, rank, class_description ) CREATE TABLE dual_carrier ( main_airline, low_flight_number, high_flight_number, dual_airline, service_name ) CREATE TABLE restriction ( restriction_code, advance_purchase, stopovers, saturday_stay_required, minimum_stay, maximum_stay, application, no_discounts ) -- Using valid SQLite, answer the following questions for the tables provided above. -- i need a flight from KANSAS CITY to CHICAGO next wednesday that reaches CHICAGO around 7 in the evening SELECT### Response: 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, date_day, days, flight WHERE (((flight.arrival_time <= 1930 AND flight.arrival_time >= 1830) AND date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CHICAGO' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'KANSAS CITY' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE time_zone ( time_zone_code, time_zone_name, hours_from_gmt ) CREATE TABLE ground_service ( city_code, airport_code, transport_type, ground_fare ) CREATE TABLE fare_basis ( fare_basis_code, booking_class, class_type, premium, economy, discounted, night, season, basis_days ) CREATE TABLE airport ( airport_code, airport_name, airport_location, state_code, country_name, time_zone_code, minimum_connect_time ) CREATE TABLE airline ( airline_code, airline_name, note ) CREATE TABLE fare ( fare_id, from_airport, to_airport, fare_basis_code, fare_airline, restriction_code, one_direction_cost, round_trip_cost, round_trip_required ) CREATE TABLE date_day ( month_number, day_number, year, day_name ) CREATE TABLE flight ( aircraft_code_sequence, airline_code, airline_flight, arrival_time, connections, departure_time, dual_carrier, flight_days, flight_id, flight_number, from_airport, meal_code, stops, time_elapsed, to_airport ) CREATE TABLE flight_leg ( flight_id, leg_number, leg_flight ) CREATE TABLE food_service ( meal_code, meal_number, compartment, meal_description ) CREATE TABLE restriction ( restriction_code, advance_purchase, stopovers, saturday_stay_required, minimum_stay, maximum_stay, application, no_discounts ) CREATE TABLE state ( state_code, state_name, country_name ) CREATE TABLE days ( days_code, day_name ) CREATE TABLE equipment_sequence ( aircraft_code_sequence, aircraft_code ) CREATE TABLE class_of_service ( booking_class, rank, class_description ) CREATE TABLE dual_carrier ( main_airline, low_flight_number, high_flight_number, dual_airline, service_name ) CREATE TABLE flight_fare ( flight_id, fare_id ) CREATE TABLE month ( month_number, month_name ) CREATE TABLE flight_stop ( flight_id, stop_number, stop_days, stop_airport, arrival_time, arrival_airline, arrival_flight_number, departure_time, departure_airline, departure_flight_number, stop_time ) CREATE TABLE compartment_class ( compartment, class_type ) CREATE TABLE aircraft ( aircraft_code, aircraft_description, manufacturer, basic_type, engines, propulsion, wide_body, wing_span, length, weight, capacity, pay_load, cruising_speed, range_miles, pressurized ) CREATE TABLE code_description ( code, description ) CREATE TABLE airport_service ( city_code, airport_code, miles_distant, direction, minutes_distant ) CREATE TABLE time_interval ( period, begin_time, end_time ) CREATE TABLE city ( city_code, city_name, state_code, country_name, time_zone_code ) -- Using valid SQLite, answer the following questions for the tables provided above. -- i would like to book a flight on US FIRST class from CLEVELAND to MIAMI on 2 22 SELECT### Response: 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, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis AS FARE_BASIS_0, fare_basis AS FARE_BASIS_1, flight, flight_fare WHERE (((DATE_DAY_0.day_number = 22 AND DATE_DAY_0.month_number = 2 AND DATE_DAY_0.year = 1991 AND DATE_DAY_1.day_number = 22 AND DATE_DAY_1.month_number = 2 AND DATE_DAY_1.year = 1991 AND DAYS_0.day_name = DATE_DAY_0.day_name AND DAYS_1.day_name = DATE_DAY_1.day_name AND FARE_BASIS_0.class_type = 'FIRST' AND FARE_BASIS_1.basis_days = DAYS_1.days_code AND fare.fare_basis_code = FARE_BASIS_0.fare_basis_code AND fare.fare_basis_code = FARE_BASIS_1.fare_basis_code AND flight_fare.fare_id = fare.fare_id AND flight.flight_days = DAYS_0.days_code AND flight.flight_id = flight_fare.flight_id) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MIAMI' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'CLEVELAND' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code) AND flight.airline_code = 'US'.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE instructor ( instructor_id, name, uniqname ) CREATE TABLE program ( program_id, name, college, introduction ) CREATE TABLE ta ( campus_job_id, student_id, location ) CREATE TABLE program_requirement ( program_id, category, min_credit, additional_req ) CREATE TABLE course_offering ( offering_id, course_id, semester, section_number, start_time, end_time, monday, tuesday, wednesday, thursday, friday, saturday, sunday, has_final_project, has_final_exam, textbook, class_address, allow_audit ) CREATE TABLE course_tags_count ( course_id, clear_grading, pop_quiz, group_projects, inspirational, long_lectures, extra_credit, few_tests, good_feedback, tough_tests, heavy_papers, cares_for_students, heavy_assignments, respected, participation, heavy_reading, tough_grader, hilarious, would_take_again, good_lecture, no_skip ) CREATE TABLE jobs ( job_id, job_title, description, requirement, city, state, country, zip ) CREATE TABLE requirement ( requirement_id, requirement, college ) CREATE TABLE program_course ( program_id, course_id, workload, category ) CREATE TABLE course_prerequisite ( pre_course_id, course_id ) CREATE TABLE student_record ( student_id, course_id, semester, grade, how, transfer_source, earn_credit, repeat_term, test_id ) CREATE TABLE student ( student_id, lastname, firstname, program_id, declare_major, total_credit, total_gpa, entered_as, admit_term, predicted_graduation_semester, degree, minor, internship ) CREATE TABLE semester ( semester_id, semester, year ) CREATE TABLE gsi ( course_offering_id, student_id ) CREATE TABLE area ( course_id, area ) CREATE TABLE comment_instructor ( instructor_id, student_id, score, comment_text ) CREATE TABLE offering_instructor ( offering_instructor_id, offering_id, instructor_id ) CREATE TABLE course ( course_id, name, department, number, credits, advisory_requirement, enforced_requirement, description, num_semesters, num_enrolled, has_discussion, has_lab, has_projects, has_exams, num_reviews, clarity_score, easiness_score, helpfulness_score ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The MDE requirement can be fulfilled with which easiest class ? SELECT### Response: SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 WHERE PROGRAM_COURSEalias1.category LIKE '%MDE%').
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE made_by ( id, msid, pid ) CREATE TABLE copyright ( id, msid, cid ) CREATE TABLE written_by ( id, msid, wid ) CREATE TABLE tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget ) CREATE TABLE director ( did, gender, name, nationality, birth_city, birth_year ) CREATE TABLE cast ( id, msid, aid, role ) CREATE TABLE company ( id, name, country_code ) CREATE TABLE genre ( gid, genre ) CREATE TABLE keyword ( id, keyword ) CREATE TABLE classification ( id, msid, gid ) CREATE TABLE producer ( pid, gender, name, nationality, birth_city, birth_year ) CREATE TABLE tags ( id, msid, kid ) CREATE TABLE movie ( mid, title, release_year, title_aka, budget ) CREATE TABLE directed_by ( id, msid, did ) CREATE TABLE actor ( aid, gender, name, nationality, birth_city, birth_year ) CREATE TABLE writer ( wid, gender, name, nationality, birth_city, birth_year ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the series in which ' Scott Foley ' is an actor ? SELECT### Response: SELECT tv_series.title FROM actor, cast, tv_series WHERE actor.name = 'Scott Foley' AND cast.aid = actor.aid AND tv_series.sid = cast.msid.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE semester ( semester_id, semester, year ) CREATE TABLE gsi ( course_offering_id, student_id ) CREATE TABLE instructor ( instructor_id, name, uniqname ) CREATE TABLE course_offering ( offering_id, course_id, semester, section_number, start_time, end_time, monday, tuesday, wednesday, thursday, friday, saturday, sunday, has_final_project, has_final_exam, textbook, class_address, allow_audit ) CREATE TABLE comment_instructor ( instructor_id, student_id, score, comment_text ) CREATE TABLE student_record ( student_id, course_id, semester, grade, how, transfer_source, earn_credit, repeat_term, test_id ) CREATE TABLE requirement ( requirement_id, requirement, college ) CREATE TABLE program ( program_id, name, college, introduction ) CREATE TABLE area ( course_id, area ) CREATE TABLE offering_instructor ( offering_instructor_id, offering_id, instructor_id ) CREATE TABLE program_requirement ( program_id, category, min_credit, additional_req ) CREATE TABLE course_tags_count ( course_id, clear_grading, pop_quiz, group_projects, inspirational, long_lectures, extra_credit, few_tests, good_feedback, tough_tests, heavy_papers, cares_for_students, heavy_assignments, respected, participation, heavy_reading, tough_grader, hilarious, would_take_again, good_lecture, no_skip ) CREATE TABLE jobs ( job_id, job_title, description, requirement, city, state, country, zip ) CREATE TABLE program_course ( program_id, course_id, workload, category ) CREATE TABLE course_prerequisite ( pre_course_id, course_id ) CREATE TABLE student ( student_id, lastname, firstname, program_id, declare_major, total_credit, total_gpa, entered_as, admit_term, predicted_graduation_semester, degree, minor, internship ) CREATE TABLE course ( course_id, name, department, number, credits, advisory_requirement, enforced_requirement, description, num_semesters, num_enrolled, has_discussion, has_lab, has_projects, has_exams, num_reviews, clarity_score, easiness_score, helpfulness_score ) CREATE TABLE ta ( campus_job_id, student_id, location ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Does anyone teach teach Media Institutions aside from Prof. Lombard ? SELECT### Response: SELECT DISTINCT course.department, course.name, course.number, instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.name LIKE '%Media Institutions%' AND NOT instructor.name LIKE '%Lombard%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.offering_id.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE ground_service ( city_code, airport_code, transport_type, ground_fare ) CREATE TABLE flight_stop ( flight_id, stop_number, stop_days, stop_airport, arrival_time, arrival_airline, arrival_flight_number, departure_time, departure_airline, departure_flight_number, stop_time ) CREATE TABLE date_day ( month_number, day_number, year, day_name ) CREATE TABLE month ( month_number, month_name ) CREATE TABLE flight_leg ( flight_id, leg_number, leg_flight ) CREATE TABLE food_service ( meal_code, meal_number, compartment, meal_description ) CREATE TABLE city ( city_code, city_name, state_code, country_name, time_zone_code ) CREATE TABLE aircraft ( aircraft_code, aircraft_description, manufacturer, basic_type, engines, propulsion, wide_body, wing_span, length, weight, capacity, pay_load, cruising_speed, range_miles, pressurized ) CREATE TABLE equipment_sequence ( aircraft_code_sequence, aircraft_code ) CREATE TABLE days ( days_code, day_name ) CREATE TABLE compartment_class ( compartment, class_type ) CREATE TABLE time_zone ( time_zone_code, time_zone_name, hours_from_gmt ) CREATE TABLE fare_basis ( fare_basis_code, booking_class, class_type, premium, economy, discounted, night, season, basis_days ) CREATE TABLE airport ( airport_code, airport_name, airport_location, state_code, country_name, time_zone_code, minimum_connect_time ) CREATE TABLE restriction ( restriction_code, advance_purchase, stopovers, saturday_stay_required, minimum_stay, maximum_stay, application, no_discounts ) CREATE TABLE airport_service ( city_code, airport_code, miles_distant, direction, minutes_distant ) CREATE TABLE time_interval ( period, begin_time, end_time ) CREATE TABLE flight ( aircraft_code_sequence, airline_code, airline_flight, arrival_time, connections, departure_time, dual_carrier, flight_days, flight_id, flight_number, from_airport, meal_code, stops, time_elapsed, to_airport ) CREATE TABLE code_description ( code, description ) CREATE TABLE state ( state_code, state_name, country_name ) CREATE TABLE dual_carrier ( main_airline, low_flight_number, high_flight_number, dual_airline, service_name ) CREATE TABLE class_of_service ( booking_class, rank, class_description ) CREATE TABLE flight_fare ( flight_id, fare_id ) CREATE TABLE fare ( fare_id, from_airport, to_airport, fare_basis_code, fare_airline, restriction_code, one_direction_cost, round_trip_cost, round_trip_required ) CREATE TABLE airline ( airline_code, airline_name, note ) -- Using valid SQLite, answer the following questions for the tables provided above. -- please list the flights taking off and landing on MKE airport SELECT### Response: SELECT DISTINCT flight.flight_id FROM airport AS AIRPORT_0, airport AS AIRPORT_1, flight WHERE (flight.to_airport = AIRPORT_0.airport_code AND AIRPORT_0.airport_code = 'MKE') OR (flight.from_airport = AIRPORT_1.airport_code AND AIRPORT_1.airport_code = 'MKE').
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE dual_carrier ( main_airline, low_flight_number, high_flight_number, dual_airline, service_name ) CREATE TABLE restriction ( restriction_code, advance_purchase, stopovers, saturday_stay_required, minimum_stay, maximum_stay, application, no_discounts ) CREATE TABLE code_description ( code, description ) CREATE TABLE flight_fare ( flight_id, fare_id ) CREATE TABLE airport_service ( city_code, airport_code, miles_distant, direction, minutes_distant ) CREATE TABLE compartment_class ( compartment, class_type ) CREATE TABLE aircraft ( aircraft_code, aircraft_description, manufacturer, basic_type, engines, propulsion, wide_body, wing_span, length, weight, capacity, pay_load, cruising_speed, range_miles, pressurized ) CREATE TABLE time_interval ( period, begin_time, end_time ) CREATE TABLE flight_leg ( flight_id, leg_number, leg_flight ) CREATE TABLE airport ( airport_code, airport_name, airport_location, state_code, country_name, time_zone_code, minimum_connect_time ) CREATE TABLE days ( days_code, day_name ) CREATE TABLE equipment_sequence ( aircraft_code_sequence, aircraft_code ) CREATE TABLE time_zone ( time_zone_code, time_zone_name, hours_from_gmt ) CREATE TABLE ground_service ( city_code, airport_code, transport_type, ground_fare ) CREATE TABLE flight ( aircraft_code_sequence, airline_code, airline_flight, arrival_time, connections, departure_time, dual_carrier, flight_days, flight_id, flight_number, from_airport, meal_code, stops, time_elapsed, to_airport ) CREATE TABLE fare_basis ( fare_basis_code, booking_class, class_type, premium, economy, discounted, night, season, basis_days ) CREATE TABLE city ( city_code, city_name, state_code, country_name, time_zone_code ) CREATE TABLE flight_stop ( flight_id, stop_number, stop_days, stop_airport, arrival_time, arrival_airline, arrival_flight_number, departure_time, departure_airline, departure_flight_number, stop_time ) CREATE TABLE fare ( fare_id, from_airport, to_airport, fare_basis_code, fare_airline, restriction_code, one_direction_cost, round_trip_cost, round_trip_required ) CREATE TABLE date_day ( month_number, day_number, year, day_name ) CREATE TABLE airline ( airline_code, airline_name, note ) CREATE TABLE food_service ( meal_code, meal_number, compartment, meal_description ) CREATE TABLE class_of_service ( booking_class, rank, class_description ) CREATE TABLE state ( state_code, state_name, country_name ) CREATE TABLE month ( month_number, month_name ) -- Using valid SQLite, answer the following questions for the tables provided above. -- i need ground transportation in DALLAS please show me what 's available SELECT### Response: SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'DALLAS' AND ground_service.city_code = city.city_code.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE restriction ( restriction_code, advance_purchase, stopovers, saturday_stay_required, minimum_stay, maximum_stay, application, no_discounts ) CREATE TABLE days ( days_code, day_name ) CREATE TABLE airport_service ( city_code, airport_code, miles_distant, direction, minutes_distant ) CREATE TABLE equipment_sequence ( aircraft_code_sequence, aircraft_code ) CREATE TABLE aircraft ( aircraft_code, aircraft_description, manufacturer, basic_type, engines, propulsion, wide_body, wing_span, length, weight, capacity, pay_load, cruising_speed, range_miles, pressurized ) CREATE TABLE food_service ( meal_code, meal_number, compartment, meal_description ) CREATE TABLE time_zone ( time_zone_code, time_zone_name, hours_from_gmt ) CREATE TABLE dual_carrier ( main_airline, low_flight_number, high_flight_number, dual_airline, service_name ) CREATE TABLE flight_leg ( flight_id, leg_number, leg_flight ) CREATE TABLE class_of_service ( booking_class, rank, class_description ) CREATE TABLE flight_stop ( flight_id, stop_number, stop_days, stop_airport, arrival_time, arrival_airline, arrival_flight_number, departure_time, departure_airline, departure_flight_number, stop_time ) CREATE TABLE airport ( airport_code, airport_name, airport_location, state_code, country_name, time_zone_code, minimum_connect_time ) CREATE TABLE code_description ( code, description ) CREATE TABLE city ( city_code, city_name, state_code, country_name, time_zone_code ) CREATE TABLE flight_fare ( flight_id, fare_id ) CREATE TABLE fare_basis ( fare_basis_code, booking_class, class_type, premium, economy, discounted, night, season, basis_days ) CREATE TABLE compartment_class ( compartment, class_type ) CREATE TABLE date_day ( month_number, day_number, year, day_name ) CREATE TABLE month ( month_number, month_name ) CREATE TABLE state ( state_code, state_name, country_name ) CREATE TABLE fare ( fare_id, from_airport, to_airport, fare_basis_code, fare_airline, restriction_code, one_direction_cost, round_trip_cost, round_trip_required ) CREATE TABLE airline ( airline_code, airline_name, note ) CREATE TABLE ground_service ( city_code, airport_code, transport_type, ground_fare ) CREATE TABLE flight ( aircraft_code_sequence, airline_code, airline_flight, arrival_time, connections, departure_time, dual_carrier, flight_days, flight_id, flight_number, from_airport, meal_code, stops, time_elapsed, to_airport ) CREATE TABLE time_interval ( period, begin_time, end_time ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how about 4 27 DENVER to WASHINGTON SELECT### Response: 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, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHINGTON' AND date_day.day_number = 27 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE time_interval ( period, begin_time, end_time ) CREATE TABLE days ( days_code, day_name ) CREATE TABLE flight_leg ( flight_id, leg_number, leg_flight ) CREATE TABLE flight ( aircraft_code_sequence, airline_code, airline_flight, arrival_time, connections, departure_time, dual_carrier, flight_days, flight_id, flight_number, from_airport, meal_code, stops, time_elapsed, to_airport ) CREATE TABLE state ( state_code, state_name, country_name ) CREATE TABLE airport_service ( city_code, airport_code, miles_distant, direction, minutes_distant ) CREATE TABLE dual_carrier ( main_airline, low_flight_number, high_flight_number, dual_airline, service_name ) CREATE TABLE equipment_sequence ( aircraft_code_sequence, aircraft_code ) CREATE TABLE time_zone ( time_zone_code, time_zone_name, hours_from_gmt ) CREATE TABLE airline ( airline_code, airline_name, note ) CREATE TABLE flight_fare ( flight_id, fare_id ) CREATE TABLE date_day ( month_number, day_number, year, day_name ) CREATE TABLE class_of_service ( booking_class, rank, class_description ) CREATE TABLE fare_basis ( fare_basis_code, booking_class, class_type, premium, economy, discounted, night, season, basis_days ) CREATE TABLE month ( month_number, month_name ) CREATE TABLE city ( city_code, city_name, state_code, country_name, time_zone_code ) CREATE TABLE code_description ( code, description ) CREATE TABLE airport ( airport_code, airport_name, airport_location, state_code, country_name, time_zone_code, minimum_connect_time ) CREATE TABLE restriction ( restriction_code, advance_purchase, stopovers, saturday_stay_required, minimum_stay, maximum_stay, application, no_discounts ) CREATE TABLE flight_stop ( flight_id, stop_number, stop_days, stop_airport, arrival_time, arrival_airline, arrival_flight_number, departure_time, departure_airline, departure_flight_number, stop_time ) CREATE TABLE fare ( fare_id, from_airport, to_airport, fare_basis_code, fare_airline, restriction_code, one_direction_cost, round_trip_cost, round_trip_required ) CREATE TABLE food_service ( meal_code, meal_number, compartment, meal_description ) CREATE TABLE aircraft ( aircraft_code, aircraft_description, manufacturer, basic_type, engines, propulsion, wide_body, wing_span, length, weight, capacity, pay_load, cruising_speed, range_miles, pressurized ) CREATE TABLE compartment_class ( compartment, class_type ) CREATE TABLE ground_service ( city_code, airport_code, transport_type, ground_fare ) -- Using valid SQLite, answer the following questions for the tables provided above. -- hi i'd like a flight on AS from SAN DIEGO to TORONTO please SELECT### Response: 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 = 'TORONTO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN DIEGO' AND flight.to_airport = AIRPORT_SERVICE_0.airport_code AND flight.from_airport = AIRPORT_SERVICE_1.airport_code) AND flight.airline_code = 'AS'.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE comment_instructor ( instructor_id, student_id, score, comment_text ) CREATE TABLE jobs ( job_id, job_title, description, requirement, city, state, country, zip ) CREATE TABLE course_tags_count ( course_id, clear_grading, pop_quiz, group_projects, inspirational, long_lectures, extra_credit, few_tests, good_feedback, tough_tests, heavy_papers, cares_for_students, heavy_assignments, respected, participation, heavy_reading, tough_grader, hilarious, would_take_again, good_lecture, no_skip ) CREATE TABLE requirement ( requirement_id, requirement, college ) CREATE TABLE program_requirement ( program_id, category, min_credit, additional_req ) CREATE TABLE gsi ( course_offering_id, student_id ) CREATE TABLE program_course ( program_id, course_id, workload, category ) CREATE TABLE area ( course_id, area ) CREATE TABLE course_prerequisite ( pre_course_id, course_id ) CREATE TABLE ta ( campus_job_id, student_id, location ) CREATE TABLE student_record ( student_id, course_id, semester, grade, how, transfer_source, earn_credit, repeat_term, test_id ) CREATE TABLE course ( course_id, name, department, number, credits, advisory_requirement, enforced_requirement, description, num_semesters, num_enrolled, has_discussion, has_lab, has_projects, has_exams, num_reviews, clarity_score, easiness_score, helpfulness_score ) CREATE TABLE instructor ( instructor_id, name, uniqname ) CREATE TABLE program ( program_id, name, college, introduction ) CREATE TABLE student ( student_id, lastname, firstname, program_id, declare_major, total_credit, total_gpa, entered_as, admit_term, predicted_graduation_semester, degree, minor, internship ) CREATE TABLE semester ( semester_id, semester, year ) CREATE TABLE course_offering ( offering_id, course_id, semester, section_number, start_time, end_time, monday, tuesday, wednesday, thursday, friday, saturday, sunday, has_final_project, has_final_exam, textbook, class_address, allow_audit ) CREATE TABLE offering_instructor ( offering_instructor_id, offering_id, instructor_id ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Do you know if DOC 848 has morning classes ? SELECT### Response: SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.start_time < '12:00:00' AND course_offering.start_time >= '08:00:00' AND course.course_id = course_offering.course_id AND course.department = 'DOC' AND course.number = 848 AND semester.semester = 'WN' AND semester.semester_id = course_offering.semester AND semester.year = 2016.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE area ( course_id, area ) CREATE TABLE ta ( campus_job_id, student_id, location ) CREATE TABLE program ( program_id, name, college, introduction ) CREATE TABLE course ( course_id, name, department, number, credits, advisory_requirement, enforced_requirement, description, num_semesters, num_enrolled, has_discussion, has_lab, has_projects, has_exams, num_reviews, clarity_score, easiness_score, helpfulness_score ) CREATE TABLE student ( student_id, lastname, firstname, program_id, declare_major, total_credit, total_gpa, entered_as, admit_term, predicted_graduation_semester, degree, minor, internship ) CREATE TABLE course_tags_count ( course_id, clear_grading, pop_quiz, group_projects, inspirational, long_lectures, extra_credit, few_tests, good_feedback, tough_tests, heavy_papers, cares_for_students, heavy_assignments, respected, participation, heavy_reading, tough_grader, hilarious, would_take_again, good_lecture, no_skip ) CREATE TABLE jobs ( job_id, job_title, description, requirement, city, state, country, zip ) CREATE TABLE course_prerequisite ( pre_course_id, course_id ) CREATE TABLE comment_instructor ( instructor_id, student_id, score, comment_text ) CREATE TABLE offering_instructor ( offering_instructor_id, offering_id, instructor_id ) CREATE TABLE gsi ( course_offering_id, student_id ) CREATE TABLE student_record ( student_id, course_id, semester, grade, how, transfer_source, earn_credit, repeat_term, test_id ) CREATE TABLE instructor ( instructor_id, name, uniqname ) CREATE TABLE program_requirement ( program_id, category, min_credit, additional_req ) CREATE TABLE semester ( semester_id, semester, year ) CREATE TABLE program_course ( program_id, course_id, workload, category ) CREATE TABLE course_offering ( offering_id, course_id, semester, section_number, start_time, end_time, monday, tuesday, wednesday, thursday, friday, saturday, sunday, has_final_project, has_final_exam, textbook, class_address, allow_audit ) CREATE TABLE requirement ( requirement_id, requirement, college ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What courses has Dr. William Clark lectured in the past ? SELECT### Response: SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor WHERE course_offering.semester < (SELECT SEMESTERalias0.semester_id FROM semester AS SEMESTERalias0 WHERE SEMESTERalias0.semester = 'WN' AND SEMESTERalias0.year = 2016) AND course.course_id = course_offering.course_id AND instructor.name LIKE '%William Clark%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.offering_id.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE flight_leg ( flight_id, leg_number, leg_flight ) CREATE TABLE airline ( airline_code, airline_name, note ) CREATE TABLE fare ( fare_id, from_airport, to_airport, fare_basis_code, fare_airline, restriction_code, one_direction_cost, round_trip_cost, round_trip_required ) CREATE TABLE aircraft ( aircraft_code, aircraft_description, manufacturer, basic_type, engines, propulsion, wide_body, wing_span, length, weight, capacity, pay_load, cruising_speed, range_miles, pressurized ) CREATE TABLE city ( city_code, city_name, state_code, country_name, time_zone_code ) CREATE TABLE dual_carrier ( main_airline, low_flight_number, high_flight_number, dual_airline, service_name ) CREATE TABLE food_service ( meal_code, meal_number, compartment, meal_description ) CREATE TABLE flight_stop ( flight_id, stop_number, stop_days, stop_airport, arrival_time, arrival_airline, arrival_flight_number, departure_time, departure_airline, departure_flight_number, stop_time ) CREATE TABLE code_description ( code, description ) CREATE TABLE fare_basis ( fare_basis_code, booking_class, class_type, premium, economy, discounted, night, season, basis_days ) CREATE TABLE days ( days_code, day_name ) CREATE TABLE airport ( airport_code, airport_name, airport_location, state_code, country_name, time_zone_code, minimum_connect_time ) CREATE TABLE equipment_sequence ( aircraft_code_sequence, aircraft_code ) CREATE TABLE flight_fare ( flight_id, fare_id ) CREATE TABLE class_of_service ( booking_class, rank, class_description ) CREATE TABLE airport_service ( city_code, airport_code, miles_distant, direction, minutes_distant ) CREATE TABLE flight ( aircraft_code_sequence, airline_code, airline_flight, arrival_time, connections, departure_time, dual_carrier, flight_days, flight_id, flight_number, from_airport, meal_code, stops, time_elapsed, to_airport ) CREATE TABLE time_interval ( period, begin_time, end_time ) CREATE TABLE state ( state_code, state_name, country_name ) CREATE TABLE date_day ( month_number, day_number, year, day_name ) CREATE TABLE month ( month_number, month_name ) CREATE TABLE ground_service ( city_code, airport_code, transport_type, ground_fare ) CREATE TABLE time_zone ( time_zone_code, time_zone_name, hours_from_gmt ) CREATE TABLE restriction ( restriction_code, advance_purchase, stopovers, saturday_stay_required, minimum_stay, maximum_stay, application, no_discounts ) CREATE TABLE compartment_class ( compartment, class_type ) -- Using valid SQLite, answer the following questions for the tables provided above. -- does UA have a flight from MIAMI to WASHINGTON on wednesday SELECT### Response: 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, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHINGTON' AND CITY_1.state_code = 'DC' AND date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'MIAMI' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code) AND flight.airline_code = 'UA'.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE gsi ( course_offering_id, student_id ) CREATE TABLE semester ( semester_id, semester, year ) CREATE TABLE course_prerequisite ( pre_course_id, course_id ) CREATE TABLE course ( course_id, name, department, number, credits, advisory_requirement, enforced_requirement, description, num_semesters, num_enrolled, has_discussion, has_lab, has_projects, has_exams, num_reviews, clarity_score, easiness_score, helpfulness_score ) CREATE TABLE program_requirement ( program_id, category, min_credit, additional_req ) CREATE TABLE offering_instructor ( offering_instructor_id, offering_id, instructor_id ) CREATE TABLE course_offering ( offering_id, course_id, semester, section_number, start_time, end_time, monday, tuesday, wednesday, thursday, friday, saturday, sunday, has_final_project, has_final_exam, textbook, class_address, allow_audit ) CREATE TABLE area ( course_id, area ) CREATE TABLE student ( student_id, lastname, firstname, program_id, declare_major, total_credit, total_gpa, entered_as, admit_term, predicted_graduation_semester, degree, minor, internship ) CREATE TABLE instructor ( instructor_id, name, uniqname ) CREATE TABLE program ( program_id, name, college, introduction ) CREATE TABLE program_course ( program_id, course_id, workload, category ) CREATE TABLE course_tags_count ( course_id, clear_grading, pop_quiz, group_projects, inspirational, long_lectures, extra_credit, few_tests, good_feedback, tough_tests, heavy_papers, cares_for_students, heavy_assignments, respected, participation, heavy_reading, tough_grader, hilarious, would_take_again, good_lecture, no_skip ) CREATE TABLE student_record ( student_id, course_id, semester, grade, how, transfer_source, earn_credit, repeat_term, test_id ) CREATE TABLE ta ( campus_job_id, student_id, location ) CREATE TABLE requirement ( requirement_id, requirement, college ) CREATE TABLE jobs ( job_id, job_title, description, requirement, city, state, country, zip ) CREATE TABLE comment_instructor ( instructor_id, student_id, score, comment_text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What grades did I get in class from Prof. Bookstein ? SELECT### Response: SELECT DISTINCT student_record.grade FROM student_record INNER JOIN offering_instructor ON student_record.offering_id = offering_instructor.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE LOWER(instructor.name) LIKE '%Bookstein%' AND student_record.student_id = 1.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE date_day ( month_number, day_number, year, day_name ) CREATE TABLE days ( days_code, day_name ) CREATE TABLE fare ( fare_id, from_airport, to_airport, fare_basis_code, fare_airline, restriction_code, one_direction_cost, round_trip_cost, round_trip_required ) CREATE TABLE state ( state_code, state_name, country_name ) CREATE TABLE airport ( airport_code, airport_name, airport_location, state_code, country_name, time_zone_code, minimum_connect_time ) CREATE TABLE airport_service ( city_code, airport_code, miles_distant, direction, minutes_distant ) CREATE TABLE flight_fare ( flight_id, fare_id ) CREATE TABLE ground_service ( city_code, airport_code, transport_type, ground_fare ) CREATE TABLE time_interval ( period, begin_time, end_time ) CREATE TABLE flight ( aircraft_code_sequence, airline_code, airline_flight, arrival_time, connections, departure_time, dual_carrier, flight_days, flight_id, flight_number, from_airport, meal_code, stops, time_elapsed, to_airport ) CREATE TABLE fare_basis ( fare_basis_code, booking_class, class_type, premium, economy, discounted, night, season, basis_days ) CREATE TABLE restriction ( restriction_code, advance_purchase, stopovers, saturday_stay_required, minimum_stay, maximum_stay, application, no_discounts ) CREATE TABLE month ( month_number, month_name ) CREATE TABLE equipment_sequence ( aircraft_code_sequence, aircraft_code ) CREATE TABLE code_description ( code, description ) CREATE TABLE food_service ( meal_code, meal_number, compartment, meal_description ) CREATE TABLE flight_leg ( flight_id, leg_number, leg_flight ) CREATE TABLE compartment_class ( compartment, class_type ) CREATE TABLE aircraft ( aircraft_code, aircraft_description, manufacturer, basic_type, engines, propulsion, wide_body, wing_span, length, weight, capacity, pay_load, cruising_speed, range_miles, pressurized ) CREATE TABLE dual_carrier ( main_airline, low_flight_number, high_flight_number, dual_airline, service_name ) CREATE TABLE time_zone ( time_zone_code, time_zone_name, hours_from_gmt ) CREATE TABLE flight_stop ( flight_id, stop_number, stop_days, stop_airport, arrival_time, arrival_airline, arrival_flight_number, departure_time, departure_airline, departure_flight_number, stop_time ) CREATE TABLE airline ( airline_code, airline_name, note ) CREATE TABLE city ( city_code, city_name, state_code, country_name, time_zone_code ) CREATE TABLE class_of_service ( booking_class, rank, class_description ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what flights are there wednesday morning from ATLANTA to PHILADELPHIA SELECT### Response: 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, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' AND date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code) AND flight.departure_time BETWEEN 0 AND 1200.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE genre ( gid, genre ) CREATE TABLE classification ( id, msid, gid ) CREATE TABLE company ( id, name, country_code ) CREATE TABLE tv_series ( sid, title, release_year, num_of_seasons, num_of_episodes, title_aka, budget ) CREATE TABLE cast ( id, msid, aid, role ) CREATE TABLE tags ( id, msid, kid ) CREATE TABLE directed_by ( id, msid, did ) CREATE TABLE copyright ( id, msid, cid ) CREATE TABLE written_by ( id, msid, wid ) CREATE TABLE actor ( aid, gender, name, nationality, birth_city, birth_year ) CREATE TABLE director ( did, gender, name, nationality, birth_city, birth_year ) CREATE TABLE movie ( mid, title, release_year, title_aka, budget ) CREATE TABLE made_by ( id, msid, pid ) CREATE TABLE writer ( wid, gender, name, nationality, birth_city, birth_year ) CREATE TABLE producer ( pid, gender, name, nationality, birth_city, birth_year ) CREATE TABLE keyword ( id, keyword ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which company funded the ' Mickey Mouse ' series SELECT### Response: SELECT company.name FROM company, copyright, tv_series WHERE copyright.cid = company.id AND tv_series.sid = copyright.msid AND tv_series.title = 'Mickey Mouse'.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE author ( authorid, authorname ) CREATE TABLE keyphrase ( keyphraseid, keyphrasename ) CREATE TABLE cite ( citingpaperid, citedpaperid ) CREATE TABLE paper ( paperid, title, venueid, year, numciting, numcitedby, journalid ) CREATE TABLE venue ( venueid, venuename ) CREATE TABLE journal ( journalid, journalname ) CREATE TABLE paperfield ( fieldid, paperid ) CREATE TABLE writes ( paperid, authorid ) CREATE TABLE paperkeyphrase ( paperid, keyphraseid ) CREATE TABLE paperdataset ( paperid, datasetid ) CREATE TABLE field ( fieldid ) CREATE TABLE dataset ( datasetid, datasetname ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are keyphrases by Christof Dallermassl in 2000 ? SELECT### Response: SELECT DISTINCT paperkeyphrase.keyphraseid FROM author, paper, paperkeyphrase, writes WHERE author.authorname = 'Christof Dallermassl' AND paper.paperid = paperkeyphrase.paperid AND paper.year = 2000 AND writes.authorid = author.authorid AND writes.paperid = paper.paperid.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE airport ( airport_code, airport_name, airport_location, state_code, country_name, time_zone_code, minimum_connect_time ) CREATE TABLE dual_carrier ( main_airline, low_flight_number, high_flight_number, dual_airline, service_name ) CREATE TABLE time_zone ( time_zone_code, time_zone_name, hours_from_gmt ) CREATE TABLE airport_service ( city_code, airport_code, miles_distant, direction, minutes_distant ) CREATE TABLE time_interval ( period, begin_time, end_time ) CREATE TABLE flight_fare ( flight_id, fare_id ) CREATE TABLE flight_leg ( flight_id, leg_number, leg_flight ) CREATE TABLE ground_service ( city_code, airport_code, transport_type, ground_fare ) CREATE TABLE days ( days_code, day_name ) CREATE TABLE aircraft ( aircraft_code, aircraft_description, manufacturer, basic_type, engines, propulsion, wide_body, wing_span, length, weight, capacity, pay_load, cruising_speed, range_miles, pressurized ) CREATE TABLE code_description ( code, description ) CREATE TABLE date_day ( month_number, day_number, year, day_name ) CREATE TABLE month ( month_number, month_name ) CREATE TABLE equipment_sequence ( aircraft_code_sequence, aircraft_code ) CREATE TABLE city ( city_code, city_name, state_code, country_name, time_zone_code ) CREATE TABLE fare ( fare_id, from_airport, to_airport, fare_basis_code, fare_airline, restriction_code, one_direction_cost, round_trip_cost, round_trip_required ) CREATE TABLE flight ( aircraft_code_sequence, airline_code, airline_flight, arrival_time, connections, departure_time, dual_carrier, flight_days, flight_id, flight_number, from_airport, meal_code, stops, time_elapsed, to_airport ) CREATE TABLE state ( state_code, state_name, country_name ) CREATE TABLE restriction ( restriction_code, advance_purchase, stopovers, saturday_stay_required, minimum_stay, maximum_stay, application, no_discounts ) CREATE TABLE class_of_service ( booking_class, rank, class_description ) CREATE TABLE fare_basis ( fare_basis_code, booking_class, class_type, premium, economy, discounted, night, season, basis_days ) CREATE TABLE compartment_class ( compartment, class_type ) CREATE TABLE flight_stop ( flight_id, stop_number, stop_days, stop_airport, arrival_time, arrival_airline, arrival_flight_number, departure_time, departure_airline, departure_flight_number, stop_time ) CREATE TABLE airline ( airline_code, airline_name, note ) CREATE TABLE food_service ( meal_code, meal_number, compartment, meal_description ) -- Using valid SQLite, answer the following questions for the tables provided above. -- is there ground transportation in ST. LOUIS SELECT### Response: SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'ST. LOUIS' AND ground_service.city_code = city.city_code.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE food_service ( meal_code, meal_number, compartment, meal_description ) CREATE TABLE flight_stop ( flight_id, stop_number, stop_days, stop_airport, arrival_time, arrival_airline, arrival_flight_number, departure_time, departure_airline, departure_flight_number, stop_time ) CREATE TABLE equipment_sequence ( aircraft_code_sequence, aircraft_code ) CREATE TABLE restriction ( restriction_code, advance_purchase, stopovers, saturday_stay_required, minimum_stay, maximum_stay, application, no_discounts ) CREATE TABLE state ( state_code, state_name, country_name ) CREATE TABLE city ( city_code, city_name, state_code, country_name, time_zone_code ) CREATE TABLE code_description ( code, description ) CREATE TABLE time_interval ( period, begin_time, end_time ) CREATE TABLE date_day ( month_number, day_number, year, day_name ) CREATE TABLE flight_fare ( flight_id, fare_id ) CREATE TABLE time_zone ( time_zone_code, time_zone_name, hours_from_gmt ) CREATE TABLE aircraft ( aircraft_code, aircraft_description, manufacturer, basic_type, engines, propulsion, wide_body, wing_span, length, weight, capacity, pay_load, cruising_speed, range_miles, pressurized ) CREATE TABLE airport ( airport_code, airport_name, airport_location, state_code, country_name, time_zone_code, minimum_connect_time ) CREATE TABLE fare_basis ( fare_basis_code, booking_class, class_type, premium, economy, discounted, night, season, basis_days ) CREATE TABLE compartment_class ( compartment, class_type ) CREATE TABLE fare ( fare_id, from_airport, to_airport, fare_basis_code, fare_airline, restriction_code, one_direction_cost, round_trip_cost, round_trip_required ) CREATE TABLE dual_carrier ( main_airline, low_flight_number, high_flight_number, dual_airline, service_name ) CREATE TABLE flight_leg ( flight_id, leg_number, leg_flight ) CREATE TABLE airline ( airline_code, airline_name, note ) CREATE TABLE class_of_service ( booking_class, rank, class_description ) CREATE TABLE days ( days_code, day_name ) CREATE TABLE ground_service ( city_code, airport_code, transport_type, ground_fare ) CREATE TABLE month ( month_number, month_name ) CREATE TABLE airport_service ( city_code, airport_code, miles_distant, direction, minutes_distant ) CREATE TABLE flight ( aircraft_code_sequence, airline_code, airline_flight, arrival_time, connections, departure_time, dual_carrier, flight_days, flight_id, flight_number, from_airport, meal_code, stops, time_elapsed, to_airport ) -- Using valid SQLite, answer the following questions for the tables provided above. -- i'd like to find a US flight from ORLANDO to CLEVELAND that arrives around 10 o'clock in the evening SELECT### Response: 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 (((flight.arrival_time <= 2230 AND flight.arrival_time >= 2130) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CLEVELAND' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ORLANDO' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code) AND flight.airline_code = 'US'.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE flight_fare ( flight_id, fare_id ) CREATE TABLE month ( month_number, month_name ) CREATE TABLE dual_carrier ( main_airline, low_flight_number, high_flight_number, dual_airline, service_name ) CREATE TABLE fare ( fare_id, from_airport, to_airport, fare_basis_code, fare_airline, restriction_code, one_direction_cost, round_trip_cost, round_trip_required ) CREATE TABLE flight ( aircraft_code_sequence, airline_code, airline_flight, arrival_time, connections, departure_time, dual_carrier, flight_days, flight_id, flight_number, from_airport, meal_code, stops, time_elapsed, to_airport ) CREATE TABLE aircraft ( aircraft_code, aircraft_description, manufacturer, basic_type, engines, propulsion, wide_body, wing_span, length, weight, capacity, pay_load, cruising_speed, range_miles, pressurized ) CREATE TABLE date_day ( month_number, day_number, year, day_name ) CREATE TABLE state ( state_code, state_name, country_name ) CREATE TABLE ground_service ( city_code, airport_code, transport_type, ground_fare ) CREATE TABLE compartment_class ( compartment, class_type ) CREATE TABLE time_zone ( time_zone_code, time_zone_name, hours_from_gmt ) CREATE TABLE flight_leg ( flight_id, leg_number, leg_flight ) CREATE TABLE time_interval ( period, begin_time, end_time ) CREATE TABLE class_of_service ( booking_class, rank, class_description ) CREATE TABLE food_service ( meal_code, meal_number, compartment, meal_description ) CREATE TABLE airport ( airport_code, airport_name, airport_location, state_code, country_name, time_zone_code, minimum_connect_time ) CREATE TABLE code_description ( code, description ) CREATE TABLE city ( city_code, city_name, state_code, country_name, time_zone_code ) CREATE TABLE fare_basis ( fare_basis_code, booking_class, class_type, premium, economy, discounted, night, season, basis_days ) CREATE TABLE airport_service ( city_code, airport_code, miles_distant, direction, minutes_distant ) CREATE TABLE flight_stop ( flight_id, stop_number, stop_days, stop_airport, arrival_time, arrival_airline, arrival_flight_number, departure_time, departure_airline, departure_flight_number, stop_time ) CREATE TABLE airline ( airline_code, airline_name, note ) CREATE TABLE equipment_sequence ( aircraft_code_sequence, aircraft_code ) CREATE TABLE days ( days_code, day_name ) CREATE TABLE restriction ( restriction_code, advance_purchase, stopovers, saturday_stay_required, minimum_stay, maximum_stay, application, no_discounts ) -- Using valid SQLite, answer the following questions for the tables provided above. -- can you show me the list of flights that fly from WASHINGTON to SAN FRANCISCO via DALLAS SELECT### Response: SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND CITY_2.city_code = AIRPORT_SERVICE_2.city_code AND CITY_2.city_name = 'DALLAS' AND flight_stop.stop_airport = AIRPORT_SERVICE_2.airport_code AND flight.flight_id = flight_stop.flight_id AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'WASHINGTON' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE restriction ( restriction_code, advance_purchase, stopovers, saturday_stay_required, minimum_stay, maximum_stay, application, no_discounts ) CREATE TABLE time_interval ( period, begin_time, end_time ) CREATE TABLE flight_leg ( flight_id, leg_number, leg_flight ) CREATE TABLE airport_service ( city_code, airport_code, miles_distant, direction, minutes_distant ) CREATE TABLE month ( month_number, month_name ) CREATE TABLE ground_service ( city_code, airport_code, transport_type, ground_fare ) CREATE TABLE city ( city_code, city_name, state_code, country_name, time_zone_code ) CREATE TABLE flight_fare ( flight_id, fare_id ) CREATE TABLE state ( state_code, state_name, country_name ) CREATE TABLE fare ( fare_id, from_airport, to_airport, fare_basis_code, fare_airline, restriction_code, one_direction_cost, round_trip_cost, round_trip_required ) CREATE TABLE food_service ( meal_code, meal_number, compartment, meal_description ) CREATE TABLE equipment_sequence ( aircraft_code_sequence, aircraft_code ) CREATE TABLE fare_basis ( fare_basis_code, booking_class, class_type, premium, economy, discounted, night, season, basis_days ) CREATE TABLE class_of_service ( booking_class, rank, class_description ) CREATE TABLE airline ( airline_code, airline_name, note ) CREATE TABLE aircraft ( aircraft_code, aircraft_description, manufacturer, basic_type, engines, propulsion, wide_body, wing_span, length, weight, capacity, pay_load, cruising_speed, range_miles, pressurized ) CREATE TABLE compartment_class ( compartment, class_type ) CREATE TABLE airport ( airport_code, airport_name, airport_location, state_code, country_name, time_zone_code, minimum_connect_time ) CREATE TABLE flight_stop ( flight_id, stop_number, stop_days, stop_airport, arrival_time, arrival_airline, arrival_flight_number, departure_time, departure_airline, departure_flight_number, stop_time ) CREATE TABLE code_description ( code, description ) CREATE TABLE dual_carrier ( main_airline, low_flight_number, high_flight_number, dual_airline, service_name ) CREATE TABLE time_zone ( time_zone_code, time_zone_name, hours_from_gmt ) CREATE TABLE days ( days_code, day_name ) CREATE TABLE date_day ( month_number, day_number, year, day_name ) CREATE TABLE flight ( aircraft_code_sequence, airline_code, airline_flight, arrival_time, connections, departure_time, dual_carrier, flight_days, flight_id, flight_number, from_airport, meal_code, stops, time_elapsed, to_airport ) -- Using valid SQLite, answer the following questions for the tables provided above. -- flight from MILWAUKEE to DENVER SELECT### Response: 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 = 'MILWAUKEE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE restriction ( restriction_code, advance_purchase, stopovers, saturday_stay_required, minimum_stay, maximum_stay, application, no_discounts ) CREATE TABLE dual_carrier ( main_airline, low_flight_number, high_flight_number, dual_airline, service_name ) CREATE TABLE days ( days_code, day_name ) CREATE TABLE airport ( airport_code, airport_name, airport_location, state_code, country_name, time_zone_code, minimum_connect_time ) CREATE TABLE code_description ( code, description ) CREATE TABLE airline ( airline_code, airline_name, note ) CREATE TABLE aircraft ( aircraft_code, aircraft_description, manufacturer, basic_type, engines, propulsion, wide_body, wing_span, length, weight, capacity, pay_load, cruising_speed, range_miles, pressurized ) CREATE TABLE food_service ( meal_code, meal_number, compartment, meal_description ) CREATE TABLE flight_stop ( flight_id, stop_number, stop_days, stop_airport, arrival_time, arrival_airline, arrival_flight_number, departure_time, departure_airline, departure_flight_number, stop_time ) CREATE TABLE fare ( fare_id, from_airport, to_airport, fare_basis_code, fare_airline, restriction_code, one_direction_cost, round_trip_cost, round_trip_required ) CREATE TABLE equipment_sequence ( aircraft_code_sequence, aircraft_code ) CREATE TABLE ground_service ( city_code, airport_code, transport_type, ground_fare ) CREATE TABLE date_day ( month_number, day_number, year, day_name ) CREATE TABLE fare_basis ( fare_basis_code, booking_class, class_type, premium, economy, discounted, night, season, basis_days ) CREATE TABLE class_of_service ( booking_class, rank, class_description ) CREATE TABLE flight_fare ( flight_id, fare_id ) CREATE TABLE time_zone ( time_zone_code, time_zone_name, hours_from_gmt ) CREATE TABLE airport_service ( city_code, airport_code, miles_distant, direction, minutes_distant ) CREATE TABLE flight_leg ( flight_id, leg_number, leg_flight ) CREATE TABLE flight ( aircraft_code_sequence, airline_code, airline_flight, arrival_time, connections, departure_time, dual_carrier, flight_days, flight_id, flight_number, from_airport, meal_code, stops, time_elapsed, to_airport ) CREATE TABLE state ( state_code, state_name, country_name ) CREATE TABLE month ( month_number, month_name ) CREATE TABLE time_interval ( period, begin_time, end_time ) CREATE TABLE city ( city_code, city_name, state_code, country_name, time_zone_code ) CREATE TABLE compartment_class ( compartment, class_type ) -- Using valid SQLite, answer the following questions for the tables provided above. -- show me all the flights that go from BALTIMORE to SEATTLE SELECT### Response: 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 = 'SEATTLE' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE geographic ( city_name, county, region ) CREATE TABLE location ( restaurant_id, house_number, street_name, city_name ) CREATE TABLE restaurant ( id, name, food_type, city_name, rating ) -- Using valid SQLite, answer the following questions for the tables provided above. -- where can we find a restaurant in alameda ? SELECT### Response: SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'alameda' AND restaurant.id = location.restaurant_id.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE ground_service ( city_code, airport_code, transport_type, ground_fare ) CREATE TABLE time_interval ( period, begin_time, end_time ) CREATE TABLE dual_carrier ( main_airline, low_flight_number, high_flight_number, dual_airline, service_name ) CREATE TABLE airport ( airport_code, airport_name, airport_location, state_code, country_name, time_zone_code, minimum_connect_time ) CREATE TABLE fare_basis ( fare_basis_code, booking_class, class_type, premium, economy, discounted, night, season, basis_days ) CREATE TABLE month ( month_number, month_name ) CREATE TABLE equipment_sequence ( aircraft_code_sequence, aircraft_code ) CREATE TABLE flight_stop ( flight_id, stop_number, stop_days, stop_airport, arrival_time, arrival_airline, arrival_flight_number, departure_time, departure_airline, departure_flight_number, stop_time ) CREATE TABLE flight ( aircraft_code_sequence, airline_code, airline_flight, arrival_time, connections, departure_time, dual_carrier, flight_days, flight_id, flight_number, from_airport, meal_code, stops, time_elapsed, to_airport ) CREATE TABLE compartment_class ( compartment, class_type ) CREATE TABLE time_zone ( time_zone_code, time_zone_name, hours_from_gmt ) CREATE TABLE airport_service ( city_code, airport_code, miles_distant, direction, minutes_distant ) CREATE TABLE code_description ( code, description ) CREATE TABLE fare ( fare_id, from_airport, to_airport, fare_basis_code, fare_airline, restriction_code, one_direction_cost, round_trip_cost, round_trip_required ) CREATE TABLE airline ( airline_code, airline_name, note ) CREATE TABLE state ( state_code, state_name, country_name ) CREATE TABLE flight_fare ( flight_id, fare_id ) CREATE TABLE aircraft ( aircraft_code, aircraft_description, manufacturer, basic_type, engines, propulsion, wide_body, wing_span, length, weight, capacity, pay_load, cruising_speed, range_miles, pressurized ) CREATE TABLE city ( city_code, city_name, state_code, country_name, time_zone_code ) CREATE TABLE food_service ( meal_code, meal_number, compartment, meal_description ) CREATE TABLE days ( days_code, day_name ) CREATE TABLE restriction ( restriction_code, advance_purchase, stopovers, saturday_stay_required, minimum_stay, maximum_stay, application, no_discounts ) CREATE TABLE flight_leg ( flight_id, leg_number, leg_flight ) CREATE TABLE date_day ( month_number, day_number, year, day_name ) CREATE TABLE class_of_service ( booking_class, rank, class_description ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the least expensive flight today from ATLANTA to SAN FRANCISCO SELECT### Response: SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, airport_service AS AIRPORT_SERVICE_3, city AS CITY_0, city AS CITY_1, city AS CITY_2, city AS CITY_3, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE ((((CITY_3.city_code = AIRPORT_SERVICE_3.city_code AND CITY_3.city_name = 'SAN FRANCISCO' AND DATE_DAY_1.day_number = 9 AND DATE_DAY_1.month_number = 9 AND DATE_DAY_1.year = 1991 AND DAYS_1.day_name = DATE_DAY_1.day_name AND fare_basis.basis_days = DAYS_1.days_code AND fare.fare_basis_code = fare_basis.fare_basis_code AND fare.to_airport = AIRPORT_SERVICE_3.airport_code) AND CITY_2.city_code = AIRPORT_SERVICE_2.city_code AND CITY_2.city_name = 'ATLANTA' AND fare.from_airport = AIRPORT_SERVICE_2.airport_code) AND DATE_DAY_0.day_number = 9 AND DATE_DAY_0.month_number = 9 AND DATE_DAY_0.year = 1991 AND DAYS_0.day_name = DATE_DAY_0.day_name AND fare.one_direction_cost = (SELECT MIN(FAREalias1.one_direction_cost) FROM airport_service AS AIRPORT_SERVICEalias4, airport_service AS AIRPORT_SERVICEalias5, city AS CITYalias4, city AS CITYalias5, date_day AS DATE_DAYalias2, days AS DAYSalias2, fare AS FAREalias1, fare_basis AS FARE_BASISalias1 WHERE (CITYalias5.city_code = AIRPORT_SERVICEalias5.city_code AND CITYalias5.city_name = 'SAN FRANCISCO' AND DATE_DAYalias2.day_number = 9 AND DATE_DAYalias2.month_number = 9 AND DATE_DAYalias2.year = 1991 AND DAYSalias2.day_name = DATE_DAYalias2.day_name AND FARE_BASISalias1.basis_days = DAYSalias2.days_code AND FAREalias1.fare_basis_code = FARE_BASISalias1.fare_basis_code AND FAREalias1.to_airport = AIRPORT_SERVICEalias5.airport_code) AND CITYalias4.city_code = AIRPORT_SERVICEalias4.city_code AND CITYalias4.city_name = 'ATLANTA' AND FAREalias1.from_airport = AIRPORT_SERVICEalias4.airport_code) AND flight_fare.fare_id = fare.fare_id AND flight.flight_days = DAYS_0.days_code AND flight.flight_id = flight_fare.flight_id) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE days ( days_code, day_name ) CREATE TABLE dual_carrier ( main_airline, low_flight_number, high_flight_number, dual_airline, service_name ) CREATE TABLE ground_service ( city_code, airport_code, transport_type, ground_fare ) CREATE TABLE time_interval ( period, begin_time, end_time ) CREATE TABLE restriction ( restriction_code, advance_purchase, stopovers, saturday_stay_required, minimum_stay, maximum_stay, application, no_discounts ) CREATE TABLE city ( city_code, city_name, state_code, country_name, time_zone_code ) CREATE TABLE food_service ( meal_code, meal_number, compartment, meal_description ) CREATE TABLE airport_service ( city_code, airport_code, miles_distant, direction, minutes_distant ) CREATE TABLE airline ( airline_code, airline_name, note ) CREATE TABLE flight_fare ( flight_id, fare_id ) CREATE TABLE flight_stop ( flight_id, stop_number, stop_days, stop_airport, arrival_time, arrival_airline, arrival_flight_number, departure_time, departure_airline, departure_flight_number, stop_time ) CREATE TABLE state ( state_code, state_name, country_name ) CREATE TABLE equipment_sequence ( aircraft_code_sequence, aircraft_code ) CREATE TABLE flight_leg ( flight_id, leg_number, leg_flight ) CREATE TABLE month ( month_number, month_name ) CREATE TABLE fare ( fare_id, from_airport, to_airport, fare_basis_code, fare_airline, restriction_code, one_direction_cost, round_trip_cost, round_trip_required ) CREATE TABLE compartment_class ( compartment, class_type ) CREATE TABLE class_of_service ( booking_class, rank, class_description ) CREATE TABLE airport ( airport_code, airport_name, airport_location, state_code, country_name, time_zone_code, minimum_connect_time ) CREATE TABLE time_zone ( time_zone_code, time_zone_name, hours_from_gmt ) CREATE TABLE code_description ( code, description ) CREATE TABLE aircraft ( aircraft_code, aircraft_description, manufacturer, basic_type, engines, propulsion, wide_body, wing_span, length, weight, capacity, pay_load, cruising_speed, range_miles, pressurized ) CREATE TABLE flight ( aircraft_code_sequence, airline_code, airline_flight, arrival_time, connections, departure_time, dual_carrier, flight_days, flight_id, flight_number, from_airport, meal_code, stops, time_elapsed, to_airport ) CREATE TABLE fare_basis ( fare_basis_code, booking_class, class_type, premium, economy, discounted, night, season, basis_days ) CREATE TABLE date_day ( month_number, day_number, year, day_name ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the number of FIRST class flights on AA SELECT### Response: SELECT COUNT(DISTINCT flight.flight_id) FROM fare, fare_basis, flight, flight_fare WHERE fare_basis.class_type = 'FIRST' AND fare.fare_basis_code = fare_basis.fare_basis_code AND flight_fare.fare_id = fare.fare_id AND flight.airline_code = 'AA' AND flight.flight_id = flight_fare.flight_id.