context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, a...
what are the four most frequent procedures among the patients 50s since 2 years ago?
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 procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age B...
mimic_iii
CREATE TABLE station ( Station_ID int, Name text, Annual_entry_exit real, Annual_interchanges real, Total_Passengers real, Location text, Main_Services text, Number_of_Platforms int ) CREATE TABLE train_station ( Train_ID int, Station_ID int ) CREATE TABLE train ( Train_ID ...
Plot the number of name by grouped by name as a bar graph, could you list Y in ascending order?
SELECT Name, COUNT(Name) FROM train GROUP BY Name ORDER BY COUNT(Name)
nvbench
CREATE TABLE table_15873547_1 ( mascot VARCHAR, colors VARCHAR )
What is the mascot with the colors green and navy?
SELECT mascot FROM table_15873547_1 WHERE colors = "Green and Navy"
sql_create_context
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, fligh...
what flights are available from DENVER to SAN FRANCISCO
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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRA...
atis
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE admissions...
when did patient 84346 depart hospital since 5 years ago for the first time?
SELECT admissions.dischtime FROM admissions WHERE admissions.subject_id = 84346 AND DATETIME(admissions.dischtime) >= DATETIME(CURRENT_TIME(), '-5 year') ORDER BY admissions.dischtime LIMIT 1
mimic_iii
CREATE TABLE table_70468 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text )
What was the tournament that resulted in a winning score of 4 (71-72-72-69=284)?
SELECT "Tournament" FROM table_70468 WHERE "Winning score" = '–4 (71-72-72-69=284)'
wikisql
CREATE TABLE table_204_193 ( id number, "year" number, "artist" text, "album" text, "chart position" text, "role" text )
what comes before donny hathaway
SELECT "artist" FROM table_204_193 WHERE id = (SELECT id FROM table_204_193 WHERE "artist" = 'donny hathaway') - 1
squall
CREATE TABLE table_35947 ( "Nation" text, "Skip" text, "Third" text, "Second" text, "Lead" text )
Who was the second when Ilian Kirilov was the lead?
SELECT "Second" FROM table_35947 WHERE "Lead" = 'ilian kirilov'
wikisql
CREATE TABLE table_10966926_2 ( height VARCHAR, weight VARCHAR )
What is the height of the person that weighs 320 pounds?
SELECT height FROM table_10966926_2 WHERE weight = 320
sql_create_context
CREATE TABLE table_54191 ( "Season" text, "Competition" text, "Round" text, "Opponent" text, "Result" text, "Venue" text )
Which opponent has a Season of 2011/12?
SELECT "Opponent" FROM table_54191 WHERE "Season" = '2011/12'
wikisql
CREATE TABLE table_75926 ( "Player" text, "Nationality" text, "Position" text, "Years in Orlando" text, "School/Club Team" text )
What School/Club did Dominique Wilkins play for?
SELECT "School/Club Team" FROM table_75926 WHERE "Player" = 'dominique wilkins'
wikisql
CREATE TABLE table_46163 ( "Name" text, "GP-GS" text, "Gain" real, "Loss" real, "Long" real, "Avg/G" real )
WHAT IS THE LOSS WITH AN AVERAGE OF 89.9?
SELECT SUM("Loss") FROM table_46163 WHERE "Avg/G" = '89.9'
wikisql
CREATE TABLE table_16729930_18 ( socket VARCHAR, frequency VARCHAR )
What is the socket for microprocessors with a frequency of 1.3 ghz?
SELECT socket FROM table_16729930_18 WHERE frequency = "1.3 GHz"
sql_create_context
CREATE TABLE table_78549 ( "District" real, "County(s) Represented" text, "Member Senator" text, "Party" text, "First Elected" real )
What district for ulysses currie?
SELECT "District" FROM table_78549 WHERE "Member Senator" = 'ulysses currie'
wikisql
CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE city ( city_code varchar, ...
what flights are available from BOSTON to DENVER today
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND date_day.day_number = 1 AND date_day.month_number = 8 AND dat...
atis
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, ...
零一年一月十九日至二一年三月三日,复合维生素B片在923科室有多少开药量
SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.MED_ORG_DEPT_CD = '923' AND t_kc22.STA_DATE BETWEEN '2001-01-19' AND '2021-03-03' AND t_kc22.SOC_SRT_DIRE_NM = '复合维生素B片'
css
CREATE TABLE table_19886463_1 ( round_winner VARCHAR, circuit VARCHAR )
Who is the round winner of the wanneroo park circuit?
SELECT round_winner FROM table_19886463_1 WHERE circuit = "Wanneroo Park"
sql_create_context
CREATE TABLE table_name_26 ( result VARCHAR, game VARCHAR )
What was the result of game 1?
SELECT result FROM table_name_26 WHERE game = "game 1"
sql_create_context
CREATE TABLE country ( id number, name text ) CREATE TABLE league ( id number, country_id number, name text ) CREATE TABLE sqlite_sequence ( name text, seq text ) CREATE TABLE player ( id number, player_api_id number, player_name text, player_fifa_api_id number, birthd...
List all of the player ids with a height of at least 180cm and an overall rating higher than 85.
SELECT player_api_id FROM player WHERE height >= 180 INTERSECT SELECT player_api_id FROM player_attributes WHERE overall_rating > 85
spider
CREATE TABLE table_37073 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Save" text )
Which opponent has a loss of trout (7-4)?
SELECT "Opponent" FROM table_37073 WHERE "Loss" = 'trout (7-4)'
wikisql
CREATE TABLE table_name_61 ( spins__since_1998__source VARCHAR, ccm_chart VARCHAR, peak_pos VARCHAR )
How many Spins sources have a CCM Chart of CHR with a peak position less than 1?
SELECT COUNT(spins__since_1998__source) AS :_mediabase FROM table_name_61 WHERE ccm_chart = "chr" AND peak_pos < 1
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...
编号84294070811的医疗就诊,费用明细项目该走的结算流程都好了没
SELECT (SELECT SUM(t_kc22.STA_FLG) FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '84294070811') = (SELECT COUNT(*) FROM t_kc22 WHERE t_kc21_t_kc22.MED_CLINIC_ID = '84294070811')
css
CREATE TABLE table_57649 ( "CERCLIS ID" text, "Name" text, "County" text, "Proposed" text, "Listed" text )
What name has a listed of 03/31/1989 in spartanburg county?
SELECT "Name" FROM table_57649 WHERE "Listed" = '03/31/1989' AND "County" = 'spartanburg'
wikisql
CREATE TABLE table_49165 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What's the to par of the United States with the score of 71-71=142?
SELECT "To par" FROM table_49165 WHERE "Country" = 'united states' AND "Score" = '71-71=142'
wikisql
CREATE TABLE table_20962 ( "Solution" text, "Other Name" text, "[Na + ](mmol/L)" real, "[Cl - ](mmol/L)" real, "[Glucose](mmol/L)" real, "[Glucose](mg/dl)" real )
Name the other name where na plus is 77
SELECT "Other Name" FROM table_20962 WHERE "[Na + ](mmol/L)" = '77'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text, person_info_CSD text, person_info_CSRQ time, person_info_GJDM text, person_info_GJMC text, person_info_JGDM text, person_info_JGMC text, person_info_MZDM text, person_info_MZMC text, person_info_XBDM ...
名为秦傲雪的患者有哪些检验报告单的报告日期在一四年九月六日以前?这些报告单所对应的住院就诊的流水号是什么
SELECT zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.person_info_XM = '秦傲雪' AND NOT zyjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2014-09-06')
css
CREATE TABLE table_4163 ( "Province" text, "Number of Dairy Farms" real, "Number of Dairy Cows" real, "Production (hectolitres)" real, "Dairy Cows per Farm" real, "Production (hectolitres) per Farm" real )
what is the least amount of cattle head
SELECT MIN("Number of Dairy Cows") FROM table_4163
wikisql
CREATE TABLE table_name_22 ( award VARCHAR, category VARCHAR )
Which award show had the category of best supporting actress?
SELECT award FROM table_name_22 WHERE category = "best supporting actress"
sql_create_context
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE Votes ( Id number, PostId number, ...
SELECT * WHERE `ClosedDate` is NOT NULL;.
SELECT * FROM Posts WHERE NOT 'ClosedDate' IS NULL
sede
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE comment_instructor ( instructor_id int, ...
Were I to declare a major in WOMENSTD , which classes would I need to take ?
SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%WOMENSTD%' AND program_course.category LIKE 'PreMajor' AND program_course.course_id = course.course_id
advising
CREATE TABLE table_39738 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real )
What is the lowest Top-25 for the open championship, with a Top-10 larger than 3?
SELECT MIN("Top-25") FROM table_39738 WHERE "Tournament" = 'the open championship' AND "Top-10" > '3'
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...
患者谢昊昊在二00五年一月二十七日到二0一四年八月十一日期间,最常去的是哪家医院
SELECT MED_SER_ORG_NO FROM t_kc21 WHERE PERSON_NM = '谢昊昊' AND IN_HOSP_DATE BETWEEN '2005-01-27' AND '2014-08-11' GROUP BY MED_SER_ORG_NO ORDER BY COUNT(*) DESC LIMIT 1
css
CREATE TABLE table_18506 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
What candidate was re-elected in the Louisiana 5 district?
SELECT "Candidates" FROM table_18506 WHERE "Result" = 'Re-elected' AND "District" = 'Louisiana 5'
wikisql
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 ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
how many patients whose diagnoses icd9 code is 27801?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.icd9_code = "27801"
mimicsql_data
CREATE TABLE table_44957 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
WHAT PLACE DOES TOM LEHMAN HAVE?
SELECT "Place" FROM table_44957 WHERE "Player" = 'tom lehman'
wikisql
CREATE TABLE table_30159 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production" text, "U.S. viewers (in millions)" text )
What are the original air dates for episodes directed by fred toye?
SELECT "Original air date" FROM table_30159 WHERE "Directed by" = 'Fred Toye'
wikisql
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, ...
哪些工号及姓名的医务人员在患者魏乐志就诊过程中为他检测指标977450的,时间是从一二年九月十七日到二一年五月十七日
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON 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 = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb....
css
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
provide the number of patients whose age is less than 45 and procedure long title is open biopsy of liver?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "45" AND procedures.long_title = "Open biopsy of liver"
mimicsql_data
CREATE TABLE table_34307 ( "Round" real, "Player" text, "Position" text, "Nationality" text, "College/Junior/Club Team" text )
Can you tell me the College/Junior/Club Team that has the Position of defence, and the Nationality of czechoslovakia?
SELECT "College/Junior/Club Team" FROM table_34307 WHERE "Position" = 'defence' AND "Nationality" = 'czechoslovakia'
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 transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, war...
what was the last time patient 78086 was prescribed medication?
SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 78086) ORDER BY prescriptions.startdate DESC LIMIT 1
mimic_iii
CREATE TABLE table_name_48 ( identity VARCHAR, builder VARCHAR )
What is the identity of the brighton works built train?
SELECT identity FROM table_name_48 WHERE builder = "brighton works"
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
show me the number of patients who are taking tramadol medication and were admitted in hospital before 2163.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2163" AND prescriptions.drug = "traMADOL"
mimicsql_data
CREATE TABLE table_202_122 ( id number, "rank" number, "title" text, "studio" text, "actor/actress" text, "director" text, "gross" text )
how many films star eddie murphy ?
SELECT COUNT("title") FROM table_202_122 WHERE "actor/actress" = 'eddie murphy'
squall
CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
把患者37690817在6843197住院结束出院的时候科室名字里带有换药的住院记录列一下
SELECT * FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '37690817' AND hz_info.YLJGDM = '6843197' AND zyjzjlb.CYKSMC LIKE '%换药%'
css
CREATE TABLE table_26805 ( "School" text, "Mascot" text, "Location" text, "Founded" real, "Entered ISL" real, "Grades" text, "Number of Students" text, "Varsity Teams" real )
how many places have 17 varsity teams?
SELECT COUNT("Location") FROM table_26805 WHERE "Varsity Teams" = '17'
wikisql
CREATE TABLE table_name_89 ( source VARCHAR, name VARCHAR )
What was the source for the person named Cresswell?
SELECT source FROM table_name_89 WHERE name = "cresswell"
sql_create_context
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, ...
has any 30 ml cup : alum & mag hydroxide-simeth 200-200-20 mg/5ml po susp been prescribed to patient 004-66442 until 03/2102?
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-66442')) AND medication.drugname = '30 ml cup : alum & mag hydroxide-s...
eicu
CREATE TABLE table_test_11 ( "id" int, "left_ventricular_ejection_fraction_lvef" int, "systolic_blood_pressure_sbp" int, "tachycardia" int, "bradycardia" int, "renal_disease" bool, "allergy_to_aspirin" bool, "temperature" float, "creatinine_clearance_cl" float, "diastolic_blood_p...
bradycardia _ pulse < 55 ppm
SELECT * FROM table_test_11 WHERE bradycardia < 55
criteria2sql
CREATE TABLE table_69377 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text )
What was the opponent on August 29?
SELECT "Opponent" FROM table_69377 WHERE "Date" = 'august 29'
wikisql
CREATE TABLE table_38319 ( "Round" real, "Circuit" text, "State/Territory" text, "Date" text, "Winning driver" text )
What is the state the winning driver Jamie Whincup from in round 2?
SELECT "State/Territory" FROM table_38319 WHERE "Winning driver" = 'jamie whincup' AND "Round" = '2'
wikisql
CREATE TABLE schedule ( Cinema_ID int, Film_ID int, Date text, Show_times_per_day int, Price float ) CREATE TABLE cinema ( Cinema_ID int, Name text, Openning_year int, Capacity int, Location text ) CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_seaso...
Give me a bar chart showing the number of films for each director, rank in ascending by the Y-axis.
SELECT Directed_by, COUNT(Directed_by) FROM film GROUP BY Directed_by ORDER BY COUNT(Directed_by)
nvbench
CREATE TABLE addresses ( address_id number, line_1_number_building text, city text, zip_postcode text, state_province_county text, country text ) CREATE TABLE lessons ( lesson_id number, customer_id number, lesson_status_code text, staff_id number, vehicle_id number, les...
How many lessons have been cancelled?
SELECT COUNT(*) FROM lessons WHERE lesson_status_code = "Cancelled"
spider
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 ) CREATE TABLE university ( Scho...
A bar chart shows the distribution of ACC_Road and Team_ID , and group by attribute ACC_Home, and list from high to low by the Team_ID.
SELECT ACC_Road, Team_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY Team_ID DESC
nvbench
CREATE TABLE table_9757 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text )
What year or years did arnold palmer win?
SELECT "Year(s) won" FROM table_9757 WHERE "Player" = 'arnold palmer'
wikisql
CREATE TABLE table_51001 ( "Round" real, "Pick" real, "Player" text, "Position" text, "School/Club Team" text )
In what round was a player from Michigan selected?
SELECT MAX("Round") FROM table_51001 WHERE "School/Club Team" = 'michigan'
wikisql
CREATE TABLE table_27941 ( "meas. num." real, "passed" text, "YES votes" real, "NO votes" real, "% YES" text, "Const. Amd.?" text, "type" text, "description" text )
What is the description of the measure that got 78.27% yes votes?
SELECT "description" FROM table_27941 WHERE "% YES" = '78.27%'
wikisql
CREATE TABLE table_67537 ( "Country" text, "2012" real, "2011" real, "2010" real, "2009" real, "2008" real, "2007" real, "2006" real, "2005" real, "2004" real, "2003" real, "2002" real, "2001" real, "2000" real, "1999" real, "1998" real, "1997" real, ...
what is the listing for 2012 when 2004 is more than 0, 2008 is more than 1 1994 is 8 and 2005 is less than 11?
SELECT MIN("2012") FROM table_67537 WHERE "2004" > '0' AND "2008" > '1' AND "1994" = '8' AND "2005" < '11'
wikisql
CREATE TABLE table_78398 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
What was the method when the time was 1:01?
SELECT "Method" FROM table_78398 WHERE "Time" = '1:01'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
count the number of patients whose death status is 0 and procedure long title is endoscopic removal of stone(s) from biliary tract?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.long_title = "Endoscopic removal of stone(s) from biliary tract"
mimicsql_data
CREATE TABLE table_42482 ( "Volume:Issue" text, "Issue Date(s)" text, "Weeks on Top" real, "Song" text, "Artist" text )
What is the Song with an Issue Date(s) that is 19 june?
SELECT "Song" FROM table_42482 WHERE "Issue Date(s)" = '19 june'
wikisql
CREATE TABLE table_29152820_1 ( no_in_season VARCHAR, no_in_series VARCHAR )
How many episodes are 122 in the series?
SELECT COUNT(no_in_season) FROM table_29152820_1 WHERE no_in_series = 122
sql_create_context
CREATE TABLE table_name_24 ( result VARCHAR, date VARCHAR )
What is the Result from the Date that is December 8, 1963?
SELECT result FROM table_name_24 WHERE date = "december 8, 1963"
sql_create_context
CREATE TABLE table_12070 ( "Year" real, "Movie title" text, "Role" text, "Direction" text, "Screenplay" text )
Which role did joemon play before 1991?
SELECT "Role" FROM table_12070 WHERE "Year" < '1991' AND "Direction" = 'joemon'
wikisql
CREATE TABLE table_name_6 ( laps INTEGER, driver VARCHAR, grid VARCHAR )
How many laps did Jo Bonnier driver when the grid number was smaller than 11?
SELECT SUM(laps) FROM table_name_6 WHERE driver = "jo bonnier" AND grid < 11
sql_create_context
CREATE TABLE table_name_91 ( points VARCHAR, chassis VARCHAR, year VARCHAR )
What is the Point of Chassis of Lancia d50 in 1954
SELECT points FROM table_name_91 WHERE chassis = "lancia d50" AND year = 1954
sql_create_context
CREATE TABLE Lessons ( lesson_id INTEGER, customer_id INTEGER, lesson_status_code VARCHAR(15), staff_id INTEGER, vehicle_id INTEGER, lesson_date DATETIME, lesson_time VARCHAR(10), price DOUBLE ) CREATE TABLE Addresses ( address_id INTEGER, line_1_number_building VARCHAR(80), ...
For each customer status code, how many customers are classified that way Visualize by bar chart, and display in ascending by the bar.
SELECT customer_status_code, COUNT(*) FROM Customers GROUP BY customer_status_code ORDER BY customer_status_code
nvbench
CREATE TABLE table_62305 ( "Team 1" text, "Agg." text, "Team 2" text, "1st leg" text, "2nd leg" text )
Which Team 1, has Team 2, Slovan Liberec?
SELECT "Team 1" FROM table_62305 WHERE "Team 2" = 'slovan liberec'
wikisql
CREATE TABLE table_62464 ( "Parish (Prestegjeld)" text, "Sub-Parish (Sokn)" text, "Church Name" text, "Year Built" text, "Location of the Church" text )
What is the name of the church that is located in flor ?
SELECT "Church Name" FROM table_62464 WHERE "Location of the Church" = 'florø'
wikisql
CREATE TABLE table_name_99 ( money___ INTEGER, country VARCHAR )
What is the highest amount of money a play from Scotland United States has?
SELECT MAX(money___) AS $__ FROM table_name_99 WHERE country = "scotland united states"
sql_create_context
CREATE TABLE table_50102 ( "Order" real, "Name dates" text, "Princess Royal from (date) to (date)" text, "Parent" text, "Date married" text, "Husband dates" text )
Who was the husband date that was married in 1858?
SELECT "Husband dates" FROM table_50102 WHERE "Date married" = '1858'
wikisql
CREATE TABLE table_76066 ( "Team #1" text, "Points" text, "Team #2" text, "1st leg" text, "2nd leg" text )
What is the team #2 with Deport as team #1?
SELECT "Team #2" FROM table_76066 WHERE "Team #1" = 'deport'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
calculate the number of patients treated with benz100 and aged below 67.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "67" AND prescriptions.formulary_drug_cd = "BENZ100"
mimicsql_data
CREATE TABLE Ref_Incident_Type ( incident_type_code VARCHAR(10), incident_type_description VARCHAR(80) ) CREATE TABLE Behavior_Incident ( incident_id INTEGER, incident_type_code VARCHAR(10), student_id INTEGER, date_incident_start DATETIME, date_incident_end DATETIME, incident_summary V...
Find the dates of assessment notes for students with first name 'Fanny', and count them by a bar chart, and order from low to high by the how many date of notes.
SELECT date_of_notes, COUNT(date_of_notes) FROM Assessment_Notes AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id WHERE T2.first_name = "Fanny" ORDER BY COUNT(date_of_notes)
nvbench
CREATE TABLE table_204_511 ( id number, "number" number, "driver" text, "entrant" text, "chassis" text, "engine" text, "tyre" text )
troy ruttman was entered by the same person as which other driver ?
SELECT "driver" FROM table_204_511 WHERE "driver" <> 'troy ruttman' AND "entrant" = (SELECT "entrant" FROM table_204_511 WHERE "driver" = 'troy ruttman')
squall
CREATE TABLE table_9216 ( "Tournament" text, "Surface" text, "Week" text, "Winner and score" text, "Finalist" text, "Semifinalists" text )
what is the surface when the winner and score is gustavo kuerten 6-4, 7-5, 7-6(6)?
SELECT "Surface" FROM table_9216 WHERE "Winner and score" = 'gustavo kuerten 6-4, 7-5, 7-6(6)'
wikisql
CREATE TABLE table_203_417 ( id number, "rnd." number, "pick #" number, "nfl team" text, "player" text, "pos." text, "college" text, "conf." text, "notes" text )
who is the first detroit lions pick not from the pac-10 ?
SELECT "player" FROM table_203_417 WHERE "nfl team" = 'detroit lions' AND "conf." <> 'pac-10' ORDER BY "pick #" LIMIT 1
squall
CREATE TABLE table_74957 ( "Ranking" real, "Nationality" text, "Name" text, "Years" text, "ICFC" real, "FCWC" real, "Total" real )
What is the highest number of FCWC in the Years of 1958 1965, and an ICFC smaller than 11?
SELECT MAX("FCWC") FROM table_74957 WHERE "Years" = '1958–1965' AND "ICFC" < '11'
wikisql
CREATE TABLE climber ( climber_id number, name text, country text, time text, points number, mountain_id number ) CREATE TABLE mountain ( mountain_id number, name text, height number, prominence number, range text, country text )
What is the name of the highest mountain?
SELECT name FROM mountain ORDER BY height DESC LIMIT 1
spider
CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT ) CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases INTEGER, Drink TEXT ) CREATE TABLE appellations ( No...
A bar chart about how many wines are there for each grape?
SELECT Grape, COUNT(*) FROM wine GROUP BY Grape
nvbench
CREATE TABLE table_75665 ( "Wrestler" text, "Reign" text, "Days held" text, "Location" text, "Event" text )
Where did the wrestler, super parka, with the title with a reign of 2?
SELECT "Location" FROM table_75665 WHERE "Wrestler" = 'super parka' AND "Reign" = '2'
wikisql
CREATE TABLE table_58876 ( "Round" real, "Pick" real, "Player" text, "Nationality" text, "School/Club Team" text )
When was Mario Elie picked in a round before 7?
SELECT MAX("Pick") FROM table_58876 WHERE "Player" = 'mario elie' AND "Round" < '7'
wikisql
CREATE TABLE table_204_590 ( id number, "year" number, "division" number, "league" text, "regular season" text, "playoffs" text, "open cup" text, "avg. attendance" number )
what was the number of times usl a league did not qualify for the playoffs ?
SELECT COUNT(*) FROM table_204_590 WHERE "league" = 'usl a-league' AND "playoffs" = 'did not qualify'
squall
CREATE TABLE table_14911 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text )
When did sony music direct a label?
SELECT "Date" FROM table_14911 WHERE "Label" = 'sony music direct'
wikisql
CREATE TABLE table_name_71 ( method VARCHAR, opponent VARCHAR )
I want to know the method for opponent of jerry bohlander
SELECT method FROM table_name_71 WHERE opponent = "jerry bohlander"
sql_create_context
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
Most viewed posts of me.
SELECT Id AS "post_link", ViewCount, Score, Tags FROM Posts WHERE Posts.OwnerUserId = @UserId AND ViewCount > 0 ORDER BY ViewCount DESC, Score DESC LIMIT 20
sede
CREATE TABLE table_1769428_2 ( car__number VARCHAR, winning_driver VARCHAR )
How many car numbers were listed for Rusty Wallace?
SELECT COUNT(car__number) FROM table_1769428_2 WHERE winning_driver = "Rusty Wallace"
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, ic...
give me the top four most common output events in this year.
SELECT t1.celllabel FROM (SELECT intakeoutput.celllabel, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM intakeoutput WHERE intakeoutput.cellpath LIKE '%output%' AND DATETIME(intakeoutput.intakeoutputtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY intakeoutput.celllabel) AS ...
eicu
CREATE TABLE table_36921 ( "Nation" text, "Skip" text, "Third" text, "Second" text, "Lead" text )
What is Spain's skip?
SELECT "Skip" FROM table_36921 WHERE "Nation" = 'spain'
wikisql
CREATE TABLE table_name_78 ( attendance VARCHAR, date VARCHAR )
What was the attendance on October 6?
SELECT attendance FROM table_name_78 WHERE date = "october 6"
sql_create_context
CREATE TABLE table_204_664 ( id number, "rank" number, "bib" number, "name" text, "nationality" text, "start" text, "penalties (p+p+s+s)" text, "time" text, "deficit" text )
how many took at least 35:00 to finish ?
SELECT COUNT(*) FROM table_204_664 WHERE "time" >= 35
squall
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...
在00年5月21日到00年10月13日这段时间,患者46674930就医时一共开出的哪些药品,把这些药品的编码、名称、数量、单价、金额列出来
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.QTY, t_kc22.UNIVALENT, t_kc22.AMOUNT FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '46674930' AND t_kc22.t_kc21_IN_HOSP_DATE BETWEEN '2000-05-21' AND '2000-10-13'
css
CREATE TABLE table_34397 ( "Date" text, "Tournament" text, "Location" text, "Winner" text, "Score" text, "1st prize ( $ )" text )
What is the name of the Winner in north carolina at the greater greensboro open?
SELECT "Winner" FROM table_34397 WHERE "Location" = 'north carolina' AND "Tournament" = 'greater greensboro open'
wikisql
CREATE TABLE table_1341884_45 ( first_elected VARCHAR, district VARCHAR )
how many voted in the texas 6 section
SELECT first_elected FROM table_1341884_45 WHERE district = "Texas 6"
sql_create_context
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 lab ( subject_id text, hadm_id text, ...
What is maximum age of hispanic, latino, or puerto rican patients whose duration of hospital stay was 14 days?
SELECT MAX(demographic.age) FROM demographic WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND demographic.days_stay = "14"
mimicsql_data
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswer...
SOpt - Number of active posts last month per mod.
SELECT COUNT(*) AS PostsLastMonth, 6 AS Moderators, (COUNT(*) / 6) AS PostsLastMonthPerMod FROM Posts WHERE LastActivityDate >= DATEADD(month, -1, (SELECT MAX(LastActivityDate) FROM Posts))
sede
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE...
which flight between PITTSBURGH and BALTIMORE on 7 19 has the smallest seating capacity
SELECT DISTINCT FLIGHT_0.flight_id FROM aircraft, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, airport_service AS AIRPORT_SERVICE_3, city AS CITY_0, city AS CITY_1, city AS CITY_2, city AS CITY_3, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days A...
atis
CREATE TABLE table_13650 ( "Round" real, "Dates" text, "Rally Name" text, "Rally HQ" text, "Support Category" text, "Surface" text )
Which Rally Name has a Surface of asphalt and gravel?
SELECT "Rally Name" FROM table_13650 WHERE "Surface" = 'asphalt and gravel'
wikisql
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, ...
what is the maximum daily number of people diagnosed with streptococcal septicemia the last year?
SELECT MAX(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'streptococcal septicemia') AND DATETIME(diagnoses_icd.charttime, 'start of year') = DATETIME(CURRENT_T...
mimic_iii
CREATE TABLE table_name_47 ( location_attendance VARCHAR, date VARCHAR )
What was the location attendance on January 19?
SELECT location_attendance FROM table_name_47 WHERE date = "january 19"
sql_create_context
CREATE TABLE musical ( Musical_ID int, Name text, Year int, Award text, Category text, Nominee text, Result text ) CREATE TABLE actor ( Actor_ID int, Name text, Musical_ID int, Character text, Duration text, age int )
Give me a histogram for how many musicals has each nominee been nominated for?
SELECT Nominee, COUNT(*) FROM musical GROUP BY Nominee
nvbench