context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_94 ( march INTEGER, opponent VARCHAR, game VARCHAR )
What is the latest date in March when the opponent was the Boston Bruins and the game number was smaller than 66?
SELECT MAX(march) FROM table_name_94 WHERE opponent = "boston bruins" AND game < 66
sql_create_context
CREATE TABLE table_204_164 ( id number, "branding" text, "callsign" text, "frequency" text, "power (kw)" text, "location" text )
what is the radio with the most mhz ?
SELECT "branding" FROM table_204_164 ORDER BY "frequency" DESC LIMIT 1
squall
CREATE TABLE table_name_15 ( show VARCHAR, network__last_aired_ VARCHAR, last_aired VARCHAR )
What show was played on ABC laster after 2002?
SELECT show FROM table_name_15 WHERE network__last_aired_ = "abc" AND last_aired > 2002
sql_create_context
CREATE TABLE table_39440 ( "School Name" text, "City" text, "Students" real, "FTE Teachers" real, "Pupil/Teacher Ratio" real )
What is the average number of students for schools with a pupil to teacher ratio of 25.1?
SELECT AVG("Students") FROM table_39440 WHERE "Pupil/Teacher Ratio" = '25.1'
wikisql
CREATE TABLE table_44530 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text )
What was Chris Hanburger's position?
SELECT "Position" FROM table_44530 WHERE "Name" = 'chris hanburger'
wikisql
CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, ...
now i need flights leaving DENVER in the afternoon on wednesday and arriving in 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, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND date_day.day_number = 23 AND date_day.month_number = ...
atis
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...
从01年1月2日截止到17年4月12日医院2875436入院诊断疾病结果与出院诊断疾病结果不同的医疗就诊记录里共有哪些?
SELECT * FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '2875436' AND gwyjzb.IN_HOSP_DATE BETWEEN '2001-01-02' AND '2017-04-12' UNION SELECT * FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '2875436' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2001-01-02' AND '2017-04-12' EXCEPT SELECT * FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '287543...
css
CREATE TABLE table_30120566_1 ( barony VARCHAR, townland VARCHAR )
What barony is Ballycunningham in?
SELECT barony FROM table_30120566_1 WHERE townland = "Ballycunningham"
sql_create_context
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 TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE T...
For all employees who have the letters D or S in their first name, for salary, hire_date, visualize the trend.
SELECT HIRE_DATE, SALARY FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
nvbench
CREATE TABLE table_8770 ( "Song" text, "Original Name" text, "Country" text, "Language" text, "Singer(s)" text )
What is the original name for the song 'Sono Io'?
SELECT "Original Name" FROM table_8770 WHERE "Song" = 'sono io'
wikisql
CREATE TABLE table_2197 ( "Episode" text, "First broadcast" text, "Rufus guest" text, "Marcus guest" text, "Winner" text )
What is the first broadcast date for episode 3x10?
SELECT "First broadcast" FROM table_2197 WHERE "Episode" = '3x10'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, h...
how many hours have elapsed since patient 006-123134 received the last pt lab test on this hospital visit?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', lab.labresulttime)) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-123134' AND patient.hos...
eicu
CREATE TABLE gymnast ( gymnast_id number, floor_exercise_points number, pommel_horse_points number, rings_points number, vault_points number, parallel_bars_points number, horizontal_bar_points number, total_points number ) CREATE TABLE people ( people_id number, name text, a...
What is the most common hometown of gymnasts?
SELECT T2.hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.gymnast_id = T2.people_id GROUP BY T2.hometown ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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 ) C...
what is average age of patients whose gender is m and ethnicity is white?
SELECT AVG(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.ethnicity = "WHITE"
mimicsql_data
CREATE TABLE table_9765 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What was the attendance when they played at Dallas Cowboys?
SELECT "Attendance" FROM table_9765 WHERE "Opponent" = 'at dallas cowboys'
wikisql
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
Show me about the correlation between School_ID and ACC_Percent in a scatter chart.
SELECT School_ID, ACC_Percent FROM basketball_match
nvbench
CREATE TABLE table_59002 ( "Date" text, "Score" text, "Set 1" text, "Set 2" text, "Total" text )
What is the Total of the 24:26 Set 1?
SELECT "Total" FROM table_59002 WHERE "Set 1" = '24:26'
wikisql
CREATE TABLE table_34419 ( "Date" real, "Opponent" text, "Venue" text, "Result" text, "Attendance" real, "Competition" text )
Which Venue has a Result of won 5-4?
SELECT "Venue" FROM table_34419 WHERE "Result" = 'won 5-4'
wikisql
CREATE TABLE table_5772 ( "Game" real, "January" real, "Opponent" text, "Score" text, "Record" text )
What is the score of the game where the Rangers record was 16-8-4?
SELECT "Score" FROM table_5772 WHERE "Record" = '16-8-4'
wikisql
CREATE TABLE station_company ( Station_ID int, Company_ID int, Rank_of_the_Year int ) CREATE TABLE gas_station ( Station_ID int, Open_Year int, Location text, Manager_Name text, Vice_Manager_Name text, Representative_Name text ) CREATE TABLE company ( Company_ID int, Rank i...
Show the company name with the number of gas station Show bar chart, and display Company in asc order.
SELECT Company, COUNT(*) FROM station_company AS T1 JOIN company AS T2 ON T1.Company_ID = T2.Company_ID GROUP BY T1.Company_ID ORDER BY Company
nvbench
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, ...
Virtual Meta Reputation for User X.
SELECT SUM(CASE WHEN v.VoteTypeId = 1 THEN 15 WHEN v.VoteTypeId = 2 AND p.PostTypeId = 1 THEN 5 WHEN v.VoteTypeId = 2 AND p.PostTypeId = 2 THEN 10 WHEN v.VoteTypeId = 3 THEN -2 END) AS Reputation, COUNT(CASE v.VoteTypeId WHEN 1 THEN 1 END) AS Accepts, COUNT(CASE WHEN v.VoteTypeId = 2 AND p.PostTypeId = 1 THEN 1 END) AS...
sede
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE patient ( uniquep...
tell me the number of patients diagnosed with gi obstruction / ileus until 2104?
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'gi obstruction / ileus' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2104')
eicu
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 d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE diagn...
what exactly does necator americanus mean?
SELECT d_icd_diagnoses.long_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'necator americanus' UNION SELECT d_icd_procedures.long_title FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'necator americanus'
mimic_iii
CREATE TABLE table_29256 ( "Overall rank" real, "Country" text, "Overall life expectancy" real, "Male life expectancy" real, "Male rank" real, "Female life expectancy" real, "Female rank" real )
Name the most overall rank for czech republic
SELECT MAX("Overall rank") FROM table_29256 WHERE "Country" = 'Czech Republic'
wikisql
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and the sum of price , and group by attribute name, I want to display by the x axis in desc.
SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name DESC
nvbench
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
until 2101 what was the five most common specimen test?
SELECT t1.culturesite FROM (SELECT microlab.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microlab WHERE STRFTIME('%y', microlab.culturetakentime) <= '2101' GROUP BY microlab.culturesite) AS t1 WHERE t1.c1 <= 5
eicu
CREATE TABLE table_46603 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" text, "Location" text )
What was the result fot the UFC 85 event?
SELECT "Res." FROM table_46603 WHERE "Event" = 'ufc 85'
wikisql
CREATE TABLE table_name_40 ( score VARCHAR, record VARCHAR )
With a Record of 9-24, what was the Score?
SELECT score FROM table_name_40 WHERE record = "9-24"
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, ...
在2006-06-17到2011-04-28内有多少医生就诊患者戚俊晤?
SELECT COUNT(mzjzjlb.ZZYSGH) FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.person_info_XM = '戚俊晤' AND mzjzjlb.JZKSRQ BETWEEN '2006-06-17' AND '2011-04-28'
css
CREATE TABLE table_train_112 ( "id" int, "systolic_blood_pressure_sbp" int, "modified_geriatric_depression_scale_gds" int, "diastolic_blood_pressure_dbp" int, "rosen_modified_hachinski_ischemic_score" int, "body_mass_index_bmi" float, "hypertension" bool, "NOUSE" float )
uncontrolled hypertension ( bp > 200 / 110 mmhg )
SELECT * FROM table_train_112 WHERE hypertension = 1 OR systolic_blood_pressure_sbp >= 200 OR diastolic_blood_pressure_dbp >= 110
criteria2sql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartr...
what is the procedure, which patient 016-9636 underwent two times during this hospital visit?
SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, COUNT(treatment.treatmenttime) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid ...
eicu
CREATE TABLE table_17060277_5 ( high_assists VARCHAR, game VARCHAR )
Who all had the most assists in game 12?
SELECT high_assists FROM table_17060277_5 WHERE game = 12
sql_create_context
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...
how many patients are admitted under emergency and suggested with drug route via both eyes?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND prescriptions.route = "BOTH EYES"
mimicsql_data
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE cost ( row_id number...
what was the top three of the most common output events that occurred in 2105?
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT outputevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM outputevents WHERE STRFTIME('%y', outputevents.charttime) = '2105' GROUP BY outputevents.itemid) AS t1 WHERE t1.c1 <= 3)
mimic_iii
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, ...
从02年6月25日至21年1月22日期间,病患鲁嘉歆被开出的所有检验报告单的检验报告单号都有哪些?
SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '鲁...
css
CREATE TABLE table_name_31 ( position INTEGER, points VARCHAR, pilot VARCHAR )
What is the average position of pilot petr krejcirik, who has less than 11 points?
SELECT AVG(position) FROM table_name_31 WHERE points < 11 AND pilot = "petr krejcirik"
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid numb...
whats the four most common specimen test in 2104?
SELECT t1.culturesite FROM (SELECT microlab.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microlab WHERE STRFTIME('%y', microlab.culturetakentime) = '2104' GROUP BY microlab.culturesite) AS t1 WHERE t1.c1 <= 4
eicu
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE regions ( REGION_ID...
For those employees who did not have any job in the past, give me the comparison about the sum of manager_id over the hire_date bin hire_date by weekday by a bar chart, could you list in ascending by the y axis?
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(MANAGER_ID)
nvbench
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttim...
what are the five specimen test most frequently ordered for patients who have been diagnosed with lupus erythematosus earlier within 2 months, the last year?
SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, 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_...
mimic_iii
CREATE TABLE table_14260687_3 ( other VARCHAR, total VARCHAR )
How man 'other' millions of smartphones were shipped when 181.1 million total were shipped?
SELECT COUNT(other) FROM table_14260687_3 WHERE total = "181.1"
sql_create_context
CREATE TABLE table_52888 ( "Country" text, "Preliminaries" real, "Interview" real, "Swimsuit" real, "Evening Gown" real, "Average" real )
What is the evening gown score where the interview score is 9.22 and the preliminaries are larger than 9.057?
SELECT SUM("Evening Gown") FROM table_52888 WHERE "Interview" = '9.22' AND "Preliminaries" > '9.057'
wikisql
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), ...
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, a bar chart shows the distribution of job_id and the average of manager_id , and group by attribute job_id, and could you display by the Y-axis in descending?
SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY AVG(MANAGER_ID) DESC
nvbench
CREATE TABLE table_3881 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What is the game with the team indiana?
SELECT "Game" FROM table_3881 WHERE "Team" = 'Indiana'
wikisql
CREATE TABLE table_204_770 ( id number, "season" number, "date" text, "jia-a/csl winner" text, "result" text, "fa cup winner" text, "scorers" text, "stadium" text )
where was the match held immediately before 2014 's at guizhou olympic stadium ?
SELECT "stadium" FROM table_204_770 WHERE "season" < 2014 ORDER BY "season" DESC LIMIT 1
squall
CREATE TABLE table_38576 ( "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
Which Opponent has a Score of 3 6, 5 7?
SELECT "Opponent" FROM table_38576 WHERE "Score" = '3–6, 5–7'
wikisql
CREATE TABLE table_name_39 ( result VARCHAR, champions VARCHAR, year VARCHAR, runners_up VARCHAR )
What is the result for the champions jeonju kcc egis with runners-up seoul samsung thunders after 2007?
SELECT result FROM table_name_39 WHERE year > 2007 AND runners_up = "seoul samsung thunders" AND champions = "jeonju kcc egis"
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, ...
get me patient 015-80402's daily average weight until 3 years ago.
SELECT AVG(patient.admissionweight) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-80402') AND NOT patient.admissionweight IS NULL AND DATETIME(patient.unitadmittime) <= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY STRFTIME('...
eicu
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
名叫彭书萱的病人在被门诊诊断为疾病U20.085的时候茶碱的结果定量及其单位都是什么?
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND 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.JZ...
css
CREATE TABLE table_name_84 ( city VARCHAR, venue VARCHAR )
In which city is Hayman Hall (Tom Gola Arena) located?
SELECT city FROM table_name_84 WHERE venue = "hayman hall (tom gola arena)"
sql_create_context
CREATE TABLE table_37422 ( "Round" real, "Pick" real, "Player" text, "Position" text, "School/Club Team" text )
Which Player has a Round larger than 5, and a School/Club Team of bethune-cookman?
SELECT "Player" FROM table_37422 WHERE "Round" > '5' AND "School/Club Team" = 'bethune-cookman'
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
among patients who had open and other replacement of aortic valve with tissue graft, how many of them were unmarried?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "SINGLE" AND procedures.long_title = "Open and other replacement of aortic valve with tissue graft"
mimicsql_data
CREATE TABLE table_203_400 ( id number, "district" text, "vacator" text, "reason for change" text, "successor" text, "date successor\nseated" text )
which district has the earliest date that a successor was seated ?
SELECT "district" FROM table_203_400 ORDER BY "date successor\nseated" LIMIT 1
squall
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) 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 ) CR...
how much clopidogrel is prescribed the first time in 06/this year to patient 72364?
SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 72364) AND prescriptions.drug = 'clopidogrel' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRF...
mimic_iii
CREATE TABLE table_12756 ( "Date" text, "Opponent#" text, "Rank#" text, "Result" text, "Attendance" text )
What was the result for Rank 2 on December 6, 1969?
SELECT "Result" FROM table_12756 WHERE "Rank#" = '2' AND "Date" = 'december 6, 1969'
wikisql
CREATE TABLE table_12445 ( "Mininera DFL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real )
What is the sum of losses when draws are larger than 0?
SELECT COUNT("Losses") FROM table_12445 WHERE "Draws" > '0'
wikisql
CREATE TABLE table_10812403_4 ( college VARCHAR, position VARCHAR )
What college had a LB in the draft?
SELECT college FROM table_10812403_4 WHERE position = "LB"
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
what is discharge location of subject id 2560?
SELECT demographic.discharge_location FROM demographic WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE table_name_40 ( position INTEGER, points_1 VARCHAR )
What is the position when the points 1 is 61?
SELECT SUM(position) FROM table_name_40 WHERE points_1 = "61"
sql_create_context
CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_...
what nonstop flights between ATLANTA and WASHINGTON leave ATLANTA after 1800 o'clock pm
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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHINGTON' AND flight.departure_time > 1800 AND flight.to_airport = AIRPORT_SERVICE_1.a...
atis
CREATE TABLE weather ( date TEXT, max_temperature_f INTEGER, mean_temperature_f INTEGER, min_temperature_f INTEGER, max_dew_point_f INTEGER, mean_dew_point_f INTEGER, min_dew_point_f INTEGER, max_humidity INTEGER, mean_humidity INTEGER, min_humidity INTEGER, max_sea_level_pre...
Please show the trend about the number of days with max temperature reaches 80 change over dates, order x axis from high to low order.
SELECT date, COUNT(date) FROM weather WHERE max_temperature_f >= 80 GROUP BY date ORDER BY date DESC
nvbench
CREATE TABLE table_name_93 ( diameter VARCHAR, thickness VARCHAR )
Which Diameter has a Thickness of 1.3mm?
SELECT diameter FROM table_name_93 WHERE thickness = "1.3mm"
sql_create_context
CREATE TABLE table_3504 ( "Locale" text, "Skip" text, "W" real, "L" real, "PF" real, "PA" real, "Ends Won" real, "Ends Lost" real, "Blank Ends" real, "Stolen Ends" real, "Shot Pct." real )
How many times is the ends lost 49?
SELECT COUNT("L") FROM table_3504 WHERE "Ends Lost" = '49'
wikisql
CREATE TABLE table_name_11 ( grid INTEGER, time_retired VARCHAR )
Which grid is the highest and has a time/retired of +0.3?
SELECT MAX(grid) FROM table_name_11 WHERE time_retired = "+0.3"
sql_create_context
CREATE TABLE table_name_38 ( away_team VARCHAR, home_team VARCHAR )
What is the away side score when footscray is the home side?
SELECT away_team AS score FROM table_name_38 WHERE home_team = "footscray"
sql_create_context
CREATE TABLE table_18251 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
who is the incumbent with candidates being tom ridge (r) 80.9% joylyn blackwell (d) 19.1%
SELECT "Incumbent" FROM table_18251 WHERE "Candidates" = 'Tom Ridge (R) 80.9% Joylyn Blackwell (D) 19.1%'
wikisql
CREATE TABLE table_27303975_2 ( catalog_number VARCHAR, title VARCHAR )
Name the catalog number for am/pm callanetics
SELECT catalog_number FROM table_27303975_2 WHERE title = "AM/PM Callanetics"
sql_create_context
CREATE TABLE table_name_40 ( frequency INTEGER, status VARCHAR, format VARCHAR )
What is the largest frequency owned by multicultural broadcasting with a Format of vietnamese?
SELECT MAX(frequency) FROM table_name_40 WHERE status = "owned by multicultural broadcasting" AND format = "vietnamese"
sql_create_context
CREATE TABLE table_name_89 ( home_team VARCHAR, venue VARCHAR )
What did the home team at Brunswick Street Oval score?
SELECT home_team AS score FROM table_name_89 WHERE venue = "brunswick street oval"
sql_create_context
CREATE TABLE table_14786 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real )
What is the average number of events of PGA Championship tournaments with a top-5 less than 0?
SELECT AVG("Events") FROM table_14786 WHERE "Top-10" = '0' AND "Tournament" = 'pga championship' AND "Top-5" < '0'
wikisql
CREATE TABLE table_name_63 ( subject VARCHAR, election VARCHAR, office VARCHAR )
What is the name of the subject who ran in the general election for Queen Anne's County State's Attorney?
SELECT subject FROM table_name_63 WHERE election = "general" AND office = "queen anne's county state's attorney"
sql_create_context
CREATE TABLE table_29832 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Name the total number of record for 61
SELECT COUNT("Record") FROM table_29832 WHERE "Game" = '61'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime...
was the sao2 of patient 017-24595 normal since 121 days ago?
SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-24595')) AND vitalperiodic.sao2 BETWEEN sao2_lower AND sao2_uppe...
eicu
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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 ) C...
what is diagnoses icd9 code of subject name kelly gallardo?
SELECT diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Kelly Gallardo"
mimicsql_data
CREATE TABLE table_26309085_1 ( surface VARCHAR, partner VARCHAR )
What was the surface when he played with John Alexander?
SELECT surface FROM table_26309085_1 WHERE partner = "John Alexander"
sql_create_context
CREATE TABLE table_44765 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text )
What is the average value of Overall, when Round is greater than 11, and when Pick is greater than 10?
SELECT AVG("Overall") FROM table_44765 WHERE "Round" > '11' AND "Pick" > '10'
wikisql
CREATE TABLE table_203_466 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
number of teams above 9 medals
SELECT COUNT("nation") FROM table_203_466 WHERE "total" > 9
squall
CREATE TABLE table_50883 ( "Date" text, "Home captain" text, "Away captain" text, "Venue" text, "Result" text )
Who is the home captain of the match that resulted [[|]] by 151 runs?
SELECT "Home captain" FROM table_50883 WHERE "Result" = '[[|]] by 151 runs'
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, ...
看看被门诊诊断为疾病U99.814的患者柏志国的检测指标095190的结果定量是什么?单位又是什么
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZ...
css
CREATE TABLE table_63845 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text )
What is the Format of the release with Catalog number 2508668?
SELECT "Format" FROM table_63845 WHERE "Catalog" = '2508668'
wikisql
CREATE TABLE table_20631 ( "#" real, "Date" text, "at/vs." text, "Opponent" text, "Score" text, "Attendance" real, "Record" text )
Name the most attendance
SELECT MAX("Attendance") FROM table_20631
wikisql
CREATE TABLE table_46572 ( "Game" real, "Date" text, "Location" text, "Time" text, "Attendance" real )
What was the lowest attendance for the game that had a time of 3:31 and was before game 7?
SELECT MIN("Attendance") FROM table_46572 WHERE "Time" = '3:31' AND "Game" < '7'
wikisql
CREATE TABLE table_name_32 ( position VARCHAR, competition VARCHAR )
Which Position has a Competition of european race walking cup?
SELECT position FROM table_name_32 WHERE competition = "european race walking cup"
sql_create_context
CREATE TABLE table_22318 ( "Rank" real, "Place" text, "County" text, "Per Capita Income" text, "Median House- hold Income" text, "Population" real, "Number of Households" real )
For upper Arlington, what was the median household income?
SELECT "Median House- hold Income" FROM table_22318 WHERE "Place" = 'Upper Arlington'
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 lab ( labid number, pa...
how many patients since 2105 were diagnosed with diabetes mellitus during the same month after the first diagnosis with stroke - ischemic stroke?
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'diabetes mellitus' AND STRFTIME('%y', diagnosis.diagnosistime) >= '2105') AS t1 JOIN (SELECT patient.uniquep...
eicu
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...
在医疗就诊99340869748中,给患者53521712开的药有哪些?每次的用量是多少?使用频次呢
SELECT t_kc22.SOC_SRT_DIRE_NM, t_kc22.EACH_DOSAGE, t_kc22.USE_FRE 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 = '99340869748'
css
CREATE TABLE table_11602313_4 ( fsb VARCHAR, part_number_s_ VARCHAR )
What is the FSB of the model with part number lf80537gf0411m?
SELECT fsb FROM table_11602313_4 WHERE part_number_s_ = "LF80537GF0411M"
sql_create_context
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) 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...
是否完成了退费结算,在医疗就诊76943948515里面?
SELECT t_kc24.REF_SLT_FLG FROM t_kc24 JOIN t_kc21_t_kc24 JOIN t_kc21 ON t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID AND t_kc21_t_kc24.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '76943948515'
css
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 text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
count the number of patients whose drug route is left eye?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.route = "LEFT EYE"
mimicsql_data
CREATE TABLE table_24431264_16 ( points VARCHAR, player VARCHAR )
How many players named victor h nescu played?
SELECT COUNT(points) AS won FROM table_24431264_16 WHERE player = "Victor Hănescu"
sql_create_context
CREATE TABLE table_name_63 ( current_map VARCHAR, namesake VARCHAR )
What is the current map designation of the feature which was named for discovery rupes?
SELECT current_map FROM table_name_63 WHERE namesake = "discovery rupes"
sql_create_context
CREATE TABLE table_25461827_2 ( contestant VARCHAR, age VARCHAR )
What is the number of contestants who are aged exactly 18?
SELECT COUNT(contestant) FROM table_25461827_2 WHERE age = 18
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CRE...
what was the last time patient 025-50213 got prescribed a drug on the current hospital visit?
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-50213' AND patient.hospitaldischargetime IS NULL)) ORDER B...
eicu
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE medication ( medicationid number, pat...
how many hours is it been since patient 031-13920's last procedure during the current hospital visit?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-13920...
eicu
CREATE TABLE table_25375093_1 ( podiums INTEGER, position VARCHAR )
Name the least podiums for 9th position
SELECT MIN(podiums) FROM table_25375093_1 WHERE position = "9th"
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 demographic ...
give me the number of patients whose days of hospital stay is greater than 2 and lab test fluid is blood?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "2" AND lab.fluid = "Blood"
mimicsql_data
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...
Questions by users with high rep (above 20K).
SELECT Users.Id AS "user_link", Posts.Id AS "post_link", Posts.LastEditDate FROM Users INNER JOIN Posts ON Users.Id = OwnerUserId WHERE Reputation >= 20000 AND PostTypeId = 2 ORDER BY 'lasteditdate' DESC LIMIT 50
sede
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE Badges ( Id number, UserId numb...
Histogram of how many answers people give.
SELECT sel.n AS "#answers", COUNT(*) AS "occurence" FROM (SELECT COUNT(*) AS "n" FROM Users AS u INNER JOIN Posts AS p ON p.OwnerUserId = u.Id WHERE p.PostTypeId = 2 AND p.ClosedDate IS NULL GROUP BY u.Id) AS sel GROUP BY sel.n ORDER BY sel.n
sede
CREATE TABLE table_24493 ( "State (class)" text, "Vacator" text, "Reason for change" text, "Successor" text, "Date of successors formal installation" text )
What is every reason for change for the date of successors installation is March 16, 1960?
SELECT "Reason for change" FROM table_24493 WHERE "Date of successors formal installation" = 'March 16, 1960'
wikisql
CREATE TABLE table_name_34 ( laps VARCHAR, manufacturer VARCHAR, grid VARCHAR )
What was the amount of laps for the vehicle manufactured by honda with a grid of 9?
SELECT laps FROM table_name_34 WHERE manufacturer = "honda" AND grid = "9"
sql_create_context
CREATE TABLE d_icd_procedures ( 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 cost ( row_id number, ...
what output did patient 31300 last have until 06/14/2105?
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT outputevents.itemid FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31300)) AND STRFTIME('%y-%m-%d', outputeve...
mimic_iii