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_77342 ( "Call sign" text, "Frequency" text, "City of license" text, "State" text, "FCC info" text )
### Question ###
What state is the radio station in that has a frequency of 90.1 FM and a city license in New Castle?
### Accurate SQL ###
|
SELECT "State" FROM table_77342 WHERE "Frequency" = '90.1 fm' AND "City of license" = 'new castle'
|
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 (circuit VARCHAR, fastest_lap VARCHAR, tyre VARCHAR, pole_position VARCHAR)
### Question ###
When Jackie Stewart had the fastest lap and Jochen Rindt held the pole position with a D tyre, what was the circuit?
### Accurate SQL ###
|
SELECT circuit FROM table_name_16 WHERE tyre = "d" AND pole_position = "jochen rindt" AND fastest_lap = "jackie stewart"
|
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 TOURIST_ATTRACTIONS ( Tourist_Attraction_ID VARCHAR, How_to_Get_There VARCHAR )
TABLE: CREATE TABLE Street_Markets ( Market_Details VARCHAR, Market_ID VARCHAR )
### Question ###
What are the details of the markets that can be accessed by walk or bus?
### Accurate SQL ###
|
SELECT T1.Market_Details FROM Street_Markets AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Market_ID = T2.Tourist_Attraction_ID WHERE T2.How_to_Get_There = "walk" OR T2.How_to_Get_There = "bus"
|
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 invoiceline ( invoicelineid number, invoiceid number, trackid number, unitprice number, quantity number )
TABLE: CREATE TABLE genre ( genreid number, name text )
TABLE: CREATE TABLE customer ( customerid number, firstname text, lastname text, company text, address text, city text, state text, country text, postalcode text, phone text, fax text, email text, supportrepid number )
TABLE: CREATE TABLE invoice ( invoiceid number, customerid number, invoicedate time, billingaddress text, billingcity text, billingstate text, billingcountry text, billingpostalcode text, total number )
TABLE: CREATE TABLE album ( albumid number, title text, artistid number )
TABLE: CREATE TABLE artist ( artistid number, name text )
TABLE: CREATE TABLE playlisttrack ( playlistid number, trackid number )
TABLE: CREATE TABLE employee ( employeeid number, lastname text, firstname text, title text, reportsto number, birthdate time, hiredate time, address text, city text, state text, country text, postalcode text, phone text, fax text, email text )
TABLE: CREATE TABLE track ( trackid number, name text, albumid number, mediatypeid number, genreid number, composer text, milliseconds number, bytes number, unitprice number )
TABLE: CREATE TABLE playlist ( playlistid number, name text )
TABLE: CREATE TABLE mediatype ( mediatypeid number, name text )
### Question ###
Find the cities corresponding to employees who help customers with the postal code 70174.
### Accurate SQL ###
|
SELECT T2.city FROM customer AS T1 JOIN employee AS T2 ON T1.supportrepid = T2.employeeid WHERE T1.postalcode = "70174"
|
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_train_197 ( "id" int, "dyscrasia" bool, "gender" string, "bleeding" int, "hemoglobin_a1c_hba1c" float, "diabetic" string, "body_mass_index_bmi" float, "age" float, "NOUSE" float )
### Question ###
type ii diabetes patients with an hba1c score over 7
### Accurate SQL ###
|
SELECT * FROM table_train_197 WHERE diabetic = 'ii' AND hemoglobin_a1c_hba1c > 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 table_name_35 ( Id VARCHAR )
### Question ###
What was the 2008 value when 2012 was Grand Slam Tournaments?
### Accurate SQL ###
|
SELECT 2008 FROM table_name_35 WHERE 2012 = "grand slam tournaments"
|
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_46 ( score VARCHAR, record VARCHAR )
### Question ###
What is the score of the game that resulted in a 15-9 record?
### Accurate SQL ###
|
SELECT score FROM table_name_46 WHERE record = "15-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 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 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 )
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 )
### Question ###
what is drug type and drug route of drug name lidocaine 5% patch?
### Accurate SQL ###
|
SELECT prescriptions.drug_type, prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Lidocaine 5% Patch"
|
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 ( venue VARCHAR, against VARCHAR, opposing_team VARCHAR )
### Question ###
Which venue has an against value larger than 21 and had Argentina as an opposing team.
### Accurate SQL ###
|
SELECT venue FROM table_name_91 WHERE against > 21 AND opposing_team = "argentina"
|
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 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 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 )
### Question ###
give me the number of patients whose admission year is less than 2131 and diagnoses short title is other staphylococcus?
### Accurate SQL ###
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2131" AND diagnoses.short_title = "Other staphylococcus"
|
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 d_icd_procedures ( 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 cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost 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 patients ( row_id number, subject_id number, gender text, dob time, dod time )
TABLE: CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom 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 inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number )
TABLE: CREATE TABLE d_labitems ( row_id number, itemid number, label 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 diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time )
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 d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title 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_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 )
### Question ###
when did patient 13837 first have the minimum value of arterial bp mean on 05/20/2105?
### Accurate SQL ###
|
SELECT chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13837)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp mean' AND d_items.linksto = 'chartevents') AND STRFTIME('%y-%m-%d', chartevents.charttime) = '2105-05-20' ORDER BY chartevents.valuenum, chartevents.charttime 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_75 (rank INTEGER, bronze VARCHAR, gold VARCHAR)
### Question ###
What is the rank of the nation that has more than 1 Bronze medals and fewer than 4 Gold medals?
### Accurate SQL ###
|
SELECT MIN(rank) FROM table_name_75 WHERE bronze > 1 AND gold < 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_95 (pick__number INTEGER, reg_gp VARCHAR, pl_gp VARCHAR)
### Question ###
Which mean pick number had a Reg GP of 0, and a Pl GP that was bigger than 0?
### Accurate SQL ###
|
SELECT AVG(pick__number) FROM table_name_95 WHERE reg_gp = 0 AND pl_gp > 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_57235 ( "Place" real, "Name" text, "From" real, "Until" real, "Titles" real, "Seconds" text, "Thirds" text )
### Question ###
How many seconds did the champion who started in 1971 and placed above 2 have?
### Accurate SQL ###
|
SELECT "Seconds" FROM table_57235 WHERE "From" > '1971' AND "Place" < '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_39 ( athletes VARCHAR, run_2 VARCHAR )
### Question ###
Which Athletes have a Run 2 of 2:21.82?
### Accurate SQL ###
|
SELECT athletes FROM table_name_39 WHERE run_2 = "2:21.82"
|
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_27 ( surface VARCHAR, week VARCHAR )
### Question ###
On what surface did they play the match in the week of October 21?
### Accurate SQL ###
|
SELECT surface FROM table_name_27 WHERE week = "october 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 table_58124 ( "Title" text, "Pages" text, "First edition" text, "Second edition" text, "ISBN" text )
### Question ###
Which first edition has an ISBN of 978-0785166252?
### Accurate SQL ###
|
SELECT "First edition" FROM table_58124 WHERE "ISBN" = '978-0785166252'
|
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 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 )
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 )
### Question ###
how many patients admitted urgently are on main drug type prescription?
### Accurate SQL ###
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "URGENT" AND prescriptions.drug_type = "MAIN"
|
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 (treaty_of_cession VARCHAR, colony VARCHAR)
### Question ###
When was the Treaty of Cession for Karikal Colony?
### Accurate SQL ###
|
SELECT treaty_of_cession FROM table_name_60 WHERE colony = "karikal"
|
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_69 ( Id VARCHAR )
### Question ###
Name the 2012 with 2013 of 2r and 2009 of 3r
### Accurate SQL ###
|
SELECT 2012 FROM table_name_69 WHERE 2013 = "2r" AND 2009 = "3r"
|
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_49 (place VARCHAR, player VARCHAR)
### Question ###
What place is Ben Hogan?
### Accurate SQL ###
|
SELECT place FROM table_name_49 WHERE player = "ben hogan"
|
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 ( date_of_delivery VARCHAR, baby_gender VARCHAR, congresswoman VARCHAR )
### Question ###
What was the delivery date of Congresswoman Kirsten Gillibrand's baby boy?
### Accurate SQL ###
|
SELECT date_of_delivery FROM table_name_55 WHERE baby_gender = "boy" AND congresswoman = "kirsten gillibrand"
|
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 Addresses ( line_1 VARCHAR, address_id VARCHAR )
TABLE: CREATE TABLE Student_Addresses ( monthly_rental INTEGER, address_id VARCHAR )
### Question ###
What are the line 1 and average monthly rentals of all student addresses?
### Accurate SQL ###
|
SELECT T1.line_1, AVG(T2.monthly_rental) FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id = T2.address_id GROUP BY T2.address_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_203_54 ( id number, "selected\nlatin american\ncountries" text, "internl.\ntourism\narrivals\n2010\n(x 1000)" number, "internl.\ntourism\nreceipts.\n2010\n(usd\n(x1000)" number, "average\nreceipt\nper visitor\n2009\n(usd/turista)" number, "tourist\narrivals\nper\n1000 inhab\n(estimated)\n2007" number, "receipts\nper\ncapita\n2005\nusd" number, "revenues\nas %\nexports of\ngoods and\nservices\n2003" number, "tourism\nincome\n%\ngdp\n2003" number, "% direct and\nindirect\nemployment\nin tourism\n2005" number, "world\nranking\ntourism\ncompetitiv.\nttci\n2011" number, "2011\nttci\nindex" number )
### Question ###
what country makes the most tourist income ?
### Accurate SQL ###
|
SELECT "selected\nlatin american\ncountries" FROM table_203_54 ORDER BY "tourism\nincome\n%\ngdp\n2003" 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 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 diagnoses ( 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 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 )
### Question ###
give me the number of patients whose diagnoses icd9 code is 29281 and lab test fluid is blood?
### Accurate SQL ###
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "29281" AND lab.fluid = "Blood"
|
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_10333757_1 ( branding VARCHAR, calls VARCHAR )
### Question ###
What Branding does WRKO calls use?
### Accurate SQL ###
|
SELECT branding FROM table_10333757_1 WHERE calls = "WRKO"
|
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 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 allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime 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 treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime 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 lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime 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 )
TABLE: CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number )
### Question ###
what was patient 030-10559's first output time of the urine on 11/16/this year?
### 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 = '030-10559')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput.celllabel = 'urine' AND DATETIME(intakeoutput.intakeoutputtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME('%m-%d', intakeoutput.intakeoutputtime) = '11-16' ORDER BY intakeoutput.intakeoutputtime 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 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 ###
provide the number of patients whose admission location is trsf within this facility and lab test fluid is cerebrospinal fluid (csf)?
### Accurate SQL ###
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND lab.fluid = "Cerebrospinal Fluid (CSF)"
|
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_3935 ( "Round" real, "Race" text, "Pole position" text, "Fastest lap" text, "Most laps led" text, "Driver" text, "Team" text, "Manufacturer" text, "Report" text )
### Question ###
Who was the driver in round 8?
### Accurate SQL ###
|
SELECT "Driver" FROM table_3935 WHERE "Round" = '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_29664 ( "Episode Air Date" text, "Audition City" text, "Audition Date" text, "Audition Venue" text, "Guest Fourth Judge" text )
### Question ###
List all episode air dates where Luiza Possi was the guest fourth judge?
### Accurate SQL ###
|
SELECT "Episode Air Date" FROM table_29664 WHERE "Guest Fourth Judge" = 'Luiza Possi'
|
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_39802 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time/Retired" text, "Grid" real )
### Question ###
What kind of Manufacturer has a Laps smaller than 20 and a Grid of 21
### Accurate SQL ###
|
SELECT "Manufacturer" FROM table_39802 WHERE "Laps" < '20' AND "Grid" = '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 table_name_47 (attendance VARCHAR, visitor VARCHAR)
### Question ###
How many people attended the game that had the Clippers as visiting team?
### Accurate SQL ###
|
SELECT attendance FROM table_name_47 WHERE visitor = "clippers"
|
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 ( team VARCHAR, series VARCHAR )
### Question ###
WHAT IS THE TEAM WITH astc round 1?
### Accurate SQL ###
|
SELECT team FROM table_name_56 WHERE series = "astc round 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_22494 ( "Athlete" text, "Class" text, "Event" text, "Round of 64" text, "Round of 32" text, "Round of 16" text, "Quarterfinals" text, "Semifinals" text, "Final/ Bronze medal match" text )
### Question ###
When scheffers ( ned ) l 3-6, 1-6 is the final/ bronze medal match what was the event?
### Accurate SQL ###
|
SELECT "Event" FROM table_22494 WHERE "Final/ Bronze medal match" = 'Scheffers ( NED ) L 3-6, 1-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 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 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 medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime 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 intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time )
TABLE: CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time )
TABLE: CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time )
### Question ###
what is the five most frequently prescribed drugs for patients that have been prescribed with morphine variable dose 2-4mg at the same time in 2105?
### Accurate SQL ###
|
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'morphine variable dose 2-4mg' AND STRFTIME('%y', medication.drugstarttime) = '2105') AS t1 JOIN (SELECT patient.uniquepid, medication.drugname, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE STRFTIME('%y', medication.drugstarttime) = '2105') AS t2 ON t1.uniquepid = t2.uniquepid WHERE DATETIME(t1.drugstarttime) = DATETIME(t2.drugstarttime) GROUP BY t2.drugname) AS t3 WHERE t3.c1 <= 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 table_25019 ( "State (class)" text, "Vacator" text, "Reason for change" text, "Successor" text, "Date of successors formal installation" text )
### Question ###
how many times has Aaron Ogden (f), been a successor and has had a formal installation?
### Accurate SQL ###
|
SELECT COUNT("Date of successors formal installation") FROM table_25019 WHERE "Successor" = 'Aaron Ogden (F)'
|
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_30666 ( "Couple" text, "Style" text, "Music" text, "Trine Dehli Cleve" real, "Tor Fl\u00f8ysvik" real, "Karianne Gulliksen" real, "Christer Tornell" real, "Total" real )
### Question ###
Name the most for fl ysvik for 8
### Accurate SQL ###
|
SELECT MAX("Tor Fl\u00f8ysvik") FROM table_30666 WHERE "Karianne Gulliksen" = '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_9 ( date VARCHAR, venue VARCHAR, goal VARCHAR )
### Question ###
When was the venue mexico city, mexico with a goal of 8?
### Accurate SQL ###
|
SELECT date FROM table_name_9 WHERE venue = "mexico city, mexico" AND goal = 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 Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
TABLE: CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
### Question ###
For those records from the products and each product's manufacturer, find name and the average of price , and group by attribute name, and visualize them by a bar chart, order Y from high to low order.
### Accurate SQL ###
|
SELECT T2.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Price 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_83 ( player VARCHAR, total VARCHAR, to_par VARCHAR )
### Question ###
What is Player, when Total is greater than 148, and when To Par is '12'?
### Accurate SQL ###
|
SELECT player FROM table_name_83 WHERE total > 148 AND to_par = 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 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 vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time )
TABLE: CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime 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 lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime 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 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 )
### Question ###
until 02/25/2100, what was the yearly average dose of volume (ml) heparin of patient 005-9883?
### Accurate SQL ###
|
SELECT AVG(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-9883')) AND intakeoutput.celllabel = 'volume (ml) heparin' AND intakeoutput.cellpath LIKE '%intake%' AND STRFTIME('%y-%m-%d', intakeoutput.intakeoutputtime) <= '2100-02-25' GROUP BY STRFTIME('%y', intakeoutput.intakeoutputtime)
|
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_train_155 ( "id" int, "cholesterol" float, "bleeding" int, "systolic_blood_pressure_sbp" int, "diabetic" string, "hyperlipidemia" bool, "creatinine_clearance_cl" float, "platelet_count" float, "hypertension" bool, "NOUSE" float )
### Question ###
urine albumin > 300 mg / g creatinine
### Accurate SQL ###
|
SELECT * FROM table_train_155 WHERE creatinine_clearance_cl > 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 table_57674 ( "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 score at VFL Park?
### Accurate SQL ###
|
SELECT "Away team score" FROM table_57674 WHERE "Venue" = 'vfl park'
|
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_70798 ( "Date" text, "Opponents" text, "Result F\u2013A" text, "Attendance" real, "Group position" text )
### Question ###
Date of 24 september 2002 is what group position?
### Accurate SQL ###
|
SELECT "Group position" FROM table_70798 WHERE "Date" = '24 september 2002'
|
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 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 outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number )
TABLE: CREATE TABLE d_items ( row_id number, itemid number, label text, linksto 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 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_labitems ( row_id number, itemid number, label 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 patients ( row_id number, subject_id number, gender text, dob time, dod time )
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_diagnoses ( row_id number, icd9_code text, short_title text, long_title 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_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 cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number )
TABLE: CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text )
### Question ###
tell me the name of the medication patient 27467 was prescribed within 2 days after being diagnosed with iron defic anemia nos in 08/2105?
### Accurate SQL ###
|
SELECT t2.drug FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 27467 AND diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'iron defic anemia nos') AND STRFTIME('%y-%m', diagnoses_icd.charttime) = '2105-08') AS t1 JOIN (SELECT admissions.subject_id, prescriptions.drug, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 27467 AND STRFTIME('%y-%m', prescriptions.startdate) = '2105-08') AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.startdate AND DATETIME(t2.startdate) BETWEEN DATETIME(t1.charttime) AND DATETIME(t1.charttime, '+2 day')
|
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_78 ( winning_driver VARCHAR, pole_position VARCHAR )
### Question ###
What driver was the winner when Joakim Bonnier was in the Pole Position?
### Accurate SQL ###
|
SELECT winning_driver FROM table_name_78 WHERE pole_position = "joakim bonnier"
|
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_89 ( killeen_rate INTEGER, texas_rate VARCHAR, us_rate VARCHAR )
### Question ###
Texas Rate smaller than 32.9, and a U.S. Rate larger than 5.6 is what highest killeen rate?
### Accurate SQL ###
|
SELECT MAX(killeen_rate) FROM table_name_89 WHERE texas_rate < 32.9 AND us_rate > 5.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_21 (opponent VARCHAR, game VARCHAR, record VARCHAR)
### Question ###
Who is the opponent of Game 1 with a 3-2-0 record?
### Accurate SQL ###
|
SELECT opponent FROM table_name_21 WHERE game > 1 AND record = "3-2-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_name_18 ( year_in_novel VARCHAR, published_as_serial VARCHAR )
### Question ###
Which year in novel has a Published as serial of november 1934-april 1935, blue book?
### Accurate SQL ###
|
SELECT year_in_novel FROM table_name_18 WHERE published_as_serial = "november 1934-april 1935, blue book"
|
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_25730460_2 ( extra_points INTEGER )
### Question ###
Name the least extra points
### Accurate SQL ###
|
SELECT MIN(extra_points) FROM table_25730460_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_76 ( date VARCHAR, region VARCHAR )
### Question ###
Which date had a Japan region?
### Accurate SQL ###
|
SELECT date FROM table_name_76 WHERE region = "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_70 (date VARCHAR, venue VARCHAR)
### Question ###
What date was the game played at the venue of Hrazdan Stadium, Yerevan, Armenia?
### Accurate SQL ###
|
SELECT date FROM table_name_70 WHERE venue = "hrazdan stadium, yerevan, armenia"
|
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 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 d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text )
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_labitems ( row_id number, itemid number, label 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 inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount 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 patients ( row_id number, subject_id number, gender text, dob time, dod time )
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 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 diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time )
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 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 procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time )
### Question ###
how many people died after being diagnosed with fracture one rib-closed during the same month until 1 year ago?
### Accurate SQL ###
|
SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime 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 = 'fracture one rib-closed')) AS t1 GROUP BY t1.subject_id HAVING MIN(t1.charttime) = t1.charttime AND DATETIME(t1.charttime) <= DATETIME(CURRENT_TIME(), '-1 year')) AS t2 JOIN (SELECT patients.subject_id, admissions.hadm_id, patients.dod FROM admissions JOIN patients ON patients.subject_id = admissions.subject_id WHERE NOT patients.dod IS NULL AND DATETIME(patients.dod) <= DATETIME(CURRENT_TIME(), '-1 year')) AS t3 ON t2.subject_id = t3.subject_id WHERE DATETIME(t2.charttime, 'start of month') = DATETIME(t3.dod, 'start of 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_41072 ( "Player" text, "Matches" real, "Innings" real, "Not Out" real, "Runs" real, "High Score" text, "Average" text, "Strike Rate" text, "100s" real )
### Question ###
How many average 100s were there for Tim Bresnan?
### Accurate SQL ###
|
SELECT AVG("100s") FROM table_41072 WHERE "Player" = 'tim bresnan'
|
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 diagnoses ( 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 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 ###
provide the number of patients whose death status is 0 and diagnoses short title is preterm nec 1750-1999g?
### Accurate SQL ###
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "0" AND diagnoses.short_title = "Preterm NEC 1750-1999g"
|
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_518 ( "Series Ep #" real, "Season 2 Ep #" real, "Title" text, "Director" text, "Writer(s)" text, "Original Airdate" text, "Production Code" real )
### Question ###
Provide me with the name of the writer with the production code 210.
### Accurate SQL ###
|
SELECT "Writer(s)" FROM table_518 WHERE "Production Code" = '210'
|
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_3235 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Canadian air date" text, "Fox Int. air date" text )
### Question ###
What is the highest season# for the writer Daegan Fryklind?
### Accurate SQL ###
|
SELECT MAX("Season #") FROM table_3235 WHERE "Written by" = 'Daegan Fryklind'
|
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_70189 ( "Year" text, "Venue" text, "Winners" text, "Runner-up" text, "3rd place" text )
### Question ###
Who was the runner-up in 2004?
### Accurate SQL ###
|
SELECT "Runner-up" FROM table_70189 WHERE "Year" = '2004'
|
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 (rowers VARCHAR, time VARCHAR)
### Question ###
What rowers have a 6:29.56 time?
### Accurate SQL ###
|
SELECT rowers FROM table_name_64 WHERE time = "6:29.56"
|
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_65744 ( "Original NFL team" text, "Player" text, "Pos." text, "College" text, "Conf." text )
### Question ###
What is the College of the LB Player with Big Ten Conf.?
### Accurate SQL ###
|
SELECT "College" FROM table_65744 WHERE "Pos." = 'lb' AND "Conf." = 'big ten'
|
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 (ends_lost INTEGER, stolen_ends_for VARCHAR, stolen_ends_against VARCHAR)
### Question ###
What is the lowest ends lost when the stolen ends for is less than 13, and stolten ends against is 6?
### Accurate SQL ###
|
SELECT MIN(ends_lost) FROM table_name_16 WHERE stolen_ends_for < 13 AND stolen_ends_against = 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_74 ( year INTEGER, location VARCHAR, anthem VARCHAR )
### Question ###
What is the earliest year it was located in gelredome, arnhem, and a Anthem of technoboy - next dimensional world?
### Accurate SQL ###
|
SELECT MIN(year) FROM table_name_74 WHERE location = "gelredome, arnhem" AND anthem = "technoboy - next dimensional world"
|
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 player (Team VARCHAR, Age VARCHAR)
### Question ###
Find the team of the player of the highest age.
### Accurate SQL ###
|
SELECT Team FROM player ORDER BY Age 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 medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime 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 lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime 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 intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time )
TABLE: CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time )
TABLE: CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code 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 cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number )
### Question ###
count the number of patients who have been dead after having been diagnosed with metabolic acidosis - due to bicarbonate loss during the same hospital visit in a year before.
### Accurate SQL ###
|
SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT t1.uniquepid, t1.diagnosistime, t1.patienthealthsystemstayid FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'metabolic acidosis - due to bicarbonate loss') AS t1 GROUP BY t1.uniquepid HAVING MIN(t1.diagnosistime) = t1.diagnosistime AND DATETIME(t1.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t2 JOIN (SELECT patient.uniquepid, patient.patienthealthsystemstayid, patient.hospitaldischargetime FROM patient WHERE patient.hospitaldischargestatus = 'expired') AS t3 ON t2.uniquepid = t3.uniquepid WHERE t2.patienthealthsystemstayid = t3.patienthealthsystemstayid
|
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 ( year INTEGER, result VARCHAR, group VARCHAR, award VARCHAR )
### Question ###
What is the average Year that has the Group, Logie Award, the Award, Most Outstanding Actor, and the Result, nominated?
### Accurate SQL ###
|
SELECT AVG(year) FROM table_name_79 WHERE group = "logie award" AND award = "most outstanding actor" 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_14 (label VARCHAR, region VARCHAR)
### Question ###
What was the label in Japan?
### Accurate SQL ###
|
SELECT label FROM table_name_14 WHERE region = "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_12379297_1 ( coverage__transmitter_site_ VARCHAR, callsign VARCHAR, station_type VARCHAR, power__kw_ VARCHAR )
### Question ###
What is the coverage of relay 5kw of dyfj-tv?
### Accurate SQL ###
|
SELECT coverage__transmitter_site_ FROM table_12379297_1 WHERE station_type = "Relay" AND power__kw_ = "5kW" AND callsign = "DYFJ-TV"
|
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 ( played INTEGER, position VARCHAR, drawn VARCHAR )
### Question ###
How much Played has a Position of 7, and a Drawn smaller than 7?
### Accurate SQL ###
|
SELECT SUM(played) FROM table_name_72 WHERE position = 7 AND drawn < 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 table_79670 ( "School" text, "Location" text, "Mascot" text, "Size" real, "IHSAA Class" text, "County" text, "Year Joined" real, "Previous Conference" text )
### Question ###
What is the size of the team that was previously from Central Indiana conference, and is in IHSSA Class 4a?
### Accurate SQL ###
|
SELECT "Size" FROM table_79670 WHERE "IHSAA Class" = '4a' AND "Previous Conference" = 'central indiana'
|
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_69 (spike INTEGER, weight VARCHAR, height VARCHAR)
### Question ###
What is the smallest number of spikes for players with a weight of 83 and height over 190?
### Accurate SQL ###
|
SELECT MIN(spike) FROM table_name_69 WHERE weight = 83 AND height > 190
|
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_22810095_9 (name VARCHAR, age VARCHAR)
### Question ###
What player is 24 years old?
### Accurate SQL ###
|
SELECT name FROM table_22810095_9 WHERE age = 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_14845640_1 ( written_by VARCHAR, us_viewers__millions_ VARCHAR )
### Question ###
Name the written by for 16.32 million viewers
### Accurate SQL ###
|
SELECT written_by FROM table_14845640_1 WHERE us_viewers__millions_ = "16.32"
|
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_9 (cups INTEGER, total VARCHAR, player VARCHAR, other VARCHAR, league VARCHAR)
### Question ###
What is the number of cups when the other was more than 3, the league more than 3, for Lauri Dalla Valle, and a Total more than 21?
### Accurate SQL ###
|
SELECT AVG(cups) FROM table_name_9 WHERE other > 3 AND league > 3 AND player = "lauri dalla valle" AND total > 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 table_27986200_3 ( match_points VARCHAR, eliminated_from_competition VARCHAR )
### Question ###
What were the match points when Bordeaux-B gles was eliminated from competition?
### Accurate SQL ###
|
SELECT match_points FROM table_27986200_3 WHERE eliminated_from_competition = "Bordeaux-Bègles"
|
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_89 ( player VARCHAR, strike_rate VARCHAR )
### Question ###
Which player has 79.62 as the strike rate?
### Accurate SQL ###
|
SELECT player FROM table_name_89 WHERE strike_rate = "79.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_203_90 ( id number, "religious\ngroup" text, "population\n%" text, "growth\n(1991-2001)" text, "sex ratio\n(total)" number, "literacy\n(%)" text, "work participation\n(%)" text, "sex ratio\n(rural)" number, "sex ratio\n(urban)" number, "sex ratio\n(child)" number )
### Question ###
which is the only religious group to have a literacy rate above 90 % ?
### Accurate SQL ###
|
SELECT "religious\ngroup" FROM table_203_90 WHERE "literacy\n(%)" > 90
|
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_22 (winning_driver VARCHAR, constructor VARCHAR, race_name VARCHAR)
### Question ###
Who was the winner of the XII Spring Trophy race with BRM as the constructor?
### Accurate SQL ###
|
SELECT winning_driver FROM table_name_22 WHERE constructor = "brm" AND race_name = "xii spring trophy"
|
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_3 (floors VARCHAR, rank VARCHAR, height VARCHAR, _m__ft_ VARCHAR)
### Question ###
How many floors were there with a building rank of less than 3 and a height of 300 / 985 m (ft)?
### Accurate SQL ###
|
SELECT COUNT(floors) FROM table_name_3 WHERE height * _m__ft_ = "300 / 985" AND rank < 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_name_3 ( penanced VARCHAR, number_of_autos_da_fé_with_known_sentences VARCHAR )
### Question ###
How many were penanced when the number with known sentences was 71 (1600 1773)?
### Accurate SQL ###
|
SELECT penanced FROM table_name_3 WHERE number_of_autos_da_fé_with_known_sentences = "71 (1600–1773)"
|
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_22265 ( "Foodstuff" text, "Pinoresinol" real, "Syringaresinol" real, "Sesamin" text, "Lariciresinol" real, "Secoisolariciresinol" real, "Matairesinol" real, "Hydroxymatairesinol" real )
### Question ###
what is the minimum number is lariciresinol where matairesinol number is 440?
### Accurate SQL ###
|
SELECT MIN("Lariciresinol") FROM table_22265 WHERE "Matairesinol" = '440'
|
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_78 ( date VARCHAR, home___away VARCHAR, location_attendance VARCHAR )
### Question ###
What is the date of the away game at the Blue Cross Arena?
### Accurate SQL ###
|
SELECT date FROM table_name_78 WHERE home___away = "away" AND location_attendance = "blue cross 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_23279434_1 ( season__number VARCHAR, production_code VARCHAR )
### Question ###
Which season used production code 'am10'?
### Accurate SQL ###
|
SELECT COUNT(season__number) FROM table_23279434_1 WHERE production_code = "AM10"
|
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_28719 ( "Monarch" text, "Heir" text, "Status" text, "Relationship to Monarch" text, "Became heir
TABLE: reason" text, "Ceased to be heir
TABLE: reason" text, "Next in succession" text )
### Question ###
When is the became heir; reason when heir is hsinbyushin?
### Accurate SQL ###
|
SELECT "Became heir; reason" FROM table_28719 WHERE "Heir" = 'Hsinbyushin'
|
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_20851 ( "Player" text, "No." text, "Nationality" text, "Position" text, "Years for Grizzlies" text, "School/Club Team" text )
### Question ###
What player was on the Grizzlies from 2009-2013?
### Accurate SQL ###
|
SELECT "Player" FROM table_20851 WHERE "Years for Grizzlies" = '2009-2013'
|
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_65 (playoffs_mvp VARCHAR, result VARCHAR, champions VARCHAR)
### Question ###
What is the Playoffs MVP of the game with a Result of 4–1 with Champions Daejeon Hyundai Dynat?
### Accurate SQL ###
|
SELECT playoffs_mvp FROM table_name_65 WHERE result = "4–1" AND champions = "daejeon hyundai dynat"
|
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 VISITS ( Tourist_Attraction_ID VARCHAR, Tourist_ID VARCHAR )
TABLE: CREATE TABLE VISITORS ( Tourist_Details VARCHAR, Tourist_ID VARCHAR )
TABLE: CREATE TABLE Tourist_Attractions ( Name VARCHAR, Tourist_Attraction_ID VARCHAR )
### Question ###
What are the names of tourist attraction that Alison visited but Rosalind did not visit?
### Accurate SQL ###
|
SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = "Alison" EXCEPT SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = "Rosalind"
|
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_24565004_7 (nationality² VARCHAR, name VARCHAR)
### Question ###
What is the nationality of Louis floch
### Accurate SQL ###
|
SELECT nationality² FROM table_24565004_7 WHERE name = "Louis Floch"
|
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_72384 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text )
### Question ###
how many result with district being florida 14
### Accurate SQL ###
|
SELECT COUNT("Result") FROM table_72384 WHERE "District" = 'Florida 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 resultsdata15 ( sample_pk number, commod text, commtype text, lab text, pestcode text, testclass text, concen number, lod number, conunit text, confmethod text, confmethod2 text, annotate text, quantitate text, mean text, extract text, determin text )
TABLE: CREATE TABLE sampledata15 ( sample_pk number, state text, year text, month text, day text, site text, commod text, source_id text, variety text, origin text, country text, disttype text, commtype text, claim text, quantity number, growst text, packst text, distst text )
### Question ###
If sample 6480 is imported, which country is it originally from?
### Accurate SQL ###
|
SELECT country FROM sampledata15 WHERE sample_pk = 6480 AND origin = 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_204_683 ( id number, "no." number, "constituency" text, "winner candidate" text, "party" text, "votes" number, "margin" number )
### Question ###
what is the previous winner candidate of dr. nimaben aacharya ?
### Accurate SQL ###
|
SELECT "winner candidate" FROM table_204_683 WHERE "no." = (SELECT "no." FROM table_204_683 WHERE "winner candidate" = 'dr nimaben aacharya') - 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 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 ###
Give me the comparison about the sum of School_ID over the ACC_Road , and group by attribute ACC_Road by a bar chart, display from low to high by the X-axis.
### Accurate SQL ###
|
SELECT ACC_Road, SUM(School_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road
|
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_20996923_20 (date VARCHAR, city VARCHAR)
### Question ###
What is the date when the city is San Antonio, Texas?
### Accurate SQL ###
|
SELECT date FROM table_20996923_20 WHERE city = "San Antonio, Texas"
|
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 ( Id VARCHAR )
### Question ###
What is the 2007 value for the 2010 wta premier 5 tournaments?
### Accurate SQL ###
|
SELECT 2007 FROM table_name_12 WHERE 2010 = "wta premier 5 tournaments"
|
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_36 ( latest_stable_release VARCHAR, price_in_usd VARCHAR )
### Question ###
Name the Latest stable release that has a Price in USD of free / negotiable?
### Accurate SQL ###
|
SELECT latest_stable_release FROM table_name_36 WHERE price_in_usd = "free / negotiable"
|
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_539 ( id number, "date" text, "name" text, "moving from" text, "moving to" text, "fee" text )
### Question ###
who had the most or highest transfer fee ?
### Accurate SQL ###
|
SELECT "name" FROM table_204_539 ORDER BY "fee" 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 manufacturer ( Manufacturer_ID int, Open_Year real, Name text, Num_of_Factories int, Num_of_Shops int )
TABLE: CREATE TABLE furniture ( Furniture_ID int, Name text, Num_of_Component int, Market_Rate real )
TABLE: CREATE TABLE furniture_manufacte ( Manufacturer_ID int, Furniture_ID int, Price_in_Dollar real )
### Question ###
Please give me a bar chart to show the market share of different furniture name, which no any company is producing in our records by a pie chart, and order in desc by the names please.
### Accurate SQL ###
|
SELECT Name, Market_Rate FROM furniture WHERE NOT Furniture_ID IN (SELECT Furniture_ID FROM furniture_manufacte) ORDER BY 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_name_67 ( surface VARCHAR, opponent VARCHAR )
### Question ###
On which Surface will Estrella Cabeza Candela play?
### Accurate SQL ###
|
SELECT surface FROM table_name_67 WHERE opponent = "estrella cabeza candela"
|
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_59 (Id VARCHAR)
### Question ###
What is the 1993 value of the 1994 atp masters series?
### Accurate SQL ###
|
SELECT 1993 FROM table_name_59 WHERE 1994 = "atp masters series"
|
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 Addresses ( address_id INTEGER, address_details VARCHAR(255) )
TABLE: CREATE TABLE Suppliers ( supplier_id INTEGER, supplier_name VARCHAR(80), supplier_phone VARCHAR(80) )
TABLE: CREATE TABLE Products ( product_id INTEGER, product_type_code VARCHAR(10), product_name VARCHAR(80), product_price DECIMAL(19,4) )
TABLE: CREATE TABLE Product_Suppliers ( product_id INTEGER, supplier_id INTEGER, date_supplied_from DATETIME, date_supplied_to DATETIME, total_amount_purchased VARCHAR(80), total_value_purchased DECIMAL(19,4) )
TABLE: CREATE TABLE Customer_Orders ( order_id INTEGER, customer_id INTEGER, order_status_code VARCHAR(10), order_date DATETIME )
TABLE: CREATE TABLE Order_Items ( order_item_id INTEGER, order_id INTEGER, product_id INTEGER )
TABLE: CREATE TABLE Customers ( customer_id INTEGER, payment_method_code VARCHAR(10), customer_code VARCHAR(20), customer_name VARCHAR(80), customer_address VARCHAR(255), customer_phone VARCHAR(80), customer_email VARCHAR(80) )
TABLE: CREATE TABLE Supplier_Addresses ( supplier_id INTEGER, address_id INTEGER, date_from DATETIME, date_to DATETIME )
TABLE: CREATE TABLE Department_Stores ( dept_store_id INTEGER, dept_store_chain_id INTEGER, store_name VARCHAR(80), store_address VARCHAR(255), store_phone VARCHAR(80), store_email VARCHAR(80) )
TABLE: CREATE TABLE Staff_Department_Assignments ( staff_id INTEGER, department_id INTEGER, date_assigned_from DATETIME, job_title_code VARCHAR(10), date_assigned_to DATETIME )
TABLE: CREATE TABLE Departments ( department_id INTEGER, dept_store_id INTEGER, department_name VARCHAR(80) )
TABLE: CREATE TABLE Customer_Addresses ( customer_id INTEGER, address_id INTEGER, date_from DATETIME, date_to DATETIME )
TABLE: CREATE TABLE Department_Store_Chain ( dept_store_chain_id INTEGER, dept_store_chain_name VARCHAR(80) )
TABLE: CREATE TABLE Staff ( staff_id INTEGER, staff_gender VARCHAR(1), staff_name VARCHAR(80) )
### Question ###
I want to know the proportion of the total number for each payment method code.
### Accurate SQL ###
|
SELECT payment_method_code, COUNT(*) FROM Customers GROUP BY payment_method_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_27755603_10 (high_points VARCHAR, team VARCHAR)
### Question ###
What was the high points when the team was Washington?
### Accurate SQL ###
|
SELECT high_points FROM table_27755603_10 WHERE team = "Washington"
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.