text
stringlengths 432
6.49k
| target
stringlengths 2
4.44k
|
---|---|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_16 (Id VARCHAR)
### Question ###
What shows for 2013 when 2012 is 2r?
### Accurate SQL ###
| SELECT 2013 FROM table_name_16 WHERE 2012 = "2r" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_28 (fineness VARCHAR, year INTEGER)
### Question ###
What was the fineness prior to 2007?
### Accurate SQL ###
| SELECT fineness FROM table_name_28 WHERE year < 2007 |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_29810 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real, "U.S. viewers (millions)" text )
### Question ###
who put on the show where the numbers were 227412
### Accurate SQL ###
| SELECT "Directed by" FROM table_29810 WHERE "Production code" = '227412' |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text )
TABLE: CREATE TABLE airline ( airline_code varchar, airline_name text, note text )
TABLE: CREATE TABLE flight_fare ( flight_id int, fare_id int )
TABLE: CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int )
TABLE: CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar )
TABLE: CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_miles int, pressurized varchar )
TABLE: CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int )
TABLE: CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text )
TABLE: CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int )
TABLE: CREATE TABLE days ( days_code varchar, day_name varchar )
TABLE: CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar )
TABLE: CREATE TABLE month ( month_number int, month_name text )
TABLE: CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar )
TABLE: CREATE TABLE code_description ( code varchar, description text )
TABLE: CREATE TABLE time_interval ( period text, begin_time int, end_time int )
TABLE: CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departure_flight_number int, stop_time int )
TABLE: CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar )
TABLE: CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text )
TABLE: CREATE TABLE state ( state_code text, state_name text, country_name text )
TABLE: CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int )
TABLE: CREATE TABLE compartment_class ( compartment varchar, class_type varchar )
TABLE: CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops int, time_elapsed int, to_airport varchar )
TABLE: CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar )
TABLE: CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text )
TABLE: CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int )
### Question ###
i would like to leave early in the morning
### Accurate SQL ###
| SELECT DISTINCT flight_id FROM flight WHERE departure_time BETWEEN 0 AND 800 |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_45 (position INTEGER, losses VARCHAR, played VARCHAR)
### Question ###
Which Position has Losses of 11, and a Played larger than 22?
### Accurate SQL ###
| SELECT SUM(position) FROM table_name_45 WHERE losses = 11 AND played > 22 |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time )
TABLE: CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text )
TABLE: CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time )
TABLE: CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time )
TABLE: CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number )
TABLE: CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time )
TABLE: CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text )
TABLE: CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number )
TABLE: CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time )
TABLE: CREATE TABLE d_labitems ( row_id number, itemid number, label text )
TABLE: CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number )
TABLE: CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text )
TABLE: CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text )
TABLE: CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text )
TABLE: CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text )
TABLE: CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number )
TABLE: CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text )
### Question ###
in the first hospital encounter, have there been any microbiology tests conducted for patient 59002?
### Accurate SQL ###
| SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 59002 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_12 (event VARCHAR, method VARCHAR)
### Question ###
Which event had a decision method?
### Accurate SQL ###
| SELECT event FROM table_name_12 WHERE method = "decision" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_30011_2 (equivalent VARCHAR, example VARCHAR)
### Question ###
What is every equivalent for the example of asy28?
### Accurate SQL ###
| SELECT equivalent FROM table_30011_2 WHERE example = "ASY28" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_26 (record VARCHAR, location_attendance VARCHAR)
### Question ###
What was the season record when the location attendance was Air Canada Centre 19,800?
### Accurate SQL ###
| SELECT record FROM table_name_26 WHERE location_attendance = "air canada centre 19,800" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_2214582_3 (home_leg VARCHAR, opponents VARCHAR)
### Question ###
What was the home leg score against partizani tirana?
### Accurate SQL ###
| SELECT home_leg FROM table_2214582_3 WHERE opponents = "Partizani Tirana" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_16235 ( "Pick #" real, "NFL Team" text, "Player" text, "Position" text, "College" text )
### Question ###
what's the position where player is anthony blaylock
### Accurate SQL ###
| SELECT "Position" FROM table_16235 WHERE "Player" = 'Anthony Blaylock' |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_22669375_1 ( location VARCHAR, race_name VARCHAR )
### Question ###
Name the location for trenton 300
### Accurate SQL ###
| SELECT location FROM table_22669375_1 WHERE race_name = "Trenton 300" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE appellations ( No INTEGER, Appelation TEXT, County TEXT, State TEXT, Area TEXT, isAVA TEXT )
TABLE: CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT )
TABLE: CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases INTEGER, Drink TEXT )
### Question ###
Visualize a bar chart about the number of winery of the wines whose price is bigger than 100, sort bars from high to low order please.
### Accurate SQL ###
| SELECT Winery, COUNT(Winery) FROM wine WHERE Price > 100 GROUP BY Winery ORDER BY Winery DESC |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_41402 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text )
### Question ###
By how many strokes did Lema beat Jack Nicklaus?
### Accurate SQL ###
| SELECT "Margin of victory" FROM table_41402 WHERE "Runner(s)-up" = 'jack nicklaus' |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_65461 ( "Pick" real, "Team" text, "Player" text, "Position" text, "College" text )
### Question ###
What pick number did the linebacker from the denver broncos get?
### Accurate SQL ###
| SELECT "Pick" FROM table_65461 WHERE "Position" = 'linebacker' AND "Team" = 'denver broncos' |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_49674 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" text )
### Question ###
how many times is the chassis brabham bt33?
### Accurate SQL ###
| SELECT COUNT("Year") FROM table_49674 WHERE "Chassis" = 'brabham bt33' |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_32931 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
### Question ###
What was the Away team score against a home team with 5.12 (42)?
### Accurate SQL ###
| SELECT "Away team score" FROM table_32931 WHERE "Home team score" = '5.12 (42)' |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_57 (fa_cup INTEGER, league VARCHAR, total VARCHAR, fa_trophy VARCHAR)
### Question ###
What is the average number of goals scored in the FA Cup among players that have more than 20 total goals, less than 1 FA Trophy goals, and less than 25 league goals?
### Accurate SQL ###
| SELECT AVG(fa_cup) FROM table_name_57 WHERE total > 20 AND fa_trophy < 1 AND league < 25 |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_17974 ( "Value" text, "Diameter" text, "Thickness" text, "Mass" text, "Composition" text, "Edge" text, "Obverse" text, "Reverse" text, "first minting" real, "issue" text, "withdrawal" text, "lapse" text )
### Question ###
What material is made with a rounded, plain edge?
### Accurate SQL ###
| SELECT "Composition" FROM table_17974 WHERE "Edge" = 'Rounded, plain' |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
TABLE: CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text )
TABLE: CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
TABLE: CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text )
TABLE: CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text )
### Question ###
calculate the maximum age of emergency hospital admission patients who died before 2173.
### Accurate SQL ###
| SELECT MAX(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.dod_year < "2173.0" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_17510803_2 ( club VARCHAR, points VARCHAR )
### Question ###
How many clubs have 62 points?
### Accurate SQL ###
| SELECT COUNT(club) FROM table_17510803_2 WHERE points = "62" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_204_301 ( id number, "nationality" text, "name" text, "term as a deputy judge" text, "reason for termination" text )
### Question ###
did yugoslavia have more , less , or equal deputy judges to china ?
### Accurate SQL ###
| SELECT (SELECT COUNT("name") FROM table_204_301 WHERE "nationality" = 'yugoslavia') > (SELECT COUNT("name") FROM table_204_301 WHERE "nationality" = 'china') |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_18 (userpics_free VARCHAR, name VARCHAR, registration VARCHAR, yearly_cost_for_paid_account VARCHAR)
### Question ###
What is Userpics Free, when Registration is Open, when Yearly Cost For Paid Account is "unknown", and when Name is Kraslan?
### Accurate SQL ###
| SELECT userpics_free FROM table_name_18 WHERE registration = "open" AND yearly_cost_for_paid_account = "unknown" AND name = "kraslan" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_11251601_2 (percentage_of_global_total VARCHAR, carbon_dioxide_emissions_per_year__tons_per_person___2007_ VARCHAR)
### Question ###
HOW MUCH IS THE PERCENTAGE OF GLOBAL TOTAL EMISSIONS IN THE COUNTRY THAT PRODUCED 4.9 TONS PER PERSON IN 2007?
### Accurate SQL ###
| SELECT percentage_of_global_total FROM table_11251601_2 WHERE carbon_dioxide_emissions_per_year__tons_per_person___2007_ = "4.9" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_63 ( engine VARCHAR, team VARCHAR )
### Question ###
What engine does the Tasman Motorsports team have?
### Accurate SQL ###
| SELECT engine FROM table_name_63 WHERE team = "tasman motorsports" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_54 ( name VARCHAR, position VARCHAR )
### Question ###
what is the name of the player that played position 3b?
### Accurate SQL ###
| SELECT name FROM table_name_54 WHERE position = "3b" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar )
TABLE: CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int )
TABLE: CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_projects varchar, has_exams varchar, num_reviews int, clarity_score int, easiness_score int, helpfulness_score int )
TABLE: CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_project varchar, has_final_exam varchar, textbook varchar, class_address varchar, allow_audit varchar )
TABLE: CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar )
TABLE: CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar )
TABLE: CREATE TABLE ta ( campus_job_id int, student_id int, location varchar )
TABLE: CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int )
TABLE: CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar )
TABLE: CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments int, respected int, participation int, heavy_reading int, tough_grader int, hilarious int, would_take_again int, good_lecture int, no_skip int )
TABLE: CREATE TABLE area ( course_id int, area varchar )
TABLE: CREATE TABLE gsi ( course_offering_id int, student_id int )
TABLE: CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar )
TABLE: CREATE TABLE course_prerequisite ( pre_course_id int, course_id int )
TABLE: CREATE TABLE semester ( semester_id int, semester varchar, year int )
TABLE: CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar )
TABLE: CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varchar )
TABLE: CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar )
### Question ###
Can you state what classes Dr. Thore Bergman taught in the past ?
### Accurate SQL ###
| 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 '%Thore Bergman%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.offering_id |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int )
TABLE: CREATE TABLE compartment_class ( compartment varchar, class_type varchar )
TABLE: CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text )
TABLE: CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar )
TABLE: CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar )
TABLE: CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int )
TABLE: CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int )
TABLE: CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar )
TABLE: CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int )
TABLE: CREATE TABLE state ( state_code text, state_name text, country_name text )
TABLE: CREATE TABLE month ( month_number int, month_name text )
TABLE: CREATE TABLE airline ( airline_code varchar, airline_name text, note text )
TABLE: CREATE TABLE time_interval ( period text, begin_time int, end_time int )
TABLE: CREATE TABLE days ( days_code varchar, day_name varchar )
TABLE: CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar )
TABLE: CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar )
TABLE: CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departure_flight_number int, stop_time int )
TABLE: CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text )
TABLE: CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text )
TABLE: CREATE TABLE flight_fare ( flight_id int, fare_id int )
TABLE: CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_miles int, pressurized varchar )
TABLE: CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int )
TABLE: CREATE TABLE code_description ( code varchar, description text )
TABLE: CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops int, time_elapsed int, to_airport varchar )
TABLE: CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text )
### Question ###
what is the lowest fare from DENVER to PITTSBURGH
### Accurate SQL ###
| 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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' 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 = 'DENVER' AND CITYalias3.city_code = AIRPORT_SERVICEalias3.city_code AND CITYalias3.city_name = 'PITTSBURGH' 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 the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_3930 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
### Question ###
Who performed the most rebounds on games against the Minnesota Timberwolves?
### Accurate SQL ###
| SELECT "High rebounds" FROM table_3930 WHERE "Team" = 'Minnesota Timberwolves' |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_62318 ( "Golden Rivers" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real )
### Question ###
What is the average Wins, when Against is less than 1786, when Losses is less than 4, and when Byes is less than 2?
### Accurate SQL ###
| SELECT AVG("Wins") FROM table_62318 WHERE "Against" < '1786' AND "Losses" < '4' AND "Byes" < '2' |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_45812 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
### Question ###
The golfer Jeff Sluman golfs for what country?
### Accurate SQL ###
| SELECT "Country" FROM table_45812 WHERE "Player" = 'jeff sluman' |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_62 ( cuts_made INTEGER, tournament VARCHAR, events VARCHAR )
### Question ###
What was the cuts average in tournament totals in an event larger than 24?
### Accurate SQL ###
| SELECT AVG(cuts_made) FROM table_name_62 WHERE tournament = "totals" AND events > 24 |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_45750 ( "SCHOOL" text, "LOCATION" text, "PUBS. 2010" real, "TOTALS 06-10" real, "RANK 06-10" real, "PUBS 2011" real, "TOTALS 07-11" real, "RANK 07-11" real, "WORLD RANKING" text )
### Question ###
What is the average PUBS 11 value in Mumbai, which has a 07-11 totals less than 1025?
### Accurate SQL ###
| SELECT AVG("PUBS 2011") FROM table_45750 WHERE "LOCATION" = 'mumbai' AND "TOTALS 07-11" < '1025' |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_11638 ( "Route Name" text, "Direction" text, "Termini" text, "Junctions" text, "Length" text, "Population Area" text, "Remarks" text )
### Question ###
What is the length of the highway with the route name sh 2?
### Accurate SQL ###
| SELECT "Length" FROM table_11638 WHERE "Route Name" = 'sh 2' |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_15098 ( "Year" real, "Chassis" text, "Engine(s)" text, "Tyres" text, "Points" real )
### Question ###
Which chassis was used when over 6 points were earned?
### Accurate SQL ###
| SELECT "Chassis" FROM table_15098 WHERE "Points" = '6' |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_2588674_1 (population__2000_census__ INTEGER, area_km² VARCHAR)
### Question ###
What is the population for the place with an area of 2.33 km2?
### Accurate SQL ###
| SELECT MAX(population__2000_census__) FROM table_2588674_1 WHERE area_km² = "2.33" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_76199 ( "Name" text, "Year of release" text, "Developer" text, "Publisher" text, "Original platforms" text )
### Question ###
Which publisher has release year of 2000 and an original dreamcast platform?
### Accurate SQL ###
| SELECT "Publisher" FROM table_76199 WHERE "Year of release" = '2000' AND "Original platforms" = 'dreamcast' |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_79119 ( "Season" text, "Team" text, "Country" text, "Division" real, "Goals" real )
### Question ###
What is the average Goals, when Team is 'Rah Ahan', and when Division is less than 1?
### Accurate SQL ###
| SELECT AVG("Goals") FROM table_79119 WHERE "Team" = 'rah ahan' AND "Division" < '1' |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_88 (iata VARCHAR, airport VARCHAR)
### Question ###
What is the IATA for San Francisco airport?
### Accurate SQL ###
| SELECT iata FROM table_name_88 WHERE airport = "san francisco airport" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_50778 ( "Circuit" text, "Location / State" text, "Date" text, "Winner" text, "Team" text )
### Question ###
Castrol Perkins Motorsport and the winner Russell Ingall was in what location/state?
### Accurate SQL ###
| SELECT "Location / State" FROM table_50778 WHERE "Team" = 'castrol perkins motorsport' AND "Winner" = 'russell ingall' |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_50656 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
### Question ###
what is the result when the date is august 24, 1997?
### Accurate SQL ###
| SELECT "Result" FROM table_50656 WHERE "Date" = 'august 24, 1997' |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_19359427_6 ( date_of_appointment VARCHAR, position_in_table VARCHAR )
### Question ###
When was the new manager of the team on 21st position appointed?
### Accurate SQL ###
| SELECT date_of_appointment FROM table_19359427_6 WHERE position_in_table = "21st" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text )
TABLE: CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text )
### Question ###
Draw a bar chart about the distribution of All_Games and School_ID , could you show in asc by the All_Games?
### Accurate SQL ###
| SELECT All_Games, School_ID FROM basketball_match ORDER BY All_Games |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varchar )
TABLE: CREATE TABLE ta ( campus_job_id int, student_id int, location varchar )
TABLE: CREATE TABLE semester ( semester_id int, semester varchar, year int )
TABLE: CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int )
TABLE: CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar )
TABLE: CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int )
TABLE: CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar )
TABLE: CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar )
TABLE: CREATE TABLE course_prerequisite ( pre_course_id int, course_id int )
TABLE: CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_projects varchar, has_exams varchar, num_reviews int, clarity_score int, easiness_score int, helpfulness_score int )
TABLE: CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar )
TABLE: CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_project varchar, has_final_exam varchar, textbook varchar, class_address varchar, allow_audit varchar )
TABLE: CREATE TABLE area ( course_id int, area varchar )
TABLE: CREATE TABLE gsi ( course_offering_id int, student_id int )
TABLE: CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar )
TABLE: CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar )
TABLE: CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments int, respected int, participation int, heavy_reading int, tough_grader int, hilarious int, would_take_again int, good_lecture int, no_skip int )
TABLE: CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar )
### Question ###
What past classes has Dr. Nicole Appleberry taught ?
### Accurate SQL ###
| 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 '%Nicole Appleberry%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.offering_id |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_21 (date VARCHAR, week VARCHAR)
### Question ###
What date has 9 as the week?
### Accurate SQL ###
| SELECT date FROM table_name_21 WHERE week = 9 |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE Student_Enrolment (semester_name VARCHAR, semester_id VARCHAR)
TABLE: CREATE TABLE Semesters (semester_name VARCHAR, semester_id VARCHAR)
### Question ###
Which semesters do not have any student enrolled? List the semester name.
### Accurate SQL ###
| SELECT semester_name FROM Semesters WHERE NOT semester_id IN (SELECT semester_id FROM Student_Enrolment) |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_30 ( section VARCHAR, level VARCHAR, season VARCHAR )
### Question ###
What section were they in when there were tier 2 in 1996?
### Accurate SQL ###
| SELECT section FROM table_name_30 WHERE level = "tier 2" AND season = 1996 |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_204_842 ( id number, "institution" text, "city" text, "state" text, "team name" text, "affiliation" text, "enrollment" number, "home conference" text )
### Question ###
which state is the most represented by the 11 institutions ?
### Accurate SQL ###
| SELECT "state" FROM table_204_842 GROUP BY "state" ORDER BY COUNT(*) DESC LIMIT 1 |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_30 (sub_parish__sogn_ VARCHAR, parish__prestegjeld_ VARCHAR, church_name VARCHAR)
### Question ###
Which Sub-Parish (Sogn) is in the Parish (Prestegjeld) of hafslo parish and has a church called Hafslo Kyrkje?
### Accurate SQL ###
| SELECT sub_parish__sogn_ FROM table_name_30 WHERE parish__prestegjeld_ = "hafslo parish" AND church_name = "hafslo kyrkje" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_14 (writer VARCHAR, film VARCHAR)
### Question ###
Who is the writer of the film Run?
### Accurate SQL ###
| SELECT writer FROM table_name_14 WHERE film = "run" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_9867 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text, "Points" real )
### Question ###
What was the record when Vancouver was the visitor?
### Accurate SQL ###
| SELECT "Record" FROM table_9867 WHERE "Visitor" = 'vancouver' |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE railway ( Railway_ID int, Railway text, Builder text, Built text, Wheels text, Location text, ObjectNumber text )
TABLE: CREATE TABLE railway_manage ( Railway_ID int, Manager_ID int, From_Year text )
TABLE: CREATE TABLE train ( Train_ID int, Train_Num text, Name text, From text, Arrival text, Railway_ID int )
TABLE: CREATE TABLE manager ( Manager_ID int, Name text, Country text, Working_year_starts text, Age int, Level int )
### Question ###
Tell me the distribution of the number of trains at each arrival time with a bar chart, and show Y in ascending order.
### Accurate SQL ###
| SELECT Arrival, COUNT(Arrival) FROM train GROUP BY Arrival ORDER BY COUNT(Arrival) |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_33 (t20_matches VARCHAR, year VARCHAR)
### Question ###
What T20 match was played in 1979?
### Accurate SQL ###
| SELECT t20_matches FROM table_name_33 WHERE year = "1979" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_27668 ( "GB" text, "ISO \u2116" text, "Province" text, "Chinese Name" text, "Capital" text, "Population\u00b9" real, "Density\u00b2" text, "Area\u00b3" real, "Abbreviation/Symbol" text )
### Question ###
How many gb's have an iso number of cn-65?
### Accurate SQL ###
| SELECT COUNT("GB") FROM table_27668 WHERE "ISO \u2116" = 'CN-65' |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_42 (opponent VARCHAR, year VARCHAR, partner VARCHAR)
### Question ###
Who was Choong Tan Fook's opponent in 1999?
### Accurate SQL ###
| SELECT opponent FROM table_name_42 WHERE year = 1999 AND partner = "choong tan fook" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_52401 ( "Season No." real, "Season Start" text, "Season End" text, "Episodes" real, "Host" text )
### Question ###
How may episodes did season 1 have?
### Accurate SQL ###
| SELECT COUNT("Episodes") FROM table_52401 WHERE "Season No." = '1' |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_74023 ( "Season" real, "Episodes" real, "Timeslot ( ET )" text, "Season premiere" text, "Season finale" text, "TV season" text, "Rank" text, "Viewers (in millions)" text )
### Question ###
What tv season was episode 23 broadcast?
### Accurate SQL ###
| SELECT "TV season" FROM table_74023 WHERE "Episodes" = '23' |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_54717 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
### Question ###
When the home team scored 16.26 (122) what was the opposing score?
### Accurate SQL ###
| SELECT "Away team score" FROM table_54717 WHERE "Home team score" = '16.26 (122)' |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_204_538 ( id number, "pos." number, "driver" text, "co-driver" text, "car" text, "time" text )
### Question ###
luis serrado and jose camacho both drove what time of car in the race ?
### Accurate SQL ###
| SELECT "car" FROM table_204_538 WHERE "driver" = 'luis serrado' |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_31 ( winners VARCHAR, years_won VARCHAR )
### Question ###
What is the sum of winners when 1983 is the years won?
### Accurate SQL ###
| SELECT COUNT(winners) FROM table_name_31 WHERE years_won = "1983" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE Orders ( order_id INTEGER, customer_id INTEGER, date_order_placed DATETIME, order_details VARCHAR(255) )
TABLE: CREATE TABLE Order_Items ( order_item_id INTEGER, order_id INTEGER, product_id INTEGER, product_quantity VARCHAR(50), other_order_item_details VARCHAR(255) )
TABLE: CREATE TABLE Invoice_Line_Items ( order_item_id INTEGER, invoice_number INTEGER, product_id INTEGER, product_title VARCHAR(80), product_quantity VARCHAR(50), product_price DECIMAL(19,4), derived_product_cost DECIMAL(19,4), derived_vat_payable DECIMAL(19,4), derived_total_cost DECIMAL(19,4) )
TABLE: CREATE TABLE Accounts ( account_id INTEGER, customer_id INTEGER, date_account_opened DATETIME, account_name VARCHAR(50), other_account_details VARCHAR(255) )
TABLE: CREATE TABLE Product_Categories ( production_type_code VARCHAR(15), product_type_description VARCHAR(80), vat_rating DECIMAL(19,4) )
TABLE: CREATE TABLE Products ( product_id INTEGER, parent_product_id INTEGER, production_type_code VARCHAR(15), unit_price DECIMAL(19,4), product_name VARCHAR(80), product_color VARCHAR(20), product_size VARCHAR(20) )
TABLE: CREATE TABLE Invoices ( invoice_number INTEGER, order_id INTEGER, invoice_date DATETIME )
TABLE: CREATE TABLE Financial_Transactions ( transaction_id INTEGER, account_id INTEGER, invoice_number INTEGER, transaction_type VARCHAR(15), transaction_date DATETIME, transaction_amount DECIMAL(19,4), transaction_comment VARCHAR(255), other_transaction_details VARCHAR(255) )
TABLE: CREATE TABLE Customers ( customer_id INTEGER, customer_first_name VARCHAR(50), customer_middle_initial VARCHAR(1), customer_last_name VARCHAR(50), gender VARCHAR(1), email_address VARCHAR(255), login_name VARCHAR(80), login_password VARCHAR(20), phone_number VARCHAR(255), town_city VARCHAR(50), state_county_province VARCHAR(50), country VARCHAR(50) )
### Question ###
Show first name and id for all customers with at least 2 accounts Show bar chart, and rank in descending by the y-axis.
### Accurate SQL ###
| SELECT T2.customer_first_name, T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id ORDER BY T1.customer_id DESC |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_21 (stage VARCHAR, winner VARCHAR)
### Question ###
Which Stage has a Winner of jeremy hunt?
### Accurate SQL ###
| SELECT stage FROM table_name_21 WHERE winner = "jeremy hunt" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_34 ( enrollment INTEGER, ihsaa_class VARCHAR, location VARCHAR )
### Question ###
What is the average enrollment of the IHSAA A class in wolcott?
### Accurate SQL ###
| SELECT AVG(enrollment) FROM table_name_34 WHERE ihsaa_class = "a" AND location = "wolcott" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
TABLE: CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text )
TABLE: CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text )
TABLE: CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
TABLE: CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text )
### Question ###
what is the number of patients whose death status is 1 and drug name is ondansetron odt?
### Accurate SQL ###
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.expire_flag = "1" AND prescriptions.drug = "Ondansetron ODT" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time )
TABLE: CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, hospitaladmitsource text, unitadmittime time, unitdischargetime time, hospitaldischargetime time, hospitaldischargestatus text )
TABLE: CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time )
TABLE: CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time )
TABLE: CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number )
TABLE: CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time )
TABLE: CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time )
TABLE: CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text )
TABLE: CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time )
TABLE: CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time )
### Question ###
how many hours has it taken since the time patient 009-5001 was admitted to icu?
### Accurate SQL ###
| SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '009-5001' AND patient.unitdischargetime IS NULL |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_56 ( total INTEGER, gold VARCHAR, bronze VARCHAR )
### Question ###
Name the sum of total for gold less than 1 and bronze of 3
### Accurate SQL ###
| SELECT SUM(total) FROM table_name_56 WHERE gold < 1 AND bronze = 3 |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text )
TABLE: CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text )
TABLE: CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int )
TABLE: CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int )
TABLE: CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departure_flight_number int, stop_time int )
TABLE: CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar )
TABLE: CREATE TABLE flight_fare ( flight_id int, fare_id int )
TABLE: CREATE TABLE month ( month_number int, month_name text )
TABLE: CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int )
TABLE: CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar )
TABLE: CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar )
TABLE: CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int )
TABLE: CREATE TABLE days ( days_code varchar, day_name varchar )
TABLE: CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text )
TABLE: CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text )
TABLE: CREATE TABLE time_interval ( period text, begin_time int, end_time int )
TABLE: CREATE TABLE state ( state_code text, state_name text, country_name text )
TABLE: CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar )
TABLE: CREATE TABLE code_description ( code varchar, description text )
TABLE: CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int )
TABLE: CREATE TABLE compartment_class ( compartment varchar, class_type varchar )
TABLE: CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops int, time_elapsed int, to_airport varchar )
TABLE: CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_miles int, pressurized varchar )
TABLE: CREATE TABLE airline ( airline_code varchar, airline_name text, note text )
TABLE: CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar )
### Question ###
i need a flight from CHARLOTTE to NEWARK leaving today evening
### Accurate SQL ###
| 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 = 'NEWARK' AND date_day.day_number = 22 AND date_day.month_number = 6 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 = 'CHARLOTTE' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code) AND flight.departure_time BETWEEN 1800 AND 2200 |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_1601935_1 (archive VARCHAR, viewers__in_millions_ VARCHAR)
### Question ###
What was the archive for episode with 6.6 million viewers?
### Accurate SQL ###
| SELECT archive FROM table_1601935_1 WHERE viewers__in_millions_ = "6.6" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_84 ( m939_series VARCHAR, m809_series VARCHAR, wheelbase VARCHAR )
### Question ###
Name the M939 series for short wheelbase and M809 series of m817
### Accurate SQL ###
| SELECT m939_series FROM table_name_84 WHERE m809_series = "m817" AND wheelbase = "short" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_63746 ( "School" text, "Location" text, "Mascot" text, "Enrollment" real, "IHSAA Football Class" text, "Primary Conference" text, "County" text )
### Question ###
What county has an IHSAA Football Class of A, and a Mascot of royals?
### Accurate SQL ###
| SELECT "County" FROM table_63746 WHERE "IHSAA Football Class" = 'a' AND "Mascot" = 'royals' |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_298550_1 (area__km²_ VARCHAR, population_density__per_km²_ VARCHAR)
### Question ###
How many entries for area correspond to a population density of 207.9?
### Accurate SQL ###
| SELECT COUNT(area__km²_) FROM table_298550_1 WHERE population_density__per_km²_ = "207.9" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_18646111_13 ( round_1 VARCHAR )
### Question ###
Name the 1/8 finals for round 1 n/a
### Accurate SQL ###
| SELECT 1 AS _8_finals FROM table_18646111_13 WHERE round_1 = "N/A" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_33767 ( "Chapter" text, "Chartered" text, "School" text, "State" text, "Status" text, "Charter Range" text )
### Question ###
What are the active dates for the Montana State University chapter?
### Accurate SQL ###
| SELECT "Charter Range" FROM table_33767 WHERE "School" = 'montana state university' |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text )
TABLE: CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number )
TABLE: CREATE TABLE VoteTypes ( Id number, Name text )
TABLE: CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number )
TABLE: CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text )
TABLE: CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text )
TABLE: CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text )
TABLE: CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number )
TABLE: CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number )
TABLE: CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time )
TABLE: CREATE TABLE FlagTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text )
TABLE: CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number )
TABLE: CREATE TABLE PostTags ( PostId number, TagId number )
TABLE: CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other )
TABLE: CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text )
TABLE: CREATE TABLE PostHistoryTypes ( Id number, Name text )
TABLE: CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number )
TABLE: CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time )
TABLE: CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text )
TABLE: CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean )
TABLE: CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDate time, ApprovalModeratorId number, DeactivationDate time, DeactivationModeratorId number )
TABLE: CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE PostTypes ( Id number, Name text )
TABLE: CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number )
TABLE: CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number )
TABLE: CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number )
### Question ###
Microservices trend (# of questions per month).
### Accurate SQL ###
| SELECT DATEADD(mm, (YEAR(Posts.CreationDate) - 1900) * 12 + MONTH(Posts.CreationDate) - 1, 0) AS Month, Tags.TagName, COUNT(*) AS Questions FROM Tags LEFT JOIN PostTags ON PostTags.TagId = Tags.Id LEFT JOIN Posts ON Posts.Id = PostTags.PostId LEFT JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId WHERE Tags.TagName IN ('microservices', 'soa') AND PostTypes.Name = 'Question' AND Posts.CreationDate < DATEADD(month, DATEDIFF(month, 0, GETDATE()), 0) GROUP BY YEAR(Posts.CreationDate), MONTH(Posts.CreationDate), Tags.TagName ORDER BY YEAR(Posts.CreationDate), MONTH(Posts.CreationDate), Tags.TagName |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_18686317_1 ( rank VARCHAR, yardage VARCHAR )
### Question ###
What is the rank of the player who got 58179 in yardage?
### Accurate SQL ###
| SELECT rank FROM table_18686317_1 WHERE yardage = 58179 |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE PostHistoryTypes ( Id number, Name text )
TABLE: CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number )
TABLE: CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number )
TABLE: CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other )
TABLE: CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number )
TABLE: CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number )
TABLE: CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number )
TABLE: CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number )
TABLE: CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text )
TABLE: CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text )
TABLE: CREATE TABLE FlagTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number )
TABLE: CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number )
TABLE: CREATE TABLE VoteTypes ( Id number, Name text )
TABLE: CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time )
TABLE: CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text )
TABLE: CREATE TABLE PostTags ( PostId number, TagId number )
TABLE: CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text )
TABLE: CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean )
TABLE: CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text )
TABLE: CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number )
TABLE: CREATE TABLE PostTypes ( Id number, Name text )
TABLE: CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text )
TABLE: CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDate time, ApprovalModeratorId number, DeactivationDate time, DeactivationModeratorId number )
TABLE: CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text )
TABLE: CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time )
TABLE: CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text )
### Question ###
Get All Users of Posts for a aws-lambda tag.
### Accurate SQL ###
| SELECT * FROM Users WHERE Id IN (SELECT OwnerUserId FROM Posts WHERE ParentId IN (SELECT Id FROM Posts WHERE Tags LIKE '%aws-lambda%')) |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_97 ( position VARCHAR, college VARCHAR )
### Question ###
What is Position, when College is 'Houston'?
### Accurate SQL ###
| SELECT position FROM table_name_97 WHERE college = "houston" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE club_rank ( rank number, club_id number, gold number, silver number, bronze number, total number )
TABLE: CREATE TABLE competition ( competition_id number, year number, competition_type text, country text )
TABLE: CREATE TABLE club ( club_id number, name text, region text, start_year text )
TABLE: CREATE TABLE competition_result ( competition_id number, club_id_1 number, club_id_2 number, score text )
TABLE: CREATE TABLE player ( player_id number, name text, position text, club_id number, apps number, tries number, goals text, points number )
### Question ###
What are the different regions of clubs in ascending alphabetical order?
### Accurate SQL ###
| SELECT DISTINCT region FROM club ORDER BY region |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int )
TABLE: CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar )
TABLE: CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text )
TABLE: CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int )
TABLE: CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int )
TABLE: CREATE TABLE flight_fare ( flight_id int, fare_id int )
TABLE: CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar )
TABLE: CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text )
TABLE: CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar )
TABLE: CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_miles int, pressurized varchar )
TABLE: CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int )
TABLE: CREATE TABLE days ( days_code varchar, day_name varchar )
TABLE: CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops int, time_elapsed int, to_airport varchar )
TABLE: CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text )
TABLE: CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departure_flight_number int, stop_time int )
TABLE: CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text )
TABLE: CREATE TABLE time_interval ( period text, begin_time int, end_time int )
TABLE: CREATE TABLE state ( state_code text, state_name text, country_name text )
TABLE: CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int )
TABLE: CREATE TABLE month ( month_number int, month_name text )
TABLE: CREATE TABLE compartment_class ( compartment varchar, class_type varchar )
TABLE: CREATE TABLE airline ( airline_code varchar, airline_name text, note text )
TABLE: CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar )
TABLE: CREATE TABLE code_description ( code varchar, description text )
TABLE: CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar )
### Question ###
give me the flights with the fares from INDIANAPOLIS to ORLANDO on 12 27
### Accurate SQL ###
| 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, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ORLANDO' AND DATE_DAY_0.day_number = 27 AND DATE_DAY_0.month_number = 12 AND DATE_DAY_0.year = 1991 AND DAYS_0.day_name = DATE_DAY_0.day_name AND flight.flight_days = DAYS_0.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 = 'INDIANAPOLIS' AND DATE_DAY_1.day_number = 27 AND DATE_DAY_1.month_number = 12 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 flight_fare.fare_id = fare.fare_id AND flight.flight_id = flight_fare.flight_id AND flight.from_airport = AIRPORT_SERVICE_0.airport_code |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE Ref_locations (location_code VARCHAR, location_name VARCHAR)
### Question ###
What is the location code for the country "Canada"?
### Accurate SQL ###
| SELECT location_code FROM Ref_locations WHERE location_name = "Canada" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_9898 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Attendance" real, "Record" text, "Points" real )
### Question ###
What is Date, when Opponent is @ Carolina Hurricanes?
### Accurate SQL ###
| SELECT "Date" FROM table_9898 WHERE "Opponent" = '@ carolina hurricanes' |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_91 ( opponent VARCHAR, date VARCHAR )
### Question ###
Who was the opponent on August 14?
### Accurate SQL ###
| SELECT opponent FROM table_name_91 WHERE date = "august 14" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_13 (winning_driver VARCHAR, circuit VARCHAR)
### Question ###
Which Driver won the Circuit of Rio de Janeiro?
### Accurate SQL ###
| SELECT winning_driver FROM table_name_13 WHERE circuit = "rio de janeiro" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_72 ( score VARCHAR, competition VARCHAR )
### Question ###
What was the score for the World Cup Qualifier?
### Accurate SQL ###
| SELECT score FROM table_name_72 WHERE competition = "world cup qualifier" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_48 (attendance INTEGER, date VARCHAR)
### Question ###
What is the total attendance for the August 8 game?
### Accurate SQL ###
| SELECT SUM(attendance) FROM table_name_48 WHERE date = "august 8" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_63 ( goals INTEGER, position VARCHAR, league VARCHAR )
### Question ###
Goals that has a Position of 14th of 24, and a League of football conference has what sum?
### Accurate SQL ###
| SELECT SUM(goals) FROM table_name_63 WHERE position = "14th of 24" AND league = "football conference" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_43383 ( "Name" text, "Processor" text, "Hard Drive" text, "Ethernet Ports" text, "Dimensions" text )
### Question ###
What is the ethernet ports of the u10 appliance?
### Accurate SQL ###
| SELECT "Ethernet Ports" FROM table_43383 WHERE "Name" = 'u10' |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_20138 ( "Ecozone" text, "Area (km\u00b2)" real, "Percentage of total area" text, "Percentage of land area" text, "Percentage protected" text )
### Question ###
What is the percentage of land area in the ecozone that the percentage protected is 7.96?
### Accurate SQL ###
| SELECT "Percentage of land area" FROM table_20138 WHERE "Percentage protected" = '7.96' |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number )
TABLE: CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other )
TABLE: CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE PostTypes ( Id number, Name text )
TABLE: CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number )
TABLE: CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text )
TABLE: CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDate time, ApprovalModeratorId number, DeactivationDate time, DeactivationModeratorId number )
TABLE: CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number )
TABLE: CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text )
TABLE: CREATE TABLE PostHistoryTypes ( Id number, Name text )
TABLE: CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time )
TABLE: CREATE TABLE FlagTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text )
TABLE: CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time )
TABLE: CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number )
TABLE: CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number )
TABLE: CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text )
TABLE: CREATE TABLE VoteTypes ( Id number, Name text )
TABLE: CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text )
TABLE: CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text )
TABLE: CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number )
TABLE: CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number )
TABLE: CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text )
TABLE: CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number )
TABLE: CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean )
TABLE: CREATE TABLE PostTags ( PostId number, TagId number )
TABLE: CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number )
### Question ###
Questions and answers per day.
### Accurate SQL ###
| SELECT DAY(CreationDate) AS creationDay, MONTH(CreationDate) AS creationMonth, (CASE WHEN ParentId IS NULL THEN 1 ELSE 0 END) AS isAnswer, COUNT(Id) AS cnt FROM Posts WHERE YEAR(Posts.CreationDate) = 2019 AND Posts.DeletionDate IS NULL GROUP BY DAY(CreationDate), MONTH(CreationDate), (CASE WHEN ParentId IS NULL THEN 1 ELSE 0 END) |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int )
TABLE: CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text )
TABLE: CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int )
TABLE: CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text )
### Question ###
Show me about the distribution of meter_300 and ID in a bar chart, could you order by the y-axis in descending?
### Accurate SQL ###
| SELECT meter_300, ID FROM swimmer ORDER BY ID DESC |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_1449176_1 (density__inhabitants_km_2__ VARCHAR, area__km_2__ VARCHAR)
### Question ###
What is the density of the common with an area of 20.4 km^2?
### Accurate SQL ###
| SELECT density__inhabitants_km_2__ FROM table_1449176_1 WHERE area__km_2__ = "20.4" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_73 ( crowd INTEGER, venue VARCHAR )
### Question ###
How big was the largest crowd recorded at the Arden Street Oval venue?
### Accurate SQL ###
| SELECT MAX(crowd) FROM table_name_73 WHERE venue = "arden street oval" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar )
TABLE: CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int )
TABLE: CREATE TABLE days ( days_code varchar, day_name varchar )
TABLE: CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text )
TABLE: CREATE TABLE state ( state_code text, state_name text, country_name text )
TABLE: CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar )
TABLE: CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int )
TABLE: CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int )
TABLE: CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text )
TABLE: CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text )
TABLE: CREATE TABLE airline ( airline_code varchar, airline_name text, note text )
TABLE: CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text )
TABLE: CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_miles int, pressurized varchar )
TABLE: CREATE TABLE flight_fare ( flight_id int, fare_id int )
TABLE: CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar )
TABLE: CREATE TABLE compartment_class ( compartment varchar, class_type varchar )
TABLE: CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departure_flight_number int, stop_time int )
TABLE: CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar )
TABLE: CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int )
TABLE: CREATE TABLE time_interval ( period text, begin_time int, end_time int )
TABLE: CREATE TABLE code_description ( code varchar, description text )
TABLE: CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar )
TABLE: CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops int, time_elapsed int, to_airport varchar )
TABLE: CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int )
TABLE: CREATE TABLE month ( month_number int, month_name text )
### Question ###
what flights are there from DALLAS to PITTSBURGH on monday morning
### Accurate SQL ###
| 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 = 21 AND date_day.month_number = 2 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 = '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 = 'DALLAS' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_47 ( studio_host VARCHAR, play_by_play VARCHAR, year VARCHAR )
### Question ###
Play-by-play of sean grande, and a Year of 2004-05 had what studio host?
### Accurate SQL ###
| SELECT studio_host FROM table_name_47 WHERE play_by_play = "sean grande" AND year = "2004-05" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text )
TABLE: CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
TABLE: CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text )
TABLE: CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text )
TABLE: CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
### Question ###
how many patients whose insurance is government and lab test name is po2?
### Accurate SQL ###
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Government" AND lab.label = "pO2" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_60717 ( "Greek Designation" text, "Collegiate Institution" text, "Charter Date" text, "Status" text, "City" text, "U.S. State/District" text )
### Question ###
What California city has an active status and a greek designation of established colony?
### Accurate SQL ###
| SELECT "City" FROM table_60717 WHERE "Status" = 'active' AND "U.S. State/District" = 'california' AND "Greek Designation" = 'established colony' |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_54 ( lost VARCHAR, played INTEGER )
### Question ###
Which player lost more than 12?
### Accurate SQL ###
| SELECT COUNT(lost) FROM table_name_54 WHERE played > 12 |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_1966992_1 (lga_name VARCHAR, census_2006_population VARCHAR, administrative_capital VARCHAR)
### Question ###
What is the LGA name where the 2006 census population is bigger than 425208.9417698913 and administrative capital is port harcourt?
### Accurate SQL ###
| SELECT lga_name FROM table_1966992_1 WHERE census_2006_population > 425208.9417698913 AND administrative_capital = "Port Harcourt" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_44939 ( "Date" text, "Rank" real, "Weekend Gross" text, "Theaters" real, "Gross-to-date" text )
### Question ###
Name the Gross-to-date which has a Date of august 23 25?
### Accurate SQL ###
| SELECT "Gross-to-date" FROM table_44939 WHERE "Date" = 'august 23–25' |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_53 (drawn VARCHAR, points VARCHAR, lost VARCHAR)
### Question ###
How many drawn have points of 6 and lost by fewer than 4?
### Accurate SQL ###
| SELECT COUNT(drawn) FROM table_name_53 WHERE points = 6 AND lost < 4 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.