context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_26403 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Prod. code" real )
How many people directed episode 7 In the season?
SELECT COUNT("Directed by") FROM table_26403 WHERE "Season #" = '7'
wikisql
CREATE TABLE zyb ( CLINIC_ID 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, INSU_TYPE text, IN...
医院1692026全部医疗就诊的记录里,依据科室编码和出院诊断的不同算一算患者平均多大年纪
SELECT qtb.MED_ORG_DEPT_CD, qtb.OUT_DIAG_DIS_NM, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '1692026' GROUP BY qtb.MED_ORG_DEPT_CD, qtb.OUT_DIAG_DIS_NM UNION SELECT gyb.MED_ORG_DEPT_CD, gyb.OUT_DIAG_DIS_NM, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '1692026' GROUP BY gyb.MED_ORG_DEPT_CD, gyb....
css
CREATE TABLE table_7799 ( "Company Name" text, "Product Name" text, "Hardware Model" text, "Accreditation type" text, "Accreditation level" text, "Accreditation status" text )
What is the Accreditation Type, when the Accreditation Level is Joyn, and when the Hardware Model is Nokia 700?
SELECT "Accreditation type" FROM table_7799 WHERE "Accreditation level" = 'joyn' AND "Hardware Model" = 'nokia 700'
wikisql
CREATE TABLE table_27988540_1 ( title VARCHAR, no_in_season VARCHAR )
What is the name of episode 5 in the season?
SELECT title FROM table_27988540_1 WHERE no_in_season = 5
sql_create_context
CREATE TABLE table_name_61 ( pocona_municipality___percentage_ INTEGER, entre_ríos_municipality___percentage_ VARCHAR, puerto_villarroel_municipality___percentage_ VARCHAR, chimoré_municipality___percentage_ VARCHAR )
Which Pocona Municipality (%) is the lowest one that has a Puerto Villarroel Municipality (%) smaller than 14.6, and a Chimor Municipality (%) of 5.1, and an Entre R os Municipality (%) smaller than 0.9?
SELECT MIN(pocona_municipality___percentage_) FROM table_name_61 WHERE puerto_villarroel_municipality___percentage_ < 14.6 AND chimoré_municipality___percentage_ = 5.1 AND entre_ríos_municipality___percentage_ < 0.9
sql_create_context
CREATE TABLE table_5170 ( "Name" text, "Pennant number" text, "Ordered" real, "Builder" text, "Commissioned" text, "Fate" text )
Sfax has a total ordered number of?
SELECT COUNT("Ordered") FROM table_5170 WHERE "Name" = 'sfax'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE medication ( med...
when the first time patient 005-18714 was prescribed a medication in 01/last year via the subcutan route?
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 = '005-18714')) AND medication.routeadmin = 'subcutan' AND DATETI...
eicu
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREA...
what's the five most frequently ordered specimen test since 2103?
SELECT t1.culturesite FROM (SELECT microlab.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microlab WHERE STRFTIME('%y', microlab.culturetakentime) >= '2103' GROUP BY microlab.culturesite) AS t1 WHERE t1.c1 <= 5
eicu
CREATE TABLE table_26375386_28 ( place INTEGER, couple VARCHAR )
What is the least place when the couple is Keiron & Brianne?
SELECT MIN(place) FROM table_26375386_28 WHERE couple = "Keiron & Brianne"
sql_create_context
CREATE TABLE table_14593 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Record" text, "Attendance" real )
What was the record after the game against the St. Louis Cardinals?
SELECT "Record" FROM table_14593 WHERE "Opponent" = 'st. louis cardinals'
wikisql
CREATE TABLE table_61450 ( "Tournament" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text )
What is the 2010 value of the monte carlo masters, which had A in 2012?
SELECT "2010" FROM table_61450 WHERE "2012" = 'a' AND "Tournament" = 'monte carlo masters'
wikisql
CREATE TABLE table_203_770 ( id number, "ages attained (years)" text, "catholic" text, "protestant and other christian" text, "other religion" text, "none or not stated" text )
at least of 50 % of the population is protestant , starting at which age range ?
SELECT "ages attained (years)" FROM table_203_770 WHERE "protestant and other christian" = 50
squall
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title 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 cost ( row_i...
what is the price of diagnosis of uterine leiomyoma nos?
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'diagnoses_icd' AND cost.event_id IN (SELECT diagnoses_icd.row_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'uterine leiomyoma nos'))
mimic_iii
CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE...
Find meter_500 and meter_100 , and visualize them by a bar chart.
SELECT meter_500, meter_100 FROM swimmer
nvbench
CREATE TABLE table_name_41 ( sub_parish__sogn_ VARCHAR, year_built VARCHAR, location_of_the_church VARCHAR )
WHAT IS THE SUB-PARISH WITH A YEAR AFTER 1916, IN ortnevik?
SELECT sub_parish__sogn_ FROM table_name_41 WHERE year_built > 1916 AND location_of_the_church = "ortnevik"
sql_create_context
CREATE TABLE table_76830 ( "Name" text, "Country" text, "Status" text, "Transfer window" text, "Transfer fee" text )
What is the transfer window with a status of transfer from the country of Wal?
SELECT "Transfer window" FROM table_76830 WHERE "Status" = 'transfer' AND "Country" = 'wal'
wikisql
CREATE TABLE table_56806 ( "Team" text, "Games Played" real, "Wins" real, "Losses" real, "Ties" real, "Goals For" real, "Goals Against" real )
How many ties do teams with 25 Goals For and more than 5 wins have?
SELECT SUM("Ties") FROM table_56806 WHERE "Goals For" = '25' AND "Wins" > '5'
wikisql
CREATE TABLE table_24680 ( "No" real, "Driver" text, "Entrant" text, "Constructor" text, "Chassis" text, "Engine" text )
Name the constructor for alberto ascari
SELECT "Constructor" FROM table_24680 WHERE "Driver" = 'Alberto Ascari'
wikisql
CREATE TABLE table_18744 ( "Rank" real, "Name" text, "City" text, "Region" text, "Height (m)" real, "Height (ft)" real, "Floors" real, "Estimated Completion" real )
how many city with name being providence tower
SELECT COUNT("City") FROM table_18744 WHERE "Name" = 'Providence Tower'
wikisql
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,...
tell me the age of patient john gartman and his marital status.
SELECT demographic.marital_status, demographic.age FROM demographic WHERE demographic.name = "John Gartman"
mimicsql_data
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, ...
查一下范升荣这个病人的医疗记录中,有哪几次医疗记录中被开出过金额超过5540.22元的药品?列出医疗就诊编码
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '范升荣' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 5540.22)
css
CREATE TABLE table_46477 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
What is the time of the match with 3 rounds and a 9-3 record?
SELECT "Time" FROM table_46477 WHERE "Round" = '3' AND "Record" = '9-3'
wikisql
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...
从07年8月11日到18年7月17日,患者马芳蕙在470787上的检测记录详情
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZ...
css
CREATE TABLE table_name_89 ( week INTEGER, result VARCHAR )
What is the highest Week, when Result is W 34-21?
SELECT MAX(week) FROM table_name_89 WHERE result = "w 34-21"
sql_create_context
CREATE TABLE gyb ( CLINIC_ID 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, INSU_TYPE text, IN...
9009373这所医院所有医疗记录里按照不同科室名算一算医院统筹基金支出比上医疗费用总和的平均比值
SELECT qtb.MED_ORG_DEPT_NM, AVG(t_kc24.OVE_PAY) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '9009373' GROUP BY qtb.MED_ORG_DEPT_NM UNION SELECT gyb.MED_ORG_DEPT_NM, AVG(t_kc24.OVE_PAY) FROM gyb JOIN t_kc24 ON gyb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gyb.MED_SER_ORG_...
css
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeou...
are the respiration of patient 032-24135 second measured on the current icu visit less than first measured on the current icu visit?
SELECT (SELECT vitalperiodic.respiration FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '032-24135') AND patient.unitdischargetime IS NU...
eicu
CREATE TABLE table_40872 ( "Player" text, "Club" text, "League" real, "FA Cup" real, "FA Trophy" real, "League Cup" real, "Total" real )
What is the lowest number of FA Trophy matches for a player with a total number of matches under 22 and less than 0 league cups.
SELECT MIN("FA Trophy") FROM table_40872 WHERE "Total" < '22' AND "League Cup" < '0'
wikisql
CREATE TABLE table_35128 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the lowest rank of the team with 0 bronze, 1 silver, and more than 0 gold?
SELECT MIN("Rank") FROM table_35128 WHERE "Bronze" = '0' AND "Silver" = '1' AND "Gold" > '0'
wikisql
CREATE TABLE table_24894 ( "Ch \u2116" text, "Channel" text, "Channel content" text, "Transmission" text, "Format" text, "Launch Date" text, "Licence" text )
How many launch dates are there for digital transmission?
SELECT COUNT("Launch Date") FROM table_24894 WHERE "Transmission" = 'Digital'
wikisql
CREATE TABLE table_8122 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text )
Which Margin of victory has a Runner(s)-up of betty burfeindt, and a Tournament of pompano beach classic?
SELECT "Margin of victory" FROM table_8122 WHERE "Runner(s)-up" = 'betty burfeindt' AND "Tournament" = 'pompano beach classic'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) 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, ...
检验报告单26254830519是哪个报告人报告的,工号是多少,把姓名也查一下
SELECT BGRGH, BGRXM FROM jybgb WHERE BGDH = '26254830519'
css
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE cost ( costid number, uniquepi...
how many times does patient 017-7283 get a mchc test during the last hospital visit?
SELECT COUNT(*) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-7283' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime D...
eicu
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text...
fraction of upvotes from 101-rep users.
SELECT CAST(SUM(CASE WHEN Reputation = 101 THEN UpVotes ELSE 0 END) AS FLOAT) / SUM(UpVotes) FROM Users
sede
CREATE TABLE table_name_68 ( erp_w VARCHAR, frequency_mhz VARCHAR, city_of_license VARCHAR )
What is the ERP W of a Frequency MHz greater than 89.5 in the city of Washburn, Texas?
SELECT erp_w FROM table_name_68 WHERE frequency_mhz > 89.5 AND city_of_license = "washburn, texas"
sql_create_context
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 allergy ( allergy...
what is the cost of a medication named keppra?
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'medication' AND cost.eventid IN (SELECT medication.medicationid FROM medication WHERE medication.drugname = 'keppra')
eicu
CREATE TABLE table_name_92 ( sub_parish__sogn_ VARCHAR, year_built VARCHAR, parish__prestegjeld_ VARCHAR )
Which Sub-Parish (Sogn) was built after 1894 in the Parish (Prestegjeld) of jostedal parish?
SELECT sub_parish__sogn_ FROM table_name_92 WHERE year_built > 1894 AND parish__prestegjeld_ = "jostedal parish"
sql_create_context
CREATE TABLE table_name_82 ( gold_medals INTEGER, total_medals VARCHAR, bronze_medals VARCHAR, silver_medals VARCHAR )
Name the average gold medals when the bronze medals was less than 1, silver medals being 0 and total medals more than 1
SELECT AVG(gold_medals) FROM table_name_82 WHERE bronze_medals < 1 AND silver_medals = 0 AND total_medals > 1
sql_create_context
CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE ...
what is the earliest morning flight leaving BOSTON for WASHINGTON
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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHI...
atis
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
患者陶国兴之前就诊的医院是哪个
SELECT mzjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND per...
css
CREATE TABLE table_74235 ( "Song title" text, "Artist" text, "Show" text, "Difficulty" real, "Effort" real, "Year" real, "Dancers" text )
How many artists were there for the show thoroughly modern millie?
SELECT COUNT("Artist") FROM table_74235 WHERE "Show" = 'Thoroughly Modern Millie'
wikisql
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...
give the number of patients whose procedure long title is closed biopsy of skin and subcutaneous tissue and lab test fluid is cerebrospinal fluid (csf).
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "Closed biopsy of skin and subcutaneous tissue" AND lab.fluid = "Cerebrospinal Fluid (CSF)"
mimicsql_data
CREATE TABLE table_name_18 ( score VARCHAR, january VARCHAR, points VARCHAR )
Which Score has a January larger than 21, and Points of 63?
SELECT score FROM table_name_18 WHERE january > 21 AND points = 63
sql_create_context
CREATE TABLE teachers ( lastname text, firstname text, classroom number ) CREATE TABLE list ( lastname text, firstname text, grade number, classroom number )
How many students does one classroom have?
SELECT COUNT(*), classroom FROM list GROUP BY classroom
spider
CREATE TABLE table_2182562_1 ( top_5 VARCHAR, avg_finish VARCHAR )
What are the top 5 average finishes equalling 40.3?
SELECT top_5 FROM table_2182562_1 WHERE avg_finish = "40.3"
sql_create_context
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...
give me the number of patients whose death status is 0 and procedure icd9 code is 3891?
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.icd9_code = "3891"
mimicsql_data
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, ...
count the number of patients diagnosed with atrial fibrillation who underwent other and unspecified coronary arteriography.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE diagnoses.short_title = "Atrial fibrillation" AND procedures.long_title = "Other and unspecified coronary arteriography"
mimicsql_data
CREATE TABLE table_name_28 ( since_beginning_of_big_12 VARCHAR, last_5_meetings VARCHAR, last_10_meetings VARCHAR, at_neutral_site VARCHAR )
what is the since beginning of big 12 when last 10 meetings is ou, 7-3, neutral site is ou, 2-1, and last 5 meetings is bu, 3-2?
SELECT since_beginning_of_big_12 FROM table_name_28 WHERE last_10_meetings = "ou, 7-3" AND at_neutral_site = "ou, 2-1" AND last_5_meetings = "bu, 3-2"
sql_create_context
CREATE TABLE table_name_87 ( drawn VARCHAR, points VARCHAR, lost VARCHAR )
How many Drawns have Points smaller than 5 and a Lost larger than 7?
SELECT COUNT(drawn) FROM table_name_87 WHERE points < 5 AND lost > 7
sql_create_context
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
参保人华依波门诊医疗费总额一年是多少?
SELECT SUM(MED_AMOUT) FROM t_kc21 WHERE PERSON_NM = '华依波' AND CLINIC_TYPE = '门诊'
css
CREATE TABLE table_19523708_1 ( draw INTEGER )
What is the highest draw represented?
SELECT MAX(draw) FROM table_19523708_1
sql_create_context
CREATE TABLE table_77028 ( "Nation" text, "Model" text, "Length" text, "Barrel length" text, "Weight" text )
What is Length, when Barrel Length is 750mm / 29.5 in?
SELECT "Length" FROM table_77028 WHERE "Barrel length" = '750mm / 29.5 in'
wikisql
CREATE TABLE table_name_88 ( frequency_mhz INTEGER, erp_w VARCHAR )
Average frequency with ERP W of 62?
SELECT AVG(frequency_mhz) FROM table_name_88 WHERE erp_w = "62"
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,...
count the number of patients admitted before 2155 who had sinoatrial node dysfunction diagnoses.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2155" AND diagnoses.long_title = "Sinoatrial node dysfunction"
mimicsql_data
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod 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 outputevents ( row_id numb...
what are the three most commonly prescribed drugs since 3 years ago for patients who had temporary tracheostomy before within 2 months?
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures ...
mimic_iii
CREATE TABLE table_name_70 ( d_43 VARCHAR, d_48 VARCHAR )
Name the D 43 with D 48 of d 9
SELECT d_43 FROM table_name_70 WHERE d_48 = "d 9"
sql_create_context
CREATE TABLE table_29677 ( "Week #" text, "Theme" text, "Song Choice" text, "Original Artist" text, "Order #" text, "Result" text )
What week number was the result bottom 3?
SELECT "Week #" FROM table_29677 WHERE "Result" = 'Bottom 3'
wikisql
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, ...
从2005年5月20日到2014年6月18日这段期间参保人83001466花了多少门诊检查费?
SELECT SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_ID = '83001466' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2005-05-20' AND '2014-06-18' AND t_kc22.MED_I...
css
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...
give the number of patients who underwent nasal sinus dx proc nec.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.short_title = "Nasal sinus dx proc NEC"
mimicsql_data
CREATE TABLE table_name_22 ( number VARCHAR, position VARCHAR )
Which number plays the skaters position?
SELECT number FROM table_name_22 WHERE position = "skaters"
sql_create_context
CREATE TABLE table_name_34 ( runners VARCHAR, placing INTEGER )
How many runners had placings over 8?
SELECT COUNT(runners) FROM table_name_34 WHERE placing > 8
sql_create_context
CREATE TABLE table_name_71 ( week INTEGER, date VARCHAR )
Which week was the 1995-10-01 game on?
SELECT MAX(week) FROM table_name_71 WHERE date = "1995-10-01"
sql_create_context
CREATE TABLE table_60392 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
When bronze is more than 3, what is the rank?
SELECT "Rank" FROM table_60392 WHERE "Bronze" > '3'
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 )
For those records from the products and each product's manufacturer, a scatter chart shows the correlation between manufacturer and revenue .
SELECT Manufacturer, Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code
nvbench
CREATE TABLE table_46119 ( "School" text, "Location" text, "Founded" real, "Affiliation" text, "Nickname" text )
What school is in Radford, Va?
SELECT "School" FROM table_46119 WHERE "Location" = 'radford, va'
wikisql
CREATE TABLE table_203_533 ( id number, "season" number, "level" text, "division" text, "section" text, "position" text, "movements" text )
when was the first season ?
SELECT "season" FROM table_203_533 ORDER BY "season" LIMIT 1
squall
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
从二00四年十一月二十日到二0一六年四月五日这段时间,患者63934308的检测指标492955找的哪些医务人员做的,这些医务人员的工号和姓名报一下
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGD...
css
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE chartevents ( row_id number, subject_id number, h...
in the first hospital encounter, what was the daily maximum weight of patient 594?
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 = 594 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND chartevents....
mimic_iii
CREATE TABLE table_7772 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What was the score of T3 place?
SELECT "Score" FROM table_7772 WHERE "Place" = 't3'
wikisql
CREATE TABLE table_24302700_2 ( event_3_squat_lift VARCHAR, nationality VARCHAR, event_2_truck_pull VARCHAR )
What was the result(s) in the event 3 squatlift for the man from the United states with a result of 1 (42.66s) in the event 2 truck pull?
SELECT event_3_squat_lift FROM table_24302700_2 WHERE nationality = "United States" AND event_2_truck_pull = "1 (42.66s)"
sql_create_context
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, Par...
Find posts with a given string.
SELECT Id AS "post_link" FROM Posts WHERE Body LIKE ('%' + '##SearchTerm:String##' + '%') LIMIT 500
sede
CREATE TABLE table_21535453_1 ( brian_moran VARCHAR, source VARCHAR, creigh_deeds VARCHAR )
What was Brian Moran's tally in the Survey USA poll where Creigh Deeds had 26%?
SELECT brian_moran FROM table_21535453_1 WHERE source = "Survey USA" AND creigh_deeds = "26%"
sql_create_context
CREATE TABLE table_name_56 ( college VARCHAR, school VARCHAR )
What college did the player from Ames High School attend?
SELECT college FROM table_name_56 WHERE school = "ames high school"
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 prescription...
what is the admission type and date of death of patient id 2560?
SELECT demographic.admission_type, demographic.dod FROM demographic WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE table_28606933_7 ( period VARCHAR, position VARCHAR )
What period(s) featured a left inside linebacker?
SELECT period FROM table_28606933_7 WHERE position = "Left inside linebacker"
sql_create_context
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 bdmzjzjlb ( HXPLC number, HZX...
在04年9月6日到12年2月8日期间的门诊就诊中有多少医院2106089的科室开出了超出24张检验报告单?
SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM wdmzjzjlb JOIN jybgb ON wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE wdmzjzjlb.YLJGDM = '2106089' AND jybgb.BGRQ BETWEEN '2004-09-06' AND '2012-02-08' GROUP BY jybgb.KSBM HAVING COUNT(*) > 24 UNION SELECT jybgb.KSBM FROM bdmzjzjlb J...
css
CREATE TABLE table_78622 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
Player Craig Parry of Australia is in what place number?
SELECT "Place" FROM table_78622 WHERE "Country" = 'australia' AND "Player" = 'craig parry'
wikisql
CREATE TABLE table_name_12 ( score_in_the_final VARCHAR, outcome VARCHAR, surface VARCHAR )
Which Score in the final has an Outcome of winner, and a Surface of hard (i)?
SELECT score_in_the_final FROM table_name_12 WHERE outcome = "winner" AND surface = "hard (i)"
sql_create_context
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 ( Train_ID int, Name text, Time text, Service text ) CREATE TABLE t...
Compute the total sum number of platforms across location as a pie chart.
SELECT Location, SUM(Number_of_Platforms) FROM station GROUP BY Location
nvbench
CREATE TABLE table_22667 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location/Attendance" text, "Record" text )
Name the least game for 8-3
SELECT MIN("Game") FROM table_22667 WHERE "Record" = '8-3'
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...
从2002年10月2日到2017年1月18日,在这个就诊结算日期内,病人10815565所有的医疗就诊记录的编号列一下
SELECT t_kc21.MED_CLINIC_ID 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_kc24.PERSON_ID = '10815565' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2002-10-02' AND '2017-01-18'
css
CREATE TABLE table_name_78 ( austria VARCHAR )
What is the smallest number for 102 when Friendly of friendly, and an Austria of greece?
SELECT MIN(102) FROM table_name_78 WHERE "friendly" = "friendly" AND austria = "greece"
sql_create_context
CREATE TABLE table_name_12 ( date VARCHAR, opponenent VARCHAR, match_type VARCHAR )
When was the opponent Poland and the match type EC -qualifier?
SELECT date FROM table_name_12 WHERE opponenent = "poland" AND match_type = "ec -qualifier"
sql_create_context
CREATE TABLE table_name_30 ( lost INTEGER, drawn VARCHAR, played VARCHAR )
Which Lost has Drawn larger than 1, and a Played larger than 14?
SELECT MIN(lost) FROM table_name_30 WHERE drawn > 1 AND played > 14
sql_create_context
CREATE TABLE table_24227 ( "Place" real, "Athlete" text, "Long jump" real, "Javelin" real, "200 m" real, "Discus" real, "1500 m" real, "Total" real )
Name the number of long jump for 1500m being 2
SELECT COUNT("Long jump") FROM table_24227 WHERE "1500 m" = '2'
wikisql
CREATE TABLE table_name_9 ( rank INTEGER, total VARCHAR, gold VARCHAR )
What was the average rank for the team that had more than 5 medals and more than 6 gold medals?
SELECT AVG(rank) FROM table_name_9 WHERE total > 5 AND gold > 6
sql_create_context
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ...
i'm curious as to how many hours have passed since patient 1902's last intake of d5ns on the current intensive care unit visit?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', inputevents_cv.charttime)) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1902) AND icustays.outtime IS NULL) ...
mimic_iii
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airli...
can you give me the evening flight on wednesday from WASHINGTON to ATLANTA again
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 = 'ATLANTA' AND date_day.day_number = 23 AND date_day.month_number = 4 AND ...
atis
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...
what is drug type of drug name olanzapine (disintegrating tablet)?
SELECT prescriptions.drug_type FROM prescriptions WHERE prescriptions.drug = "Olanzapine (Disintegrating Tablet)"
mimicsql_data
CREATE TABLE table_74758 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What venue featured a crowd of over 30,000?
SELECT "Venue" FROM table_74758 WHERE "Crowd" > '30,000'
wikisql
CREATE TABLE table_22953 ( "Name" text, "Date of construction" text, "Builder" text, "Date of destruction" text, "Cause of destruction" text, "Modern location" text )
How was the Temple of Artemis at Ephesus destroyed?
SELECT "Cause of destruction" FROM table_22953 WHERE "Name" = 'Temple of Artemis at Ephesus'
wikisql
CREATE TABLE table_29870 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Who had the most points and how many did they have in game 11?
SELECT "High points" FROM table_29870 WHERE "Game" = '11'
wikisql
CREATE TABLE table_26708105_2 ( occurrence INTEGER, matrix_sim VARCHAR )
What occurence has 0.925 listed as the matrix sim?
SELECT MAX(occurrence) FROM table_26708105_2 WHERE matrix_sim = "0.925"
sql_create_context
CREATE TABLE table_name_52 ( week INTEGER, result VARCHAR )
What Week has a Result of l 17-14?
SELECT SUM(week) FROM table_name_52 WHERE result = "l 17-14"
sql_create_context
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...
provide the number of patients who are widowed and their lab test item id is 50924.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "WIDOWED" AND lab.itemid = "50924"
mimicsql_data
CREATE TABLE table_204_532 ( id number, "season" text, "tier" number, "division" text, "place" text )
the 2001/2002 season and the 1999/2000 season both resulted in what place for this team ?
SELECT "place" FROM table_204_532 WHERE "season" = '2001/02'
squall
CREATE TABLE table_47491 ( "Game" real, "November" real, "Opponent" text, "Score" text, "Decision" text, "Record" text )
What is the Score of the game with a decision of Lundqvist, the November less than 28, and opponent was Boston Bruins?
SELECT "Score" FROM table_47491 WHERE "Decision" = 'lundqvist' AND "November" < '28' AND "Opponent" = 'boston bruins'
wikisql
CREATE TABLE gwyjzb ( 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, ...
从二零零五年五月二十一日到二零零七年十一月二十九日这段时间里,参保人秦惜玉的哪些结算次数是10元以内的小金额,把次数查询一下
SELECT COUNT(*) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '秦惜玉' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2005-05-21' AND '2007-11-29' AND t_kc24.MED_AMOUT <= 10 UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE fgwyjzb.P...
css
CREATE TABLE table_2780 ( "No." real, "#" real, "Title" text, "Directed by" text, "Written by" text, "U.S. viewers (million)" text, "Rank (week)" real, "Original air date" text )
What was the week ranking of the episode written by Thomas L. Moran and directed by Andrew Bernstein?
SELECT "Rank (week)" FROM table_2780 WHERE "Written by" = 'Thomas L. Moran' AND "Directed by" = 'Andrew Bernstein'
wikisql
CREATE TABLE table_48054 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time" text, "Grid" real )
With a Time of +1:37.055, which has the lowest Grid?
SELECT MIN("Grid") FROM table_48054 WHERE "Time" = '+1:37.055'
wikisql
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId numb...
Questions and answers per month.
SELECT DATEADD(month, DATEDIFF(month, 0, CreationDate), 0) AS "month", CASE WHEN p.PostTypeId = 1 THEN 'Q' ELSE 'A' END AS PostType, COUNT(*) AS Count FROM Posts AS p WHERE p.PostTypeId IN (1, 2) AND DATEDIFF(month, CreationDate, GETDATE()) > 0 GROUP BY DATEADD(month, DATEDIFF(month, 0, CreationDate), 0), p.PostTypeId ...
sede