context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
what was the total hospital bill of patient 003-17096's stay in this year?
SELECT SUM(cost.cost) FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '003-17096') AND DATETIME(cost.chargetime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')
eicu
CREATE TABLE table_6791 ( "Date" text, "Time" text, "Score" text, "Set 1" text, "Set 2" text, "Set 3" text, "Set 4" text, "Total" text, "Report" text )
What is the Report for 08 jul, and a Score of 3 1?
SELECT "Report" FROM table_6791 WHERE "Date" = '08 jul' AND "Score" = '3–1'
wikisql
CREATE TABLE exhibition_record ( Exhibition_ID int, Date text, Attendance int ) CREATE TABLE exhibition ( Exhibition_ID int, Year int, Theme text, Artist_ID int, Ticket_Price real ) CREATE TABLE artist ( Artist_ID int, Name text, Country text, Year_Join int, Age int...
How many exhibitions has each artist had Plot them as bar chart, and display from high to low by the Y-axis.
SELECT Name, COUNT(*) FROM exhibition AS T1 JOIN artist AS T2 ON T1.Artist_ID = T2.Artist_ID GROUP BY T1.Artist_ID ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_37500 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
What was the result of the game after week 3 against the New York Giants?
SELECT "Result" FROM table_37500 WHERE "Week" > '3' AND "Opponent" = 'new york giants'
wikisql
CREATE TABLE table_name_37 ( player VARCHAR, place VARCHAR, score VARCHAR )
who is the player when the place is t10 and the score is 67-72-72=211?
SELECT player FROM table_name_37 WHERE place = "t10" AND score = 67 - 72 - 72 = 211
sql_create_context
CREATE TABLE table_204_109 ( id number, "district" text, "incumbent" text, "party" text, "first\nelected" text, "result" text, "candidates" text )
name the only candidate that was first elected in 1811 .
SELECT "incumbent" FROM table_204_109 WHERE "first\nelected" = 1811
squall
CREATE TABLE mission ( Mission_ID int, Ship_ID int, Code text, Launched_Year int, Location text, Speed_knots int, Fate text ) CREATE TABLE ship ( Ship_ID int, Name text, Type text, Nationality text, Tonnage int )
What is the total number of ships with different nationalities and ship types?
SELECT Nationality, COUNT(Nationality) FROM ship GROUP BY Type, Nationality
nvbench
CREATE TABLE table_36458 ( "Name" text, "GP-GS" real, "Gain" real, "Loss" real, "Long" real, "Avg/G" real )
What is the average Long that has a GP-GS less than 14, a AVg/G less than 0.8 and a Gain less than 3 and a Loss greater than 8?
SELECT AVG("Long") FROM table_36458 WHERE "GP-GS" < '14' AND "Avg/G" < '0.8' AND "Gain" < '3' AND "Loss" > '8'
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...
日期均在2013年8月27日之前患者喻鸿达在哪些门诊就诊记录对应的检验报告单的报告?列出门诊就诊流水号是啥?
SELECT wdmzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN wdmzjzjlb 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 WHERE person_info.XM = '喻鸿达' AND NOT wdmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2013-08-2...
css
CREATE TABLE table_31725 ( "Number" real, "Origin" text, "Final destination" text, "Frequency" text, "Distance" text )
What is the frequency of number 3 with a bus station origin?
SELECT "Frequency" FROM table_31725 WHERE "Origin" = 'bus station' AND "Number" = '3'
wikisql
CREATE TABLE table_name_46 ( college_country_team VARCHAR, former_wnba_team VARCHAR )
What was the college team of the player whose former WNBA team was the Cleveland Rockers?
SELECT college_country_team FROM table_name_46 WHERE former_wnba_team = "cleveland rockers"
sql_create_context
CREATE TABLE table_43973 ( "Player" text, "Nationality" text, "Jersey Number(s)" real, "Position" text, "Years" text, "From" text )
Who is the player with a Jersey Number(s) greater than 30?
SELECT "Player" FROM table_43973 WHERE "Jersey Number(s)" > '30'
wikisql
CREATE TABLE table_30740 ( "Region Represented" text, "First Place" real, "Second Place" real, "Third Place" real, "Total Top 3 Placements" real, "First Place Winning Year(s) (if applicable)" text )
What is the maximum number of 1st places for the country with exactly 1 third place?
SELECT MAX("First Place") FROM table_30740 WHERE "Third Place" = '1'
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...
how many patients whose primary disease is s/p fall and admission year is less than 2178?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "S/P FALL" AND demographic.admityear < "2178"
mimicsql_data
CREATE TABLE table_21947 ( "Actor in original production" text, "Actor required" text, "GamePlan" text, "FlatSpin" text, "RolePlay" text )
What RolePlay actor played the same role Alison Pargeter played in the original production?
SELECT "RolePlay" FROM table_21947 WHERE "Actor in original production" = 'Alison Pargeter'
wikisql
CREATE TABLE table_name_57 ( event VARCHAR, athlete VARCHAR, result VARCHAR )
What event did Sjerstin Vermeulen receive a 66.452 result?
SELECT event FROM table_name_57 WHERE athlete = "sjerstin vermeulen" AND result = "66.452"
sql_create_context
CREATE TABLE table_name_13 ( genes VARCHAR, species VARCHAR, base_pairs VARCHAR )
How many genes are in species burkholderia pseudomallei with 4,126,292 base pairs?
SELECT genes FROM table_name_13 WHERE species = "burkholderia pseudomallei" AND base_pairs = "4,126,292"
sql_create_context
CREATE TABLE table_72225 ( "Member" text, "Week Arrived On Main Island" text, "Week Sent To Third Island" text, "Original Tribe" text, "Tribe They Chose To Win" text )
What week was the member who arrived on the main island in week 6 sent to the third island?
SELECT "Week Sent To Third Island" FROM table_72225 WHERE "Week Arrived On Main Island" = '6'
wikisql
CREATE TABLE table_name_97 ( developer VARCHAR, publisher VARCHAR )
Who does Rockstar Games use as a developer?
SELECT developer FROM table_name_97 WHERE publisher = "rockstar games"
sql_create_context
CREATE TABLE table_name_61 ( spouse VARCHAR, death VARCHAR )
What is the Spouse of the Duchess that has a Death on 6 april 1780?
SELECT spouse FROM table_name_61 WHERE death = "6 april 1780"
sql_create_context
CREATE TABLE table_train_199 ( "id" int, "t2dm" bool, "hemoglobin_a1c_hba1c" float, "renal_disease" bool, "diabetic" string, "hypoglycemia" bool, "diabetes" bool, "seizure_disorder" bool, "glaucoma" bool, "hypertension" bool, "age" float, "NOUSE" float )
patients with renal disease not caused by diabetes or hypertension.
SELECT * FROM table_train_199 WHERE renal_disease = 1 AND (diabetes = 0 AND hypertension = 0)
criteria2sql
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_DIRE_CD text, MED_DIRE_NM text,...
根据不一样的科室名计算出3519389这家医院全部诊疗记录里,统筹基金与医疗总费用平均的比值
SELECT t_kc21.MED_ORG_DEPT_NM, AVG(t_kc24.OVE_PAY) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '3519389' GROUP BY t_kc21.MED_ORG_DEPT_NM
css
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 lab ( subject_id text, hadm_id text, ...
give me the number of patients whose marital status is married and ethnicity is asian
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.ethnicity = "ASIAN"
mimicsql_data
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
不知道患有血管性痴呆的人有多少
SELECT COUNT(gwyjzb.PERSON_ID) FROM gwyjzb WHERE gwyjzb.IN_DIAG_DIS_NM = '血管性痴呆' UNION SELECT COUNT(fgwyjzb.PERSON_ID) FROM fgwyjzb WHERE fgwyjzb.IN_DIAG_DIS_NM = '血管性痴呆'
css
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS va...
For those employees who was hired before 2002-06-21, for commission_pct, hire_date, visualize the trend, and order from low to high by the X-axis.
SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY HIRE_DATE
nvbench
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE com...
Which prerequisite for most classes can I take this semester ?
SELECT COUNT(DISTINCT COURSE_PREREQUISITEalias0.course_id), COURSEalias0.department, COURSEalias0.name, COURSEalias0.number FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course AS COURSEalias1, course_offering AS COURSE_OFFERINGali...
advising
CREATE TABLE table_54284 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the total medals Austria and those with larger than rank 4 have?
SELECT COUNT("Total") FROM table_54284 WHERE "Nation" = 'austria' AND "Rank" > '4'
wikisql
CREATE TABLE table_11303072_9 ( stumpings VARCHAR, player VARCHAR )
How many stumpings has Paul Nixon in his career?
SELECT stumpings FROM table_11303072_9 WHERE player = "Paul Nixon"
sql_create_context
CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_p...
For ULCS does COMP 425 count ?
SELECT COUNT(*) > 0 FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.department = 'COMP' AND course.number = 425 AND program_course.category LIKE '%ULCS%'
advising
CREATE TABLE table_name_68 ( pro_debut VARCHAR, tournaments VARCHAR, highest_rank VARCHAR )
What is Pro Debut, when Tournament is greater than 11, and when Highest Rank is 'Maegashira 1'?
SELECT pro_debut FROM table_name_68 WHERE tournaments > 11 AND highest_rank = "maegashira 1"
sql_create_context
CREATE TABLE table_43129 ( "Rank" real, "Name" text, "Years" text, "Matches" real, "Goals" real )
When Oscar M guez had over 107 goals, what was the lowest he ranked?
SELECT MIN("Rank") FROM table_43129 WHERE "Name" = 'oscar míguez' AND "Goals" > '107'
wikisql
CREATE TABLE txmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
列出在医院2926207中患者45461281门诊诊断名称不包含硅肺有哪些门诊就诊记录?
SELECT * FROM hz_info JOIN txmzjzjlb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE hz_info.RYBH = '45461281' AND hz_info.YLJGDM = '2926207' AND NOT txmzjzjlb.JZZDSM LIKE '%硅肺%' UNION SELECT * FROM hz_info JOIN ftxmzjzjlb ON hz_info.YLJGDM = ftxmzjzjlb.YLJGDM AN...
css
CREATE TABLE table_203_661 ( id number, "year" number, "single" text, "peak chart positions\nus mod" number, "peak chart positions\nuk" number, "album" text )
what was the average chart position of their singles in the uk ?
SELECT AVG("peak chart positions\nuk") FROM table_203_661
squall
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 medication ( medi...
when was patient 009-3149 last prescribed a medicine via the ng route in 09/this year?
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 = '009-3149')) AND medication.routeadmin = 'ng' AND DATETIME(medi...
eicu
CREATE TABLE table_50225 ( "Department" text, "Micro (10ha)" real, "Small (100ha)" real, "Medium (500ha)" real, "Big (>500ha)" real, "Total" real )
How much Micro (10ha) has a Big (>500ha) larger than 63,454, and a Medium (500ha) larger than 440, and a Small (100ha) smaller than 21,047?
SELECT COUNT("Micro (10ha)") FROM table_50225 WHERE "Big (>500ha)" > '63,454' AND "Medium (500ha)" > '440' AND "Small (100ha)" < '21,047'
wikisql
CREATE TABLE table_name_12 ( total INTEGER, country VARCHAR, player VARCHAR )
Which Total has a Country of united states, and a Player of andy north?
SELECT AVG(total) FROM table_name_12 WHERE country = "united states" AND player = "andy north"
sql_create_context
CREATE TABLE table_name_37 ( team__number2 VARCHAR )
What is the 1st leg that has akasvayu girona as team #2?
SELECT 1 AS st_leg FROM table_name_37 WHERE team__number2 = "akasvayu girona"
sql_create_context
CREATE TABLE table_6277 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Attendance" real )
When was the earliest that New England Patriots played?
SELECT MIN("Week") FROM table_6277 WHERE "Opponent" = 'new england patriots'
wikisql
CREATE TABLE table_31203 ( "Skip (Club)" text, "W" real, "L" real, "PF" real, "PA" real, "Ends Won" real, "Ends Lost" real, "Blank Ends" real, "Stolen Ends" real )
Which skip (club) had 28 PA?
SELECT "Skip (Club)" FROM table_31203 WHERE "PA" = '28'
wikisql
CREATE TABLE county_public_safety ( County_ID int, Name text, Population int, Police_officers int, Residents_per_officer int, Case_burden int, Crime_rate real, Police_force text, Location text ) CREATE TABLE city ( City_ID int, County_ID int, Name text, White real, ...
Display a bar chart for how many counties correspond to each police force?
SELECT Police_force, COUNT(*) FROM county_public_safety GROUP BY Police_force
nvbench
CREATE TABLE table_4787 ( "Year" real, "BB Pop" text, "BB CW" text, "BB EL" text, "CB CW" text, "RIAA" text )
What is the CB CW of the song which has a BB Pop of 11?
SELECT "CB CW" FROM table_4787 WHERE "BB Pop" = '11'
wikisql
CREATE TABLE table_name_91 ( webcast VARCHAR, callsign VARCHAR )
Which Webcast has a Callsign of kgbt?
SELECT webcast FROM table_name_91 WHERE callsign = "kgbt"
sql_create_context
CREATE TABLE table_29626583_1 ( position VARCHAR, affiliation VARCHAR )
What is the position for the university of north carolina carolina dynamo affiliation
SELECT position FROM table_29626583_1 WHERE affiliation = "University of North Carolina Carolina Dynamo"
sql_create_context
CREATE TABLE table_4772 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the average crowd size when the home team scored 9.20 (74)?
SELECT AVG("Crowd") FROM table_4772 WHERE "Home team score" = '9.20 (74)'
wikisql
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses_icd ( row...
had any medication been prescribed to patient 73713 since 09/2102?
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 73713) AND STRFTIME('%y-%m', prescriptions.startdate) >= '2102-09'
mimic_iii
CREATE TABLE table_22754491_1 ( margin VARCHAR, constituency VARCHAR )
What is the margin when periyakulam is the constituency?
SELECT margin FROM table_22754491_1 WHERE constituency = "Periyakulam"
sql_create_context
CREATE TABLE table_65166 ( "Album#" text, "English Title" text, "Chinese (Traditional)" text, "Chinese (Simplified)" text, "Release date" text, "Label" text )
What traditional Chinese name would the Rock Records release Grown up Overnight be given?
SELECT "Chinese (Traditional)" FROM table_65166 WHERE "Label" = 'rock records' AND "English Title" = 'grown up overnight'
wikisql
CREATE TABLE table_name_5 ( score VARCHAR, game VARCHAR )
What was the score of game 2?
SELECT score FROM table_name_5 WHERE game = 2
sql_create_context
CREATE TABLE customer ( customer_id SMALLINT UNSIGNED, store_id TINYINT UNSIGNED, first_name VARCHAR(45), last_name VARCHAR(45), email VARCHAR(50), address_id SMALLINT UNSIGNED, active BOOLEAN, create_date DATETIME, last_update TIMESTAMP ) CREATE TABLE address ( address_id SMALL...
A line chart for what are the number of the payment dates for any payments that have an amount greater than 10 or were handled by a staff member with the first name Elsa?
SELECT payment_date, COUNT(payment_date) FROM payment WHERE amount > 10 UNION SELECT T1.payment_date FROM payment AS T1 JOIN staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = 'Elsa' GROUP BY payment_date
nvbench
CREATE TABLE table_15344 ( "Sydney" text, "Melbourne" text, "Perth" text, "Adelaide" text, "Gold Coast" text, "Auckland" text )
Which gold Coast has a Melbourne of yes, a Perth of yes, an Auckland of no, and a Sydney of no?
SELECT "Gold Coast" FROM table_15344 WHERE "Melbourne" = 'yes' AND "Perth" = 'yes' AND "Auckland" = 'no' AND "Sydney" = 'no'
wikisql
CREATE TABLE table_name_39 ( attendance INTEGER, score VARCHAR )
How many people went to the game that had 17-13?
SELECT SUM(attendance) FROM table_name_39 WHERE score = "17-13"
sql_create_context
CREATE TABLE table_25476 ( "Date" text, "Location" text, "Opponent" text, "Irish Points" real, "Opp. Points" real, "Record" text )
Name the max irish points for eastern michigan
SELECT MAX("Irish Points") FROM table_25476 WHERE "Opponent" = 'Eastern Michigan'
wikisql
CREATE TABLE procedures ( 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 ) ...
let me know the number of government insurance patients who underwent percutaneous (endoscopic) jejunostomy.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.short_title = "Percu endosc jejunostomy"
mimicsql_data
CREATE TABLE table_name_87 ( date VARCHAR, record VARCHAR )
What is the Date with a Record that is 7.39?
SELECT date FROM table_name_87 WHERE record = "7.39"
sql_create_context
CREATE TABLE fgwyjzb ( 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, ...
从2019年4月10日开始到2019年4月22日结束的这段时间患者86828604被开出盐酸帕罗西汀片统共有多少次?
SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '86828604' AND t_kc22.STA_DATE BETWEEN '2019-04-10' AND '2019-04-22' AND t_kc22.SOC_SRT_DIRE_NM = '盐酸帕罗西汀片' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE...
css
CREATE TABLE table_name_57 ( livery VARCHAR, date VARCHAR )
Which livery is from 1919?
SELECT livery FROM table_name_57 WHERE date = "1919"
sql_create_context
CREATE TABLE table_53336 ( "Release format" text, "Country" text, "Label" text, "Cat. No." text, "Release date" real )
Which label is from Spain?
SELECT "Label" FROM table_53336 WHERE "Country" = 'spain'
wikisql
CREATE TABLE table_64056 ( "TV Station (Operator)" text, "2005" real, "2006" real, "2007" real, "2008" real, "2009" real, "2010" real, "2011 1H" real )
What's the 2006 if there's less than 6.7 in 2007 and less than 3.4 in 2009?
SELECT SUM("2006") FROM table_64056 WHERE "2007" < '6.7' AND "2009" < '3.4'
wikisql
CREATE TABLE table_16119656_1 ( date VARCHAR, attendance INTEGER )
When was the game played if the attendance is less than 6427.0?
SELECT date FROM table_16119656_1 WHERE attendance < 6427.0
sql_create_context
CREATE TABLE table_2357 ( "Sd" real, "Player" text, "Points" real, "Points defending" real, "Points won" real, "New points" real, "Status" text )
How many points did shahar pe'er score?
SELECT "Points won" FROM table_2357 WHERE "Player" = 'Shahar Pe''er'
wikisql
CREATE TABLE table_28534 ( "Institution" text, "Location (Population)" text, "Founded" real, "Type" text, "Enrollment" real, "Nickname (Colors)" text, "Football?" text )
What year was the institution of St. Catharine College founded?
SELECT MIN("Founded") FROM table_28534 WHERE "Institution" = 'St. Catharine College'
wikisql
CREATE TABLE table_64096 ( "Wrestlers" text, "Reign" text, "Days held" text, "Location" text, "Event" text )
What days held has 1 as the reign with eden black as the wrestlers?
SELECT "Days held" FROM table_64096 WHERE "Reign" = '1' AND "Wrestlers" = 'eden black'
wikisql
CREATE TABLE table_204_157 ( id number, "date" text, "opponent#" text, "rank#" text, "site" text, "result" text )
name one team below rank 2
SELECT "opponent#" FROM table_204_157 WHERE "rank#" > 2
squall
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
按照出院诊断时的疾病编码,患有不同的疾病的患者在医院0584187中的平均年龄是多些?
SELECT OUT_DIAG_DIS_CD, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '0584187' GROUP BY OUT_DIAG_DIS_CD
css
CREATE TABLE table_10015132_2 ( nationality VARCHAR, player VARCHAR )
What nationality is the player Muggsy Bogues?
SELECT nationality FROM table_10015132_2 WHERE player = "Muggsy Bogues"
sql_create_context
CREATE TABLE table_54751 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What away team plays at Victoria Park?
SELECT "Away team" FROM table_54751 WHERE "Venue" = 'victoria park'
wikisql
CREATE TABLE table_10470082_5 ( no VARCHAR, villains VARCHAR )
How many have Mrs. briar as a villain
SELECT COUNT(no) FROM table_10470082_5 WHERE villains = "Mrs. Briar"
sql_create_context
CREATE TABLE table_28490105_1 ( supporting VARCHAR, gt_winning_car VARCHAR, rnd VARCHAR )
Who was supporting in round 1 where the gt winning car was dodge viper?
SELECT supporting FROM table_28490105_1 WHERE gt_winning_car = "Dodge Viper" AND rnd = 1
sql_create_context
CREATE TABLE time_slot ( time_slot_id varchar(4), day varchar(1), start_hr numeric(2), start_min numeric(2), end_hr numeric(2), end_min numeric(2) ) CREATE TABLE takes ( ID varchar(5), course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0), grade...
How many courses with more than one prerequisite for each title? Return a bar chart, and sort in ascending by the total number.
SELECT title, COUNT(title) FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY title ORDER BY COUNT(title)
nvbench
CREATE TABLE table_name_64 ( builder VARCHAR, number VARCHAR )
Name the builder for number 3
SELECT builder FROM table_name_64 WHERE number = 3
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...
give me the number of patients whose insurance is medicaid and admission year is less than 2105?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Medicaid" AND demographic.admityear < "2105"
mimicsql_data
CREATE TABLE table_name_98 ( drawn VARCHAR, points_for VARCHAR )
How many draws does the team with 385 points for have?
SELECT drawn FROM table_name_98 WHERE points_for = "385"
sql_create_context
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, ...
how many patients born before the year 2123 had lab test named immunoglobulin a?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2123" AND lab.label = "Immunoglobulin A"
mimicsql_data
CREATE TABLE table_2562572_53 ( population__2011_ VARCHAR, cyrillic_name VARCHAR )
What was the population of in 2011?
SELECT COUNT(population__2011_) FROM table_2562572_53 WHERE cyrillic_name = "Сурдук"
sql_create_context
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 job_history ( EMPLO...
For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a bar chart about the distribution of hire_date and the average of department_id bin hire_date by weekday, could you display by the Y from high to low please?
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY AVG(DEPARTMENT_ID) DESC
nvbench
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,...
how many patients had procedure icd9 code 3607?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.icd9_code = "3607"
mimicsql_data
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 inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
calculate the four year survival rate among the patients who were prescribed clopidogrel bisulfate after they were diagnosed with kidney laceration-open.
SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 4 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd...
mimic_iii
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 diagnosis ( diagn...
how many patient have died after they were diagnosed with signs and symptoms of sepsis (sirs) during the same hospital encounter in 2104?
SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT t1.uniquepid, t1.diagnosistime, t1.patienthealthsystemstayid FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = ...
eicu
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospit...
is there any organisms present in patient 031-3507's first stool microbiology test on their last hospital visit?
SELECT COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-3507' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi...
eicu
CREATE TABLE artist ( artistid number, name text ) CREATE TABLE album ( albumid number, title text, artistid number ) CREATE TABLE invoiceline ( invoicelineid number, invoiceid number, trackid number, unitprice number, quantity number ) CREATE TABLE customer ( customerid n...
Which artist does the album 'Balls to the Wall' belong to?
SELECT T2.name FROM album AS T1 JOIN artist AS T2 ON T1.artistid = T2.artistid WHERE T1.title = "Balls to the Wall"
spider
CREATE TABLE table_2018 ( "Pos" real, "No" real, "Driver" text, "Constructor" text, "Q1 order" real, "Q1 time" text, "Q1 pos" real, "Q1+Q2 time" text )
When the q1 time is 1:16.218 what is the highest q1 pos?
SELECT MAX("Q1 pos") FROM table_2018 WHERE "Q1 time" = '1:16.218'
wikisql
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId nu...
Questions by new (low rep) users (2018).
SELECT q.Id AS "post_link", OwnerUserId AS "user_link", Reputation, Score, q.CreationDate FROM Posts AS q JOIN Users AS u ON OwnerUserId = u.Id WHERE YEAR(q.CreationDate) = 2018 AND PostTypeId = 1 AND Reputation <= 200 ORDER BY q.CreationDate DESC
sede
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE Tags ( Id number, TagName text, Count num...
View the reputations rank for Estonian users.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%estonia%' OR UPPER(Location) LIKE '%ee' ORDER BY Reputation DESC
sede
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetake...
give me the total amount of patient 022-82169's input until 448 days ago?
SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-82169')) AND intakeoutput.cellpath LIKE '%in...
eicu
CREATE TABLE table_63912 ( "Year" text, "Total Support and Revenue" text, "Total Expenses" text, "Increase in Net Assets" text, "Net Assets at End of Year" text )
What increase in net assets also has $5,617,236 as the total expenses?
SELECT "Increase in Net Assets" FROM table_63912 WHERE "Total Expenses" = '$5,617,236'
wikisql
CREATE TABLE table_1612760_1 ( operator VARCHAR, destination VARCHAR )
Who is the operator to destination Dalston Junction?
SELECT operator FROM table_1612760_1 WHERE destination = "Dalston Junction"
sql_create_context
CREATE TABLE table_70358 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Location" text )
In the match against Masahiro Oishi, what was the record?
SELECT "Record" FROM table_70358 WHERE "Opponent" = 'masahiro oishi'
wikisql
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 d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE procedures_icd ( ...
what is the cost of a medication named morphine sulfate sr?
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'prescriptions' AND cost.event_id IN (SELECT prescriptions.row_id FROM prescriptions WHERE prescriptions.drug = 'morphine sulfate sr')
mimic_iii
CREATE TABLE table_30011_2 ( reference VARCHAR, type_and_usage VARCHAR )
What is every reference for type and usage of Germanium small-signal RF transistor?
SELECT reference FROM table_30011_2 WHERE type_and_usage = "Germanium small-signal RF transistor"
sql_create_context
CREATE TABLE table_name_38 ( decile VARCHAR, area VARCHAR )
WHat is the decile of the school in Purua?
SELECT decile FROM table_name_38 WHERE area = "purua"
sql_create_context
CREATE TABLE table_47024 ( "Branding" text, "Callsign" text, "Frequency" text, "Power (kW)" text, "Location" text )
What is the Power (kW) for the station with a frequency of 95.1mhz?
SELECT "Power (kW)" FROM table_47024 WHERE "Frequency" = '95.1mhz'
wikisql
CREATE TABLE table_202_276 ( id number, "year 1958" text, "title {the rebel" text, "role" text, "notes" text )
which role did victor buono play in surfside 6 ?
SELECT "role" FROM table_202_276 WHERE "title {the rebel" = 'surfside 6'
squall
CREATE TABLE table_41762 ( "Lane" real, "Name" text, "Country" text, "Mark" text, "React" real )
What is the lowest lane for Nigeria, with a react less than 0.133?
SELECT MIN("Lane") FROM table_41762 WHERE "Country" = 'nigeria' AND "React" < '0.133'
wikisql
CREATE TABLE table_61453 ( "Date" text, "Tournament" text, "Surface" text, "Partnering" text, "Opponent in the final" text, "Score" text )
which Score has a Partnering of dmitry tursunov?
SELECT "Score" FROM table_61453 WHERE "Partnering" = 'dmitry tursunov'
wikisql
CREATE TABLE procedures ( 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 ) ...
what is the number of patients who have been daignosed with status-post ptca and dialys as the drug route?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Status-post ptca" AND prescriptions.route = "DIALYS"
mimicsql_data
CREATE TABLE table_name_93 ( ihsaa_football_class VARCHAR, location VARCHAR )
What is the IHSAA Football class at Culver?
SELECT ihsaa_football_class FROM table_name_93 WHERE location = "culver"
sql_create_context
CREATE TABLE zyjybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH number, 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, ...
在08年1月31日到11年3月15日这三年里,患者58099146有什么检验结果指标记录中的仪器编号以及名称?
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = ...
css
CREATE TABLE table_name_29 ( genre VARCHAR, year VARCHAR )
What genre is the game from the year 2007?
SELECT genre FROM table_name_29 WHERE year = 2007
sql_create_context
CREATE TABLE table_65786 ( "Draw" real, "Language" text, "Song" text, "English translation" text, "Place" real, "Points" real )
What's the language of Draw number 9?
SELECT "Language" FROM table_65786 WHERE "Draw" = '9'
wikisql
CREATE TABLE table_name_90 ( name VARCHAR, round VARCHAR, circuit VARCHAR )
Who won Silverstone in a round after 10?
SELECT name FROM table_name_90 WHERE round > 10 AND circuit = "silverstone"
sql_create_context