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_42 (opponent VARCHAR, surface VARCHAR)
### Question ###
What person was played against when the playing surface was hard?
### Accurate SQL ###
| SELECT opponent FROM table_name_42 WHERE surface = "hard" |
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_98 ( game INTEGER, location_attendance VARCHAR, date VARCHAR )
### Question ###
What is the least game that was played in Alexander Memorial Coliseum on October 16?
### Accurate SQL ###
| SELECT MIN(game) FROM table_name_98 WHERE location_attendance = "alexander memorial coliseum" AND date = "october 16" |
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_13967239_2 ( senior__4th_year_ VARCHAR, sophomore__grade_8_ VARCHAR )
### Question ###
What is after intermediate algebra
### Accurate SQL ###
| SELECT senior__4th_year_ FROM table_13967239_2 WHERE sophomore__grade_8_ = "Intermediate Algebra" |
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_20115 ( "Pos." real, "Driver" text, "Qualifying" real, "Race 1" text, "Race 2" text, "Race 3" text, "Points" real )
### Question ###
Name the driver for race 2 2
### Accurate SQL ###
| SELECT "Driver" FROM table_20115 WHERE "Race 2" = '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_name_21 ( score VARCHAR, record VARCHAR )
### Question ###
What is the Score of the game with a Record of 29 23 13?
### Accurate SQL ###
| SELECT score FROM table_name_21 WHERE record = "29–23–13" |
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_73573 ( "No" real, "Player" text, "Height (m)" text, "Height (f)" text, "Position" text, "Year born" real, "Current Club" text )
### Question ###
Name the player that is 1.85 m
### Accurate SQL ###
| SELECT "Player" FROM table_73573 WHERE "Height (m)" = '1.85' |
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_37 (year INTEGER, local_host_s_ VARCHAR)
### Question ###
What is the sum of year with the local host Sai?
### Accurate SQL ###
| SELECT SUM(year) FROM table_name_37 WHERE local_host_s_ = "sai" |
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_14070062_3 (points VARCHAR, try_bonus VARCHAR)
### Question ###
How many points does the club with a try bonus of 10 have?
### Accurate SQL ###
| SELECT points FROM table_14070062_3 WHERE try_bonus = "10" |
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_261927_1 (institution VARCHAR, nickname VARCHAR)
### Question ###
What is the institution with the nickname seahawks?
### Accurate SQL ###
| SELECT institution FROM table_261927_1 WHERE nickname = "Seahawks" |
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 chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom 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 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 patients ( row_id number, subject_id number, gender text, dob time, dod time )
TABLE: CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text )
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 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 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 labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom 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 d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text )
TABLE: CREATE TABLE d_labitems ( row_id number, itemid number, label text )
TABLE: CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time )
TABLE: CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text )
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 cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number )
### Question ###
count the number of patients who were diagnosed with polymyalgia rheumatica but did not return to the hospital within 2 months in the previous year.
### Accurate SQL ###
| SELECT (SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'polymyalgia rheumatica') AND DATETIME(diagnoses_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t1) - (SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'polymyalgia rheumatica') AND DATETIME(diagnoses_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t2 JOIN admissions ON t2.subject_id = admissions.subject_id WHERE t2.charttime < admissions.admittime AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND DATETIME(admissions.admittime) BETWEEN DATETIME(t2.charttime) AND DATETIME(t2.charttime, '+2 month')) |
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 (ends INTEGER, name VARCHAR)
### Question ###
Name the average ends for weston
### Accurate SQL ###
| SELECT AVG(ends) FROM table_name_28 WHERE name = "weston" |
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_10858 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
### Question ###
What's the lowest attendance for October 13, 1968, and is larger than week 5?
### Accurate SQL ###
| SELECT MIN("Attendance") FROM table_10858 WHERE "Date" = 'october 13, 1968' AND "Week" > '5' |
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 employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(4,0) )
TABLE: CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) )
TABLE: CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) )
TABLE: CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) )
TABLE: CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) )
TABLE: CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) )
TABLE: CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) )
### Question ###
For those employees who did not have any job in the past, give me the comparison about the amount of hire_date over the hire_date bin hire_date by time by a bar chart, and show total number from low to high order.
### Accurate SQL ###
| SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY COUNT(HIRE_DATE) |
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 (first_elected INTEGER, incumbent VARCHAR)
### Question ###
What is the first elected for Jo Bonner?
### Accurate SQL ###
| SELECT MIN(first_elected) FROM table_name_12 WHERE incumbent = "jo bonner" |
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_17 (team VARCHAR, date VARCHAR)
### Question ###
Which team was the opponent on December 30?
### Accurate SQL ###
| SELECT team FROM table_name_17 WHERE date = "december 30" |
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_37 ( award VARCHAR, year VARCHAR, result VARCHAR )
### Question ###
Which award was nominated for in 2000?
### Accurate SQL ###
| SELECT award FROM table_name_37 WHERE year = 2000 AND result = "nominated" |
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_86 (labour INTEGER, lib_dem INTEGER)
### Question ###
Name the highest Labour with Lib Dem larger than 21?
### Accurate SQL ###
| SELECT MAX(labour) FROM table_name_86 WHERE lib_dem > 21 |
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 performance ( Performance_ID real, Date text, Host text, Location text, Attendance int )
TABLE: CREATE TABLE member ( Member_ID text, Name text, Nationality text, Role text )
TABLE: CREATE TABLE member_attendance ( Member_ID int, Performance_ID int, Num_of_Pieces int )
### Question ###
Compare the total number of locations in each location using a bar graph.
### Accurate SQL ###
| SELECT Location, COUNT(Location) FROM performance GROUP BY Location |
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 ( yards VARCHAR, completion__percentage VARCHAR )
### Question ###
Which yard has a Completion of 64.9%?
### Accurate SQL ###
| SELECT yards FROM table_name_26 WHERE completion__percentage = "64.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_406 ( "Name" text, "#" real, "Position" text, "Height" text, "Weight" real, "Year" text, "Home Town" text, "High School" text )
### Question ###
Crockett High School had which number(#)?
### Accurate SQL ###
| SELECT "#" FROM table_406 WHERE "High School" = 'Crockett' |
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_76936 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text )
### Question ###
What is the low score for TO par +2 in japan?
### Accurate SQL ###
| SELECT MIN("Score") FROM table_76936 WHERE "To par" = '+2' AND "Country" = 'japan' |
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_44 ( college_junior_club_team__league_ VARCHAR, nationality VARCHAR, round VARCHAR )
### Question ###
What league is from the United States and a round smaller than 12.
### Accurate SQL ###
| SELECT college_junior_club_team__league_ FROM table_name_44 WHERE nationality = "united states" AND round < 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 program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar )
TABLE: CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int )
TABLE: CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar )
TABLE: CREATE TABLE course_prerequisite ( pre_course_id int, course_id 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 jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int )
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 gsi ( course_offering_id int, student_id int )
TABLE: CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar )
TABLE: CREATE TABLE semester ( semester_id int, semester varchar, year int )
TABLE: CREATE TABLE area ( course_id int, area 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 comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar )
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 requirement ( requirement_id int, requirement varchar, college varchar )
TABLE: CREATE TABLE ta ( campus_job_id int, student_id int, location varchar )
TABLE: CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar )
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 )
### Question ###
For PHRMACOL 611 , who usually teaches the class ?
### Accurate SQL ###
| SELECT COUNT(instructor.name), instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'PHRMACOL' AND course.number = 611 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.offering_id GROUP BY instructor.name ORDER BY COUNT(instructor.name) DESC LIMIT 5 |
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 cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number )
TABLE: CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text )
TABLE: CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text )
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_labitems ( row_id number, itemid number, label text )
TABLE: CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time )
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 procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time )
TABLE: CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title 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 chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom 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 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 outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number )
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 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 patients ( row_id number, subject_id number, gender text, dob time, dod time )
### Question ###
what was the last hemoglobin in patient 64881 in 03/last year?
### Accurate SQL ###
| SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 64881) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'hemoglobin') AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m', labevents.charttime) = '03' ORDER BY labevents.charttime 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_10595672_1 ( score VARCHAR, record VARCHAR )
### Question ###
What was the score of the game when the team reached a record of 6-9?
### Accurate SQL ###
| SELECT score FROM table_10595672_1 WHERE record = "6-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_46012 ( "Year" real, "Best teenage/Young Adult" text, "Reader's Vote" text, "Best Non-Fiction" text, "Lifetime Achievement" text )
### Question ###
How many times was the reader's vote na and the lifetime achievement na?
### Accurate SQL ###
| SELECT COUNT("Year") FROM table_46012 WHERE "Reader's Vote" = 'na' AND "Lifetime Achievement" = 'na' |
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 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 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 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 )
### Question ###
how many patients whose ethnicity is black/cape verdean and primary disease is left femur fracture?
### Accurate SQL ###
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.diagnosis = "LEFT FEMUR FRACTURE" |
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 people ( people_id number, name text, height number, weight number, date_of_birth text )
TABLE: CREATE TABLE entrepreneur ( entrepreneur_id number, people_id number, company text, money_requested number, investor text )
### Question ###
What is the total money requested by entrepreneurs with height more than 1.85?
### Accurate SQL ###
| SELECT SUM(T1.money_requested) FROM entrepreneur AS T1 JOIN people AS T2 ON T1.people_id = T2.people_id WHERE T2.height > 1.85 |
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_283203_1 ( home_venue VARCHAR, founded VARCHAR )
### Question ###
Where is the home venue of the team founded in 1993?
### Accurate SQL ###
| SELECT home_venue FROM table_283203_1 WHERE founded = 1993 |
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_29 ( total INTEGER, gold VARCHAR, nation VARCHAR )
### Question ###
Which Total is the highest one that has a Gold of 1, and a Nation of czechoslovakia?
### Accurate SQL ###
| SELECT MAX(total) FROM table_name_29 WHERE gold = 1 AND nation = "czechoslovakia" |
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 ( episode VARCHAR, entrepreneur_s_ VARCHAR )
### Question ###
The entrepreneur Adam Weaver was featured in which episode?
### Accurate SQL ###
| SELECT episode FROM table_name_28 WHERE entrepreneur_s_ = "adam weaver" |
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_51107 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time" text, "Grid" real )
### Question ###
Count the Grid which has a Manufacturer of aprilia, and a Rider of bradley smith?
### Accurate SQL ###
| SELECT AVG("Grid") FROM table_51107 WHERE "Manufacturer" = 'aprilia' AND "Rider" = 'bradley smith' |
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 (tournament VARCHAR, margin_of_victory VARCHAR)
### Question ###
What tournament had a 1 point margin of victory?
### Accurate SQL ###
| SELECT tournament FROM table_name_12 WHERE margin_of_victory = "1 point" |
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_64 ( term_of_office VARCHAR, member VARCHAR )
### Question ###
What is Term of Office, when Member is 'Dominic Costa'?
### Accurate SQL ###
| SELECT term_of_office FROM table_name_64 WHERE member = "dominic costa" |
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 ( score VARCHAR, partner VARCHAR )
### Question ###
What was the score of the Jeff Tarango game?
### Accurate SQL ###
| SELECT score FROM table_name_12 WHERE partner = "jeff tarango" |
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 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 )
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 ###
what is admission location and procedure icd9 code of subject id 1121?
### Accurate SQL ###
| SELECT demographic.admission_location, procedures.icd9_code FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "1121" |
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_26454128_9 (points VARCHAR, distance__metres_ VARCHAR)
### Question ###
What is the total number of times points were listed when the distance was 41.05 metres?
### Accurate SQL ###
| SELECT COUNT(points) FROM table_26454128_9 WHERE distance__metres_ = "41.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 table_11406866_2 (opponent VARCHAR, tv VARCHAR, game_site VARCHAR)
### Question ###
who is the opponent where tv is abc and game site is tampa stadium
### Accurate SQL ###
| SELECT opponent FROM table_11406866_2 WHERE tv = "ABC" AND game_site = "Tampa Stadium" |
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 real, Club_ID int, Gold real, Silver real, Bronze real, Total real )
TABLE: CREATE TABLE competition ( Competition_ID int, Year real, Competition_type text, Country text )
TABLE: CREATE TABLE competition_result ( Competition_ID int, Club_ID_1 int, Club_ID_2 int, Score text )
TABLE: CREATE TABLE club ( Club_ID int, name text, Region text, Start_year text )
TABLE: CREATE TABLE player ( Player_ID int, name text, Position text, Club_ID int, Apps real, Tries real, Goals text, Points real )
### Question ###
For all players, show the number of different club names they come from, and rank by the bar in desc.
### Accurate SQL ###
| SELECT T1.name, COUNT(T1.name) FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID GROUP BY T1.name ORDER BY T1.name 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_18950570_4 (brazil_100_percentage__percent_of_the_population_ VARCHAR, age_group VARCHAR)
### Question ###
what ae all of the brazil 100% where the age group is 15-17?
### Accurate SQL ###
| SELECT brazil_100_percentage__percent_of_the_population_ FROM table_18950570_4 WHERE age_group = "15-17" |
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 food_service ( meal_code text, meal_number int, compartment text, meal_description varchar )
TABLE: CREATE TABLE code_description ( code varchar, description 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 city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code 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 date_day ( month_number int, day_number int, year int, day_name varchar )
TABLE: CREATE TABLE month ( month_number int, month_name text )
TABLE: CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar )
TABLE: CREATE TABLE compartment_class ( compartment varchar, class_type varchar )
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 days ( days_code varchar, day_name varchar )
TABLE: CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare 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 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 airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int )
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 time_interval ( period text, begin_time int, end_time int )
TABLE: CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight 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 time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int )
TABLE: CREATE TABLE airline ( airline_code varchar, airline_name text, note text )
TABLE: CREATE TABLE state ( state_code text, state_name text, country_name text )
### Question ###
what is the ground transportation between BWI airport and BALTIMORE
### Accurate SQL ###
| SELECT DISTINCT ground_service.transport_type FROM airport, airport_service, city AS CITY_0, city AS CITY_1, ground_service WHERE airport.airport_code = airport_service.airport_code AND CITY_0.city_name = 'BALTIMORE' AND CITY_1.city_code = airport_service.city_code AND CITY_1.city_name = 'BALTIMORE' AND ground_service.airport_code = airport.airport_code AND ground_service.city_code = CITY_0.city_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_18016 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Record" text, "Attendance" real )
### Question ###
Who did the Seahawks play when the listed attendance was 61615?
### Accurate SQL ###
| SELECT "Opponent" FROM table_18016 WHERE "Attendance" = '61615' |
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 ( notes VARCHAR, rank VARCHAR, time VARCHAR )
### Question ###
What are the notes for the rower in ranks over 2 and having a time of 7:00:46?
### Accurate SQL ###
| SELECT notes FROM table_name_48 WHERE rank > 2 AND time = "7:00:46" |
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_86 (game VARCHAR, location_attendance VARCHAR)
### Question ###
What game number was played at amway arena?
### Accurate SQL ###
| SELECT game FROM table_name_86 WHERE location_attendance = "amway arena" |
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_46146 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" real, "Finish" text )
### Question ###
Which player had a to par score larger than 7 and a total score of 298?
### Accurate SQL ###
| SELECT "Player" FROM table_46146 WHERE "To par" > '7' AND "Total" = '298' |
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 university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text )
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 )
### Question ###
Show me about the correlation between Team_ID and ACC_Percent , and group by attribute ACC_Regular_Season in a scatter chart.
### Accurate SQL ###
| SELECT Team_ID, ACC_Percent FROM basketball_match GROUP BY ACC_Regular_Season |
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 ( company VARCHAR, country VARCHAR, author VARCHAR )
### Question ###
What is the company from Greece with author Aeschylus?
### Accurate SQL ###
| SELECT company FROM table_name_45 WHERE country = "greece" AND author = "aeschylus" |
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 captain ( Captain_ID int, Name text, Ship_ID int, age text, Class text, Rank text )
TABLE: CREATE TABLE Ship ( Ship_ID int, Name text, Type text, Built_Year real, Class text, Flag text )
### Question ###
Tell me the proportion of the total number of different ranks using a bar graph.
### Accurate SQL ###
| SELECT Rank, COUNT(Rank) FROM captain GROUP BY Rank |
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_27084 ( "Round" real, "Circuit" text, "Date" text, "Pole position" text, "Fastest lap" text, "Winning driver" text, "Winning team" text )
### Question ###
What is the circuit of round 5?
### Accurate SQL ###
| SELECT "Circuit" FROM table_27084 WHERE "Round" = '5' |
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_requirement ( program_id int, category varchar, min_credit int, additional_req varchar )
TABLE: CREATE TABLE semester ( semester_id int, semester varchar, year int )
TABLE: CREATE TABLE area ( course_id int, area varchar )
TABLE: CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int )
TABLE: CREATE TABLE ta ( campus_job_id int, student_id int, location 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_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 comment_instructor ( instructor_id int, student_id int, score int, comment_text 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 gsi ( course_offering_id int, student_id int )
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 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 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 program_course ( program_id int, course_id int, workload int, category varchar )
TABLE: CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar )
TABLE: CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar )
### Question ###
Is Prof. Yves Atchade the head professor for 525 next semester ?
### Accurate SQL ###
| SELECT COUNT(*) > 0 FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 525 AND instructor.name LIKE '%Yves Atchade%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.offering_id AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016 |
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_63281 ( "Lane" real, "Athlete" text, "Nationality" text, "Time" real, "Reaction time" real )
### Question ###
What is the Time of the Athlete with a Reaction time of 0.164?
### Accurate SQL ###
| SELECT SUM("Time") FROM table_63281 WHERE "Reaction time" = '0.164' |
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_6 ( opponent VARCHAR, week VARCHAR )
### Question ###
Name the opponent for week of 2
### Accurate SQL ###
| SELECT opponent FROM table_name_6 WHERE week = 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_62922 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
### Question ###
what is the result when the venue is stade g n ral seyni kountch , niamey, the competition is friendly and the date is 9 october 2012?
### Accurate SQL ###
| SELECT "Result" FROM table_62922 WHERE "Venue" = 'stade général seyni kountché, niamey' AND "Competition" = 'friendly' AND "Date" = '9 october 2012' |
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 party_events ( Event_ID int, Event_Name text, Party_ID int, Member_in_charge_ID int )
TABLE: CREATE TABLE member ( Member_ID int, Member_Name text, Party_ID text, In_office text )
TABLE: CREATE TABLE party ( Party_ID int, Minister text, Took_office text, Left_office text, Region_ID int, Party_name text )
TABLE: CREATE TABLE region ( Region_ID int, Region_name text, Date text, Label text, Format text, Catalogue text )
### Question ###
How many parties of the time they took office, binning the left office into Weekday interval, and then split by the minister's name, and rank by the how many left office in descending.
### Accurate SQL ###
| SELECT Left_office, COUNT(Left_office) FROM party GROUP BY Minister ORDER BY COUNT(Left_office) 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_22447251_2 (height VARCHAR, contestant VARCHAR)
### Question ###
How tall is contestant Alexandra Díaz Bello?
### Accurate SQL ###
| SELECT height FROM table_22447251_2 WHERE contestant = "Alexandra Díaz Bello" |
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 ( 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 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_items ( row_id number, itemid number, label text, linksto text )
TABLE: CREATE TABLE d_labitems ( row_id number, itemid number, label text )
TABLE: CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime 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 chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text )
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 d_icd_diagnoses ( 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 outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number )
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 d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title 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 transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time )
### Question ###
in 2105 patient 83038 has received a lab test?
### Accurate SQL ###
| SELECT COUNT(*) > 0 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 83038) AND STRFTIME('%y', labevents.charttime) = '2105' |
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_79 ( season VARCHAR, top_goalscorer VARCHAR )
### Question ###
In what season was Sch dlich the top goalscorer?
### Accurate SQL ###
| SELECT season FROM table_name_79 WHERE top_goalscorer = "schädlich" |
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_79922 ( "Name" text, "Country" text, "Status" text, "Transfer window" text, "Transfer fee" text, "Source" text )
### Question ###
What was the transfer fee for the summer transfer involving the SCO named Crainey?
### Accurate SQL ###
| SELECT "Transfer fee" FROM table_79922 WHERE "Transfer window" = 'summer' AND "Country" = 'sco' AND "Name" = 'crainey' |
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_34675 ( "Administrative Panel" real, "Agricultural Panel" real, "Cultural and Educational Panel" real, "Industrial and Commercial Panel" real, "Labour Panel" real, "National University of Ireland" real, "University of Dublin" real, "Nominated by the Taoiseach" real, "Total" real )
### Question ###
What is the total for University of Dublin, having a panel of 0 for agricultural, was nominated by Taoiseach more than 0, and an industrial and commercial panel less than 0?
### Accurate SQL ###
| SELECT COUNT("University of Dublin") FROM table_34675 WHERE "Agricultural Panel" = '0' AND "Nominated by the Taoiseach" > '0' AND "Industrial and Commercial Panel" < '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_77214 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
### Question ###
What is player raymond floyd's country?
### Accurate SQL ###
| SELECT "Country" FROM table_77214 WHERE "Player" = 'raymond floyd' |
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_81 (show VARCHAR, date VARCHAR)
### Question ###
Which show aired on 19 april?
### Accurate SQL ###
| SELECT show FROM table_name_81 WHERE date = "19 april" |
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_19 (score VARCHAR, away_team VARCHAR)
### Question ###
What was the score for the away team, southport?
### Accurate SQL ###
| SELECT score FROM table_name_19 WHERE away_team = "southport" |
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 diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text )
TABLE: CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number )
TABLE: CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time )
TABLE: CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time )
TABLE: CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime 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 vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time )
TABLE: CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time )
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 ###
until 08/30/2105 when did patient 027-156601 get ns ivf for the last time?
### Accurate SQL ###
| SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-156601')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.celllabel = 'ns ivf' AND STRFTIME('%y-%m-%d', intakeoutput.intakeoutputtime) <= '2105-08-30' ORDER BY intakeoutput.intakeoutputtime 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_14508 ( "Rank" real, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
### Question ###
Bronze larger than 2, and a Rank of 4, and a Total larger than 7 has how many numbers of gold?
### Accurate SQL ###
| SELECT AVG("Gold") FROM table_14508 WHERE "Bronze" > '2' AND "Rank" = '4' AND "Total" > '7' |
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 body_builder ( body_builder_id number, people_id number, snatch number, clean_jerk number, total number )
TABLE: CREATE TABLE people ( people_id number, name text, height number, weight number, birth_date text, birth_place text )
### Question ###
What is the minimum snatch score?
### Accurate SQL ###
| SELECT MIN(snatch) FROM body_builder |
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_20105 ( "No" real, "Driver" text, "Entrant" text, "Constructor" text, "Chassis" text, "Engine" text )
### Question ###
Who was the constructor of car 22?
### Accurate SQL ###
| SELECT "Constructor" FROM table_20105 WHERE "No" = '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 Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
TABLE: CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
### Question ###
What are the number of the names of products with price at most 200?, and order by the X-axis in asc.
### Accurate SQL ###
| SELECT Name, COUNT(Name) FROM Products WHERE Price <= 200 GROUP BY Name ORDER BY Name |
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_66303 ( "Score" text, "Shooter" text, "Date" text, "Comp" text, "Place" text )
### Question ###
What's the date when the score was 690.3?
### Accurate SQL ###
| SELECT "Date" FROM table_66303 WHERE "Score" = '690.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 table_test_22 ( "id" int, "ejection_fraction_ef" int, "pregnancy_or_lactation" bool, "child_pugh_class" string, "hbv" bool, "systolic_blood_pressure_sbp" int, "active_infection" bool, "leukocyte_count" int, "hiv_infection" bool, "left_ventricular_dysfunction" bool, "active_inflammatory_diseases" bool, "hcv" bool, "neutrophil_count" int, "renal_disease" bool, "leucopenia" bool, "hepatic_disease" bool, "neutropenia" int, "estimated_glomerular_filtration_rate_egfr" int, "platelet_count" float, "thrombocytopenia" float, "diastolic_blood_pressure_dbp" int, "malignancy" bool, "NOUSE" float )
### Question ###
known active infection or chronic infection with hiv, hbv or hcv
### Accurate SQL ###
| SELECT * FROM table_test_22 WHERE active_infection = 1 OR active_infection = 1 AND (hiv_infection = 1 OR hbv = 1 OR hcv = 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_1342292_45 (party VARCHAR, first_elected VARCHAR)
### Question ###
How many incumbents were first elected in 1930?
### Accurate SQL ###
| SELECT COUNT(party) FROM table_1342292_45 WHERE first_elected = 1930 |
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_83 ( louise VARCHAR, dainty_june VARCHAR )
### Question ###
Who was Louise when Tracy Venner was Dainty June?
### Accurate SQL ###
| SELECT louise FROM table_name_83 WHERE dainty_june = "tracy venner" |
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_55 ( hh_principal VARCHAR, wr_principal VARCHAR, hs_principal VARCHAR, maplemere_principal VARCHAR )
### Question ###
Who is the h.h. principal with Jim Haught as h.s. principal, Charlie Taylor as maplemere principal, and Rich Auerbach as w.r. principal?
### Accurate SQL ###
| SELECT hh_principal FROM table_name_55 WHERE hs_principal = "jim haught" AND maplemere_principal = "charlie taylor" AND wr_principal = "rich auerbach" |
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_590 ( "No" real, "Player" text, "Height" text, "Position" text, "Year born" real, "Current Club" text )
### Question ###
What player plays center?
### Accurate SQL ###
| SELECT "Player" FROM table_590 WHERE "Position" = 'Center' |
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_26621 ( "Reference" text, "Author" text, "Section Size" text, "Violins" real, "Violas" real, "Celli" real, "Basses" real )
### Question ###
How many cellos are suggested in the reference with section size for 20 players?
### Accurate SQL ###
| SELECT "Celli" FROM table_26621 WHERE "Section Size" = '20 players' |
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_1341453_22 ( candidates VARCHAR, party VARCHAR, district VARCHAR )
### Question ###
List the candidates in district Maryland 1 where the republican party won.
### Accurate SQL ###
| SELECT candidates FROM table_1341453_22 WHERE party = "Republican" AND district = "Maryland 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 ( date VARCHAR, catalog VARCHAR )
### Question ###
What date has 0-6700-30838-2-9 for a catalog?
### Accurate SQL ###
| SELECT date FROM table_name_88 WHERE catalog = "0-6700-30838-2-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 university ( affiliation VARCHAR )
### Question ###
Find how many different affiliation types there are.
### Accurate SQL ###
| SELECT COUNT(DISTINCT affiliation) FROM 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 table_name_74 (time VARCHAR, name VARCHAR)
### Question ###
What was the Time in the Mina Clavero 2 Stage?
### Accurate SQL ###
| SELECT time FROM table_name_74 WHERE name = "mina clavero 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_25087 ( "#" real, "District" text, "Province" text, "Region" text, "UBIGEO" real, "Elevation (m)" real )
### Question ###
Which province has an elevation of 4550?
### Accurate SQL ###
| SELECT "Province" FROM table_25087 WHERE "Elevation (m)" = '4550' |
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_18828487_1 ( prize_fund VARCHAR, venue VARCHAR )
### Question ###
How much was the prize money for rwe-sporthalle, m lheim ?
### Accurate SQL ###
| SELECT prize_fund FROM table_18828487_1 WHERE venue = "RWE-Sporthalle, Mülheim" |
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_93 (player VARCHAR, total VARCHAR, country VARCHAR)
### Question ###
What player from South Africa had a total less than 284?
### Accurate SQL ###
| SELECT player FROM table_name_93 WHERE total < 284 AND country = "south africa" |
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 customer_orders ( customer_id VARCHAR )
TABLE: CREATE TABLE customers ( customer_name VARCHAR, customer_id VARCHAR )
### Question ###
Show the names of customers having an order with shipping method FedEx and order status Paid.
### Accurate SQL ###
| SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE shipping_method_code = 'FedEx' AND order_status_code = 'Paid' |
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_2668416_18 (candidates VARCHAR, district VARCHAR)
### Question ###
If the district is Virginia 17, who are the candidates?
### Accurate SQL ###
| SELECT candidates FROM table_2668416_18 WHERE district = "Virginia 17" |
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_16805 ( "Week" text, "Date" text, "Opponent" text, "Result" text, "Kickoff [a ]" text, "Game site" text, "TV" text, "Attendance" text, "Record" text )
### Question ###
Which channel had the game against the Minnesota Vikings?
### Accurate SQL ###
| SELECT "TV" FROM table_16805 WHERE "Opponent" = 'Minnesota Vikings' |
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 flight ( flno number, origin text, destination text, distance number, departure_date time, arrival_date time, price number, aid number )
TABLE: CREATE TABLE employee ( eid number, name text, salary number )
TABLE: CREATE TABLE aircraft ( aid number, name text, distance number )
TABLE: CREATE TABLE certificate ( eid number, aid number )
### Question ###
What are the names of the aircraft that the least people are certified to fly?
### Accurate SQL ###
| SELECT T2.name FROM certificate AS T1 JOIN aircraft AS T2 ON T2.aid = T1.aid GROUP BY T1.aid 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_60 ( award VARCHAR, outcome VARCHAR, name VARCHAR )
### Question ###
Anuya Bhagvath was nominated for what award?
### Accurate SQL ###
| SELECT award FROM table_name_60 WHERE outcome = "nominated" AND name = "anuya bhagvath" |
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_11 (tournament VARCHAR, winning_score VARCHAR)
### Question ###
What tournament had a Winning score of –9 (69-72-68-70=279)?
### Accurate SQL ###
| SELECT tournament FROM table_name_11 WHERE winning_score = –9(69 - 72 - 68 - 70 = 279) |
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_7071 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Record" text )
### Question ###
When did the Titans play the Houston Texans at LP Field before Week 13?
### Accurate SQL ###
| SELECT "Date" FROM table_7071 WHERE "Week" < '13' AND "Game site" = 'lp field' AND "Opponent" = 'houston texans' |
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_99 ( year INTEGER, state VARCHAR )
### Question ###
what is the sum of the year in rhode island
### Accurate SQL ###
| SELECT SUM(year) FROM table_name_99 WHERE state = "rhode island" |
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_58050 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
### Question ###
Where was the game when Melbourne was the away team?
### Accurate SQL ###
| SELECT "Venue" FROM table_58050 WHERE "Away team" = 'melbourne' |
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 treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time )
TABLE: CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time )
TABLE: CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time )
TABLE: CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text )
TABLE: CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time )
TABLE: CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number )
TABLE: CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime 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 intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time )
TABLE: CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time )
### Question ###
did patient 013-28507 visit the er in this hospital encounter?
### Accurate SQL ###
| SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '013-28507' AND patient.hospitaladmitsource = 'emergency department' AND patient.hospitaldischargetime 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 instructor (ID VARCHAR, dept_name VARCHAR)
TABLE: CREATE TABLE teaches (ID VARCHAR)
### Question ###
Find the names of all instructors in the Art department who have taught some course and the course_id.
### Accurate SQL ###
| SELECT name, course_id FROM instructor AS T1 JOIN teaches AS T2 ON T1.ID = T2.ID WHERE T1.dept_name = 'Art' |
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 (grid VARCHAR, points VARCHAR, time_retired VARCHAR)
### Question ###
Which Grid has Points larger than 10 and a Time/Retired of +13.7 secs?
### Accurate SQL ###
| SELECT grid FROM table_name_72 WHERE points > 10 AND time_retired = "+13.7 secs" |
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_27741 ( "Rd." text, "Event" text, "Circuit" text, "City / State" text, "Date" text, "Championship" text, "Challenge" text, "Production" text )
### Question ###
What circuit was the Clipsal 500 on?
### Accurate SQL ###
| SELECT "Circuit" FROM table_27741 WHERE "Event" = 'Clipsal 500' |
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_1342292_2 (party VARCHAR, district VARCHAR)
### Question ###
what's the party with district being alabama 3
### Accurate SQL ###
| SELECT party FROM table_1342292_2 WHERE district = "Alabama 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 table_10015132_16 (school_club_team VARCHAR, player VARCHAR)
### Question ###
how many schools or teams had jalen rose
### Accurate SQL ###
| SELECT COUNT(school_club_team) FROM table_10015132_16 WHERE player = "Jalen Rose" |
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 (height VARCHAR, school VARCHAR)
### Question ###
What's the heigh of the player who went to lake howell high school?
### Accurate SQL ###
| SELECT height FROM table_name_72 WHERE school = "lake howell high school" |
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid 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 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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
### Question ###
what is the number of patients whose marital status is single and diagnoses long title is acute vascular insufficiency of intestine?
### Accurate SQL ###
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "SINGLE" AND diagnoses.long_title = "Acute vascular insufficiency of intestine" |
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_46814 ( "Event" text, "Date" text, "Rating" text, "Share" text, "Viewers" text )
### Question ###
What is Date, when Viewers is 4.4 million?
### Accurate SQL ###
| SELECT "Date" FROM table_46814 WHERE "Viewers" = '4.4 million' |
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_1629 ( "Rank" real, "Administrative Division" text, "Area (km\u00b2)" real, "Area (sq mi)" real, "National Share (%)" text, "Comparable Country" text )
### Question ###
What comparable country has a national share of 1.08?
### Accurate SQL ###
| SELECT "Comparable Country" FROM table_1629 WHERE "National Share (%)" = '1.08' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.