instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_31108 ( "Rank 2011" real, "Country" text, "Production in 2011 (1,000 ton)" real, "Share 2011" text, "Rank 2010" real, "Production in 2010 (1,000 ton)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When sweden is the country w...
SELECT MAX("Production in 2010 (1,000 ton)") FROM table_31108 WHERE "Country" = 'Sweden'
wikisql
CREATE TABLE table_name_63 ( year_of_recording INTEGER, orchestra VARCHAR, record_company VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the oldest year that the Royal Philharmonic Orchestra released a record with Decca Records?
SELECT MIN(year_of_recording) FROM table_name_63 WHERE orchestra = "royal philharmonic orchestra" AND record_company = "decca records"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2056" AND lab.fluid = "Other Body Fluid"
mimicsql_data
CREATE TABLE table_25348 ( "County" text, "Population" real, "Unemployment Rate" text, "Market Income Per Capita" text, "Poverty Rate" text, "Status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many counties have a population of 2266?
SELECT COUNT("County") FROM table_25348 WHERE "Population" = '2266'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE patient ( uniquepid text, ...
SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-34260' AND patient.hospitaldischargetime IS NULL))
eicu
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, ...
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 40116) AND prescriptions.route = 'iv bolus' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME('%m'...
mimic_iii
CREATE TABLE table_11166 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What venue had an away team of south melbourne?
SELECT "Venue" FROM table_11166 WHERE "Away team" = 'south melbourne'
wikisql
CREATE TABLE table_7804 ( "Year" real, "Tournament" text, "Venue" text, "Result" text, "Event" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the most recent year the venue was Barcelona, Spain?
SELECT MAX("Year") FROM table_7804 WHERE "Venue" = 'barcelona, spain'
wikisql
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '9621160' AND IN_HOSP_DATE BETWEEN '2000-08-22' AND '2002-10-30' AND CLINIC_TYPE = '购药'
css
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE T...
SELECT JOB_ID, COUNT(JOB_ID) FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID WHERE T2.DEPARTMENT_NAME = 'Finance' GROUP BY JOB_ID ORDER BY JOB_ID DESC
nvbench
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
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
nvbench
CREATE TABLE table_45152 ( "Year" text, "Start" text, "Qual" text, "Rank" text, "Finish" text, "Laps" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was 1961's qual?
SELECT "Qual" FROM table_45152 WHERE "Year" = '1961'
wikisql
CREATE TABLE table_19975 ( "No." real, "English name" text, "Bulgarian name" text, "Bulgarian name ( Transliteration )" text, "Old Bulgarian Names" text, "Old Bulgarian name (Transliteration)" text, "Old Bulgarian name - Meaning" text ) -- Using valid SQLite, answer the following questions...
SELECT "English name" FROM table_19975 WHERE "Old Bulgarian name (Transliteration)" = 'Orach, Zarev'
wikisql
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, value...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 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 ...
mimic_iii
CREATE TABLE table_name_84 ( year INTEGER, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average year of the games with the date December 26?
SELECT AVG(year) FROM table_name_84 WHERE date = "december 26"
sql_create_context
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
SELECT Founder, SUM(Revenue) FROM Manufacturers GROUP BY Founder ORDER BY SUM(Revenue)
nvbench
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE icustays ( row_id number, ...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE STRFTIME('%y', procedures_icd.charttime) = '2102' GROUP BY procedures_icd.icd9_code) AS t1 ...
mimic_iii
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.OUT_DIAG_DIS_CD, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '9593496' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.OUT_DIAG_DIS_CD
css
CREATE TABLE table_name_74 ( game VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Game has a Score of 122 125?
SELECT game FROM table_name_74 WHERE score = "122–125"
sql_create_context
CREATE TABLE table_6044 ( "Month" text, "Week" real, "Offensive" text, "Defensive" text, "Goalkeeper" text, "Rookie" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the rookie goalkeeper Rob Scherr who played before week 6?
SELECT "Rookie" FROM table_6044 WHERE "Goalkeeper" = 'rob scherr' AND "Week" < '6'
wikisql
CREATE TABLE table_72488 ( "Position" real, "Artist" text, "Song title" text, "Highest position" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the nme of the song performed by billy vaughn?
SELECT "Song title" FROM table_72488 WHERE "Artist" = 'Billy Vaughn'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, ...
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGD...
css
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.ethnicity = "ASIAN"
mimicsql_data
CREATE TABLE table_16799784_2 ( name VARCHAR, latitude VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the name of 36.0n
SELECT name FROM table_16799784_2 WHERE latitude = "36.0N"
sql_create_context
CREATE TABLE hall_of_fame ( player_id text, yearid number, votedby text, ballots text, needed text, votes text, inducted text, category text, needed_note text ) CREATE TABLE player_award ( player_id text, award_id text, year number, league_id text, tie text, ...
SELECT league_id FROM salary GROUP BY league_id ORDER BY SUM(salary) DESC LIMIT 1
thehistoryofbaseball
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "31" AND prescriptions.drug = "Sodium Fluoride (Dental Gel)"
mimicsql_data
CREATE TABLE table_name_38 ( overall VARCHAR, pick VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- With the pick of 1 Cecil Martin has what number as the overall?
SELECT COUNT(overall) FROM table_name_38 WHERE pick = 1 AND name = "cecil martin"
sql_create_context
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 ) CREATE ...
SELECT MAX(chartevents.valuenum) 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 = 6215)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit...
mimic_iii
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 t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "OVERDOSE" AND demographic.admityear < "2184"
mimicsql_data
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '韦宜然' AND t_kc22.STA_DATE BETWEEN '2011-09-02' AND '2012-12-04' AND gwyjzb.MED_SER_ORG_NO = '2066190' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_...
css
CREATE TABLE table_4316 ( "Player" text, "Nationality" text, "Position" text, "Years in Toronto" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Player is from Argentina and whose position is a guard-forward?
SELECT "Player" FROM table_4316 WHERE "Position" = 'guard-forward' AND "Nationality" = 'argentina'
wikisql
CREATE TABLE table_name_96 ( competition VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Competition, when Date is 30 December 2005?
SELECT competition FROM table_name_96 WHERE date = "30 december 2005"
sql_create_context
CREATE TABLE table_47686 ( "Year [A ]" real, "Pick" text, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the most recent year georgia tech chose a linebacker?
SELECT MAX("Year [A ]") FROM table_47686 WHERE "Position" = 'linebacker' AND "College" = 'georgia tech'
wikisql
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
SELECT Headquarter, COUNT(DISTINCT T1.Name) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code ORDER BY COUNT(DISTINCT T1.Name)
nvbench
CREATE TABLE table_6762 ( "Date" text, "Pos." text, "Player" text, "From club" text, "Transfer fee" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Player had a From club of atl tico madrid?
SELECT "Player" FROM table_6762 WHERE "From club" = 'atlético madrid'
wikisql
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
(SELECT * FROM t_kc21 WHERE MED_SER_ORG_NO = '3266292' AND IN_HOSP_DATE BETWEEN '2007-09-14' AND '2018-06-15') EXCEPT (SELECT * FROM t_kc21 WHERE MED_SER_ORG_NO = '3266292' AND IN_HOSP_DATE BETWEEN '2007-09-14' AND '2018-06-15' AND MED_ORG_DEPT_NM = '儿童口腔科')
css
CREATE TABLE table_45683 ( "Wicket" text, "Runs" text, "Batting partners" text, "Batting team" text, "Fielding team" text, "Venue" text, "Season" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who were the batting partners in Colombo?
SELECT "Batting partners" FROM table_45683 WHERE "Venue" = 'colombo'
wikisql
CREATE TABLE table_35324 ( "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the Opponent on a Hard (i) Surface?
SELECT "Opponent" FROM table_35324 WHERE "Surface" = 'hard (i)'
wikisql
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT t_kc24.MED_CLINIC_ID, t_kc24.t_kc21_PERSON_ID, t_kc24.t_kc21_PERSON_NM, t_kc24.t_kc21_IDENTITY_CARD, t_kc24.t_kc21_PERSON_SEX, t_kc24.t_kc21_PERSON_AGE FROM t_kc24 WHERE t_kc24.MED_AMOUT = (SELECT t_kc24.MED_AMOUT FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID = '70444989325')
css
CREATE TABLE table_68955 ( "Sport" text, "Competition name" text, "Competing entities" text, "Age groups" text, "Held every" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the age group for figure skating?
SELECT "Age groups" FROM table_68955 WHERE "Sport" = 'figure skating'
wikisql
CREATE TABLE table_60674 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- With a To par of 1, what is Player Henrik Stenson's Score?
SELECT "Score" FROM table_60674 WHERE "To par" = '–1' AND "Player" = 'henrik stenson'
wikisql
CREATE TABLE table_22730 ( "State and District of Columbia" text, "Obese adults" text, "Overweight (incl. obese) adults" text, "Obese children and adolescents" text, "Obesity rank" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is every state a...
SELECT "State and District of Columbia" FROM table_22730 WHERE "Overweight (incl. obese) adults" = '60.0%'
wikisql
CREATE TABLE table_40276 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who were the runner(s)-up when the winning score was 10 (69-68-74-67=278)?
SELECT "Margin of victory" FROM table_40276 WHERE "Winning score" = '–10 (69-68-74-67=278)'
wikisql
CREATE TABLE table_225102_4 ( vacator VARCHAR, reason_for_change VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the vacator for died august 13, 1826
SELECT vacator FROM table_225102_4 WHERE reason_for_change = "Died August 13, 1826"
sql_create_context
CREATE TABLE table_name_17 ( drawn INTEGER, points VARCHAR, against VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Drawn has a Points of 6, and a Against larger than 16?
SELECT SUM(drawn) FROM table_name_17 WHERE points = 6 AND against > 16
sql_create_context
CREATE TABLE table_name_60 ( non_suited_match VARCHAR, number_of_decks INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the Non-Suited Match that has greater than 6 Number of Decks.
SELECT non_suited_match FROM table_name_60 WHERE number_of_decks > 6
sql_create_context
CREATE TABLE table_name_38 ( points INTEGER, drawn VARCHAR, played VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the fewest number of points for clubs with less than 2 draws and more than 8 matches played?
SELECT MIN(points) FROM table_name_38 WHERE drawn < 2 AND played > 8
sql_create_context
CREATE TABLE table_203_238 ( id number, "year" number, "competition" text, "venue" text, "position" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- number of competitions
SELECT COUNT("competition") FROM table_203_238
squall
CREATE TABLE table_name_57 ( player VARCHAR, place VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the T4 Place Player with a Score of 71-74-66=211?
SELECT player FROM table_name_57 WHERE place = "t4" AND score = 71 - 74 - 66 = 211
sql_create_context
CREATE TABLE table_26762 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "U.S. viewers (million)" text, "Original air date" text, "Production code" text ) -- Using valid SQLite, answer the following questions for the tables provided ab...
SELECT "Production code" FROM table_26762 WHERE "Directed by" = 'Robert Duncan McNeill'
wikisql
CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varch...
SELECT DISTINCT course.department, course.name, course.number FROM area, course WHERE area.area LIKE '%computing infrastructure%' AND course.course_id = area.course_id
advising
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE icustays ( row_id number, s...
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27362) AND prescriptions.route = 'oral' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m', pr...
mimic_iii
CREATE TABLE book_club ( book_club_id int, Year int, Author_or_Editor text, Book_Title text, Publisher text, Category text, Result text ) CREATE TABLE culture_company ( Company_name text, Type text, Incorporated_in text, Group_Equity_Shareholding real, book_club_id text,...
SELECT Category, COUNT(*) FROM book_club GROUP BY Category
nvbench
CREATE TABLE table_1973321_5 ( points INTEGER, status VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the most points for champion, won in the final against am lie mauresmo
SELECT MAX(points) FROM table_1973321_5 WHERE status = "Champion, won in the final against Amélie Mauresmo"
sql_create_context
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '6247162' AND t_kc21.IN_HOSP_DATE BETWEEN '2008-03-18' AND '2019-06-20' AND t_kc21.IN_DIAG_DIS_CD <> t_kc21.OUT_DIAG_DIS_CD
css
CREATE TABLE table_42124 ( "City" text, "State" text, "AAM Accredited" text, "AAM Member" text, "ASTC Member" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is City, when State is California, when AAM Accredited is No, when ASTC Member is Yes, ...
SELECT "City" FROM table_42124 WHERE "State" = 'california' AND "AAM Accredited" = 'no' AND "ASTC Member" = 'yes' AND "AAM Member" = 'no'
wikisql
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE hz_info ( KH text, KLX number...
SELECT jybgb.BGDH FROM jybgb WHERE jybgb.JZLSH = '99506528136' AND NOT jybgb.KSMC LIKE '%管镜%'
css
CREATE TABLE table_1398 ( "Headphone Model" text, "Headphone Class" text, "Sensitivity (dB)" text, "Impedance (Ohms)" real, "Driver-matched dB" text, "Construction" text, "Earpads" text, "Termination" text, "Succeeded by" text ) -- Using valid SQLite, answer the following questions...
SELECT "Succeeded by" FROM table_1398 WHERE "Earpads" = 'Foam'
wikisql
CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departure_flight_number int, stop_time int ) CREATE TABLE month ( ...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SAN JOSE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ST. P...
atis
CREATE TABLE table_name_49 ( from_club VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which From club has a Date of 20 oct. 2008?
SELECT from_club FROM table_name_49 WHERE date = "20 oct. 2008"
sql_create_context
CREATE TABLE member_attendance ( Member_ID int, Performance_ID int, Num_of_Pieces int ) CREATE TABLE member ( Member_ID text, Name text, Nationality text, Role text ) CREATE TABLE performance ( Performance_ID real, Date text, Host text, Location text, Attendance int ) ...
SELECT Location, COUNT(Location) FROM performance GROUP BY Location
nvbench
CREATE TABLE table_14523485_9 ( country VARCHAR, channel VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country is the show aired on TVNZ?
SELECT country FROM table_14523485_9 WHERE channel = "TVNZ"
sql_create_context
CREATE TABLE product ( product_id int, product text, dimensions text, dpi real, pages_per_minute_color real, max_page_size text, interface text ) CREATE TABLE district ( District_ID int, District_name text, Headquartered_City text, City_Population real, City_Area real ) ...
SELECT District_name, City_Population FROM district WHERE City_Population BETWEEN 200000 AND 2000000 ORDER BY District_name
nvbench
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE jybgb_jyjgzbb ( JYZBLSH number, ...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = j...
css
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT * FROM jybgb WHERE jybgb.JZLSH = '67597975665'
css
CREATE TABLE table_12259 ( "Built" real, "Ship" text, "Operator" text, "Tonnage" text, "Flag" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What ship was built in 2012?
SELECT "Ship" FROM table_12259 WHERE "Built" = '2012'
wikisql
CREATE TABLE table_25030512_26 ( district VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what district was keith ellison the incumbent?
SELECT district FROM table_25030512_26 WHERE incumbent = "Keith Ellison"
sql_create_context
CREATE TABLE table_name_76 ( grid INTEGER, driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the grid total for david coulthard?
SELECT SUM(grid) FROM table_name_76 WHERE driver = "david coulthard"
sql_create_context
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT COUNT(*) FROM txmzjzjlb WHERE txmzjzjlb.JZKSBM = '553' AND txmzjzjlb.JZKSRQ BETWEEN '2003-05-10' AND '2016-07-14' UNION SELECT COUNT(*) FROM ftxmzjzjlb WHERE ftxmzjzjlb.JZKSBM = '553' AND ftxmzjzjlb.JZKSRQ BETWEEN '2003-05-10' AND '2016-07-14'
css
CREATE TABLE table_28498999_6 ( country VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the place where the person is luke donald
SELECT country FROM table_28498999_6 WHERE player = "Luke Donald"
sql_create_context
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 ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "MARRIED" AND procedures.short_title = "Radiotherapeut proc NEC"
mimicsql_data
CREATE TABLE table_28677723_14 ( style VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the style for 27
SELECT style FROM table_28677723_14 WHERE total = 27
sql_create_context
CREATE TABLE branch ( Branch_ID int, Name text, Open_year text, Address_road text, City text, membership_amount text ) CREATE TABLE purchase ( Member_ID int, Branch_ID text, Year text, Total_pounds real ) CREATE TABLE membership_register_branch ( Member_ID int, Branch_I...
SELECT Hometown, COUNT(Hometown) FROM member GROUP BY Hometown ORDER BY Hometown
nvbench
CREATE TABLE table_65970 ( "Country" text, "1951" real, "1952" real, "1953" real, "1954" real, "1955" real, "1956" real, "1957" real, "1958" real, "1959" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 1952 rate when t...
SELECT SUM("1952") FROM table_65970 WHERE "1954" > '4.2'
wikisql
CREATE TABLE exhibition_record ( Exhibition_ID int, Date text, Attendance int ) CREATE TABLE artist ( Artist_ID int, Name text, Country text, Year_Join int, Age int ) CREATE TABLE exhibition ( Exhibition_ID int, Year int, Theme text, Artist_ID int, Ticket_Price real...
SELECT Year, COUNT(Year) FROM exhibition WHERE Ticket_Price < 15 GROUP BY Year
nvbench
CREATE TABLE table_11971 ( "CERCLIS ID" text, "Name" text, "County" text, "Partially deleted" text, "Deleted" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which site has the CERCLIS ID fld004092532?
SELECT "Name" FROM table_11971 WHERE "CERCLIS ID" = 'fld004092532'
wikisql
CREATE TABLE table_75870 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of medals when there are 18 gold medals?
SELECT SUM("Total") FROM table_75870 WHERE "Gold" = '18'
wikisql
CREATE TABLE table_33015 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the attendance on 1997-12-14?
SELECT "Attendance" FROM table_33015 WHERE "Date" = '1997-12-14'
wikisql
CREATE TABLE genres ( id VARCHAR, name VARCHAR ) CREATE TABLE tracks ( name VARCHAR, genre_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of tracks whose genre is Rock?
SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.name = "Rock"
sql_create_context
CREATE TABLE table_name_36 ( league_from VARCHAR, pick__number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the league that has the pick #160?
SELECT league_from FROM table_name_36 WHERE pick__number = 160
sql_create_context
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT * FROM hz_info JOIN zyjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM AND person_info_hz_i...
css
CREATE TABLE table_12886178_5 ( club VARCHAR, tries_for VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What club has a tries for count of 19?
SELECT club FROM table_12886178_5 WHERE tries_for = "19"
sql_create_context
CREATE TABLE table_name_61 ( date VARCHAR, winning_driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Date has a Winning driver of ugo sivocci?
SELECT date FROM table_name_61 WHERE winning_driver = "ugo sivocci"
sql_create_context
CREATE TABLE table_name_30 ( home VARCHAR, date VARCHAR, geust VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the home team of the match on 21.10.07, which had bsc young boys (asl) as the geust?
SELECT home FROM table_name_30 WHERE date = "21.10.07" AND geust = "bsc young boys (asl)"
sql_create_context
CREATE TABLE table_23589 ( "Title" text, "Author" text, "Reader" text, "Format" text, "Company" text, "Release Date" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who the reader of title department x?
SELECT "Reader" FROM table_23589 WHERE "Title" = 'Department X'
wikisql
CREATE TABLE table_name_15 ( time VARCHAR, show_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Time has a Show Name of mornings with neil mitchell?
SELECT time FROM table_name_15 WHERE show_name = "mornings with neil mitchell"
sql_create_context
CREATE TABLE table_name_75 ( status VARCHAR, authors VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is varricchio's status?
SELECT status FROM table_name_75 WHERE authors = "varricchio"
sql_create_context
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT t_kc24.t_kc21_IN_DIAG_DIS_CD, t_kc24.t_kc21_IN_DIAG_DIS_NM FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_NM = '凤锐达' AND t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 7564.57)
css
CREATE TABLE table_179174_2 ( years VARCHAR, flights VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What years had 134 orbital flights?
SELECT years FROM table_179174_2 WHERE flights = "134 Orbital"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( ...
SELECT AVG(demographic.age) FROM demographic WHERE demographic.insurance = "Government" AND demographic.days_stay = "4"
mimicsql_data
CREATE TABLE table_58556 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the bronze medal count of the team that finished with 47 total medals?
SELECT AVG("Bronze") FROM table_58556 WHERE "Total" = '47'
wikisql
CREATE TABLE table_name_33 ( player VARCHAR, position VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What player has a no pick position in 1976?
SELECT player FROM table_name_33 WHERE position = "no pick" AND year = 1976
sql_create_context
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, res...
SELECT DISTINCT ground_service.transport_type FROM airport, airport_service, city AS CITY_0, city AS CITY_1, ground_service WHERE airport.airport_code = airport_service.airport_code AND CITY_0.city_name = 'WASHINGTON' AND CITY_1.city_code = airport_service.city_code AND CITY_1.city_name = 'WASHINGTON' AND ground_servic...
atis
CREATE TABLE table_name_10 ( silver VARCHAR, bronze INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of silver when bronze is less than 0?
SELECT COUNT(silver) FROM table_name_10 WHERE bronze < 0
sql_create_context
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
SELECT T2.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Manufacturer DESC
nvbench
CREATE TABLE table_12976038_1 ( director VARCHAR, viewers__in_millions_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who directed the episode that had 6.04 million viewers?
SELECT director FROM table_12976038_1 WHERE viewers__in_millions_ = "6.04"
sql_create_context
CREATE TABLE table_11677100_17 ( school VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many schools did Bubba Starling attend?
SELECT COUNT(school) FROM table_11677100_17 WHERE player = "Bubba Starling"
sql_create_context
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 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 ...
mimic_iii
CREATE TABLE table_44577 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What event has a 0:49 time?
SELECT "Event" FROM table_44577 WHERE "Time" = '0:49'
wikisql
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 ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CR...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'bystolic' AND DATETIME(prescriptions.startdate) >= DATETIME(CURRE...
mimic_iii