context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_94 ( score VARCHAR, tournament VARCHAR )
What is the Score of the Pingguo Tournament?
SELECT score FROM table_name_94 WHERE tournament = "pingguo"
sql_create_context
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
A bar chart shows the distribution of All_Home and the amount of All_Home , and group by attribute All_Home, and I want to rank in ascending by the Y-axis.
SELECT All_Home, COUNT(All_Home) FROM basketball_match GROUP BY All_Home ORDER BY COUNT(All_Home)
nvbench
CREATE TABLE table_18365784_3 ( departure VARCHAR, going_to VARCHAR )
What was the departure time of the train going to Boston?
SELECT departure FROM table_18365784_3 WHERE going_to = "Boston"
sql_create_context
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
在0七年四月七日到一六年十一月十八日这段时间内,医院2962064看病的病人共有多少
SELECT COUNT(*) FROM qtb WHERE qtb.MED_SER_ORG_NO = '2962064' AND qtb.IN_HOSP_DATE BETWEEN '2007-04-07' AND '2016-11-18' UNION SELECT COUNT(*) FROM gyb WHERE gyb.MED_SER_ORG_NO = '2962064' AND gyb.IN_HOSP_DATE BETWEEN '2007-04-07' AND '2016-11-18' UNION SELECT COUNT(*) FROM zyb WHERE zyb.MED_SER_ORG_NO = '2962064' AND ...
css
CREATE TABLE table_name_97 ( location VARCHAR, event VARCHAR )
What's the location of the National event?
SELECT location FROM table_name_97 WHERE event = "the national"
sql_create_context
CREATE TABLE table_50684 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "TV Time" text, "Attendance" real )
Who is the opponent in week 15?
SELECT "Opponent" FROM table_50684 WHERE "Week" = '15'
wikisql
CREATE TABLE Projects ( Project_ID INTEGER, Project_Details VARCHAR(255) ) CREATE TABLE Statements ( Statement_ID INTEGER, Statement_Details VARCHAR(255) ) CREATE TABLE Ref_Budget_Codes ( Budget_Type_Code CHAR(15), Budget_Type_Description VARCHAR(255) ) CREATE TABLE Documents ( Document_I...
How many documents are there of each type. Show bar chart.
SELECT Document_Type_Code, COUNT(*) FROM Documents GROUP BY Document_Type_Code
nvbench
CREATE TABLE table_204_852 ( id number, "year" number, "film" text, "language" text, "character" text, "co-star" text, "music" text, "banner" text )
how many films were done before the 1950s ?
SELECT COUNT("film") FROM table_204_852 WHERE "year" < 1950
squall
CREATE TABLE table_name_44 ( crowd VARCHAR, venue VARCHAR )
What was the attendance when the VFL played Lake Oval?
SELECT COUNT(crowd) FROM table_name_44 WHERE venue = "lake oval"
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 whose diagnoses long title is other pulmonary embolism and infarction and drug route is po?
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.long_title = "Other pulmonary embolism and infarction" AND prescriptions.route = "PO"
mimicsql_data
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 microlab ( microlabid number, ...
when was the first procedure patient 006-157753 had on this hospital encounter?
SELECT 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 = '006-157753' AND patient.hospitaldischargetime IS NULL)) ORDER BY ...
eicu
CREATE TABLE phone ( Carrier VARCHAR, Memory_in_G INTEGER )
Show the carriers that have both phones with memory smaller than 32 and phones with memory bigger than 64.
SELECT Carrier FROM phone WHERE Memory_in_G < 32 INTERSECT SELECT Carrier FROM phone WHERE Memory_in_G > 64
sql_create_context
CREATE TABLE table_name_31 ( name VARCHAR, number VARCHAR, type VARCHAR )
What is the name of the bo-bodh train with a number less than 5?
SELECT name FROM table_name_31 WHERE number < 5 AND type = "bo-bodh"
sql_create_context
CREATE TABLE table_58736 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Pts." text )
What year has 54 (73) points?
SELECT SUM("Year") FROM table_58736 WHERE "Pts." = '54 (73)'
wikisql
CREATE TABLE table_name_88 ( previous_conference VARCHAR, size VARCHAR, location VARCHAR )
What's the previous conference of Fountain City with a size more than 287?
SELECT previous_conference FROM table_name_88 WHERE size > 287 AND location = "fountain city"
sql_create_context
CREATE TABLE table_name_20 ( team_1 VARCHAR, team_2 VARCHAR )
What is the team 1 with cementarnica as team 2?
SELECT team_1 FROM table_name_20 WHERE team_2 = "cementarnica"
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, ...
病患76177334在08年7月12日到09年7月19日内的全部检测结果指标记录的检查员为39427347的检验指标流水号是多少?
SELECT jyjgzbb.JYZBLSH 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 = jyjgzbb.BGD...
css
CREATE TABLE customers ( customer_id number, payment_method text, customer_name text, date_became_customer time, other_customer_details text ) CREATE TABLE customer_orders ( order_id number, customer_id number, order_status text, order_date time, order_details text ) CREATE TAB...
What are the names of customers who never made an order.
SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id
spider
CREATE TABLE table_name_72 ( assists INTEGER, games INTEGER )
Which player has the fewest assists and played 2 games or fewer?
SELECT MIN(assists) FROM table_name_72 WHERE games < 2
sql_create_context
CREATE TABLE table_26794530_1 ( poles INTEGER )
What is the highest number of poles?
SELECT MAX(poles) FROM table_26794530_1
sql_create_context
CREATE TABLE table_11997 ( "Date" text, "Round" text, "Attendance" text, "Opposition" text, "Stadium" text )
When was the opposition sydney fc on round 19?
SELECT "Date" FROM table_11997 WHERE "Opposition" = 'sydney fc' AND "Round" = 'round 19'
wikisql
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE inputevents_cv ( row_i...
what are the four most frequently given laboratory tests for patients who have previously received destruct chest wall les within the same month until 2104?
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, 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_i...
mimic_iii
CREATE TABLE table_66853 ( "Round" text, "Fixtures" real, "Clubs" text, "New entries" text, "Leagues entering" text )
What is the Round when the value for Fixtures is 2?
SELECT "Round" FROM table_66853 WHERE "Fixtures" = '2'
wikisql
CREATE TABLE table_name_71 ( city_of_license VARCHAR, callsign VARCHAR )
In which city is the network with the callsign kgns-dt3 licensed?
SELECT city_of_license FROM table_name_71 WHERE callsign = "kgns-dt3"
sql_create_context
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, ...
what is insurance and primary disease of subject id 2560?
SELECT demographic.insurance, demographic.diagnosis FROM demographic WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE table_203_686 ( id number, "release date" text, "album" text, "record label" text, "uk albums chart" number, "u.s. billboard 200 chart" number )
which album has the record label i.r.s records , eye of the hurricane or compact hits ?
SELECT "album" FROM table_203_686 WHERE "album" IN ('eye of the hurricane', 'compact hits') AND "record label" = 'i.r.s. records'
squall
CREATE TABLE table_14390413_1 ( team VARCHAR )
Name the 1991-1992 for river plate
SELECT 1991 AS _1992 FROM table_14390413_1 WHERE team = "River Plate"
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, ...
58661647患者被门诊诊断为疾病I06.952的降钙素原的结果定量是什么?单位都是什么?
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON 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_MZJZJLB AND jybgb.YLJGDM...
css
CREATE TABLE table_name_1 ( matches INTEGER, drawn VARCHAR, win__percentage VARCHAR, nationality VARCHAR, lost VARCHAR )
Nationality of england, and a Lost larger than 39, and a Win % of 28.7, and a Drawn smaller than 37 had what sum of matches?
SELECT SUM(matches) FROM table_name_1 WHERE nationality = "england" AND lost > 39 AND win__percentage = 28.7 AND drawn < 37
sql_create_context
CREATE TABLE table_12720275_1 ( rank__csa_ VARCHAR )
How many times was the rank (csa) was (msa 348)?
SELECT COUNT(2000 AS _population) FROM table_12720275_1 WHERE rank__csa_ = "(MSA 348)"
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE outputevents ( row_id number, subject_id number, ...
how much weight change does patient 19428 have last measured on the current hospital visit compared to the value first measured on the current hospital visit?
SELECT (SELECT 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 = 19428 AND admissions.dischtime IS NULL)) AND chartevents.itemid IN (SELECT d_items.itemid FROM...
mimic_iii
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 outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime ...
what is the price for the lidocaine 2%?
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 = 'lidocaine 2%')
mimic_iii
CREATE TABLE table_75050 ( "Game" real, "March" real, "Opponent" text, "Score" text, "Record" text )
How many games ended in a record of 30-28-4, with a March more than 1?
SELECT COUNT("Game") FROM table_75050 WHERE "Record" = '30-28-4' AND "March" > '1'
wikisql
CREATE TABLE table_name_67 ( lost INTEGER, against VARCHAR, drawn VARCHAR )
How much Lost has an Against larger than 19, and a Drawn smaller than 1?
SELECT SUM(lost) FROM table_name_67 WHERE against > 19 AND drawn < 1
sql_create_context
CREATE TABLE table_43613 ( "Name" text, "Team" text, "Qual 1" text, "Qual 2" text, "Best" text )
What was the second qualification time for Dale Coyne Racing with a best of 1:03.757?
SELECT "Qual 2" FROM table_43613 WHERE "Team" = 'dale coyne racing' AND "Best" = '1:03.757'
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, ...
give me the number of patients whose admission type is emergency and procedure icd9 code is 5188?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.icd9_code = "5188"
mimicsql_data
CREATE TABLE table_62538 ( "Year" text, "Arizona" text, "California" text, "Colorado" text, "Nevada" text, "New Mexico" text, "Oklahoma" text, "Texas" text, "Utah" text )
What's the value for oklahoma when texas is kennedy?
SELECT "Oklahoma" FROM table_62538 WHERE "Texas" = 'kennedy'
wikisql
CREATE TABLE table_name_14 ( established VARCHAR, nickname VARCHAR )
What year was the team with the nickname pride established?
SELECT COUNT(established) FROM table_name_14 WHERE nickname = "pride"
sql_create_context
CREATE TABLE trip ( id INTEGER, duration INTEGER, start_date TEXT, start_station_name TEXT, start_station_id INTEGER, end_date TEXT, end_station_name TEXT, end_station_id INTEGER, bike_id INTEGER, subscription_type TEXT, zip_code INTEGER ) CREATE TABLE weather ( date TEX...
Draw a bar chart for what are the different ids and names of the stations that have had more than 12 bikes available?, and show from low to high by the bar.
SELECT name, id FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id WHERE T2.bikes_available > 12 ORDER BY name
nvbench
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 admitted to the emergency room had renal and ureteral dis nos?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND diagnoses.short_title = "Renal & ureteral dis NOS"
mimicsql_data
CREATE TABLE table_name_73 ( manufacturer VARCHAR, locomotive_number VARCHAR )
What manufacturer makes locomotive number CTN 46?
SELECT manufacturer FROM table_name_73 WHERE locomotive_number = "ctn 46"
sql_create_context
CREATE TABLE EMPLOYEE ( EMP_NUM int, EMP_LNAME varchar(15), EMP_FNAME varchar(12), EMP_INITIAL varchar(1), EMP_JOBCODE varchar(5), EMP_HIREDATE datetime, EMP_DOB datetime ) CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CR...
Find the number of students who took some course and got A or C and group by first name in a bar chart, and I want to show by the how many stu fname in ascending.
SELECT STU_FNAME, COUNT(STU_FNAME) FROM STUDENT AS T1 JOIN ENROLL AS T2 ON T1.STU_NUM = T2.STU_NUM WHERE T2.ENROLL_GRADE = 'C' OR T2.ENROLL_GRADE = 'A' GROUP BY STU_FNAME ORDER BY COUNT(STU_FNAME)
nvbench
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE fligh...
what is the distance between PITTSBURGH airport and downtown PITTSBURGH
SELECT DISTINCT AIRPORT_SERVICE_0.miles_distant FROM airport, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1 WHERE airport.airport_code = AIRPORT_SERVICE_0.airport_code AND airport.airport_code = AIRPORT_SERVICE_1.airport_code AND CITY_0.city_code = AIRPORT_SE...
atis
CREATE TABLE medicine_enzyme_interaction ( enzyme_id number, medicine_id number, interaction_type text ) CREATE TABLE enzyme ( id number, name text, location text, product text, chromosome text, omim number, porphyria text ) CREATE TABLE medicine ( id number, name text,...
What is the id and name of the enzyme that can interact with the most medicines as an activator?
SELECT T1.id, T1.name FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T1.id = T2.enzyme_id WHERE T2.interaction_type = 'activitor' GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_53486 ( "Draft" text, "Round" real, "Pick" real, "Nationality" text, "Position" text, "School/Club Team" text )
Which team had a 2008-3 2008 draft?
SELECT "School/Club Team" FROM table_53486 WHERE "Draft" = '2008-3 2008'
wikisql
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...
how many hours has it been since the first time patient 027-142451 stayed in ward 966 during this hospital visit?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '027-142451' AND patient.wardid = 966 AND patient.hospitaldischargetime IS NULL ORDER BY patient.unitadmittime LIMIT 1
eicu
CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE state ( state_code text, state_name text, country_name text ) ...
list flights from SAN JOSE to DALLAS on friday
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 = 'DALLAS' AND date_day.day_number = 25 AND date_day.month_number = 6 AND da...
atis
CREATE TABLE table_name_46 ( Id VARCHAR )
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_name_46 WHERE 2007 < 6.7 AND 2009 < 3.4
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellv...
in this month, when was the last time patient 027-85328 had the maximum sodium?
SELECT 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 = '027-85328')) AND lab.labname = 'sodium' AND DATETIME(lab.labresulttime, 'start of m...
eicu
CREATE TABLE table_name_76 ( date VARCHAR, record VARCHAR )
Which Date has a record of 3-5?
SELECT date FROM table_name_76 WHERE record = "3-5"
sql_create_context
CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
哪个机构负责了检验报告单19150646660其机构代码与名称分别叫什么?
SELECT BGJGDM, BGJGMC FROM jybgb WHERE BGDH = '19150646660'
css
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE jybgb_jyjgzbb ( JYZBLSH number, YLJGDM text, jyjgzbb_id number ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, ...
患者32152549开出的所有检验报告单在2015年3月23日至2021年1月14日内的科室是什么编码还有名称是啥?
SELECT jybgb.KSBM, jybgb.KSMC FROM hz_info JOIN mzjzjlb JOIN jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '32152549' AND jybgb.BGRQ BETWEEN '2015-03-23' AND '2021-...
css
CREATE TABLE table_name_31 ( date VARCHAR, format_s_ VARCHAR )
Which date has a format's album?
SELECT date FROM table_name_31 WHERE format_s_ = "album"
sql_create_context
CREATE TABLE table_9408 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Points difference" text, "Bonus Points" text, "Points" text )
How many rounds were played in the matching resulting in a Points For score of 343?
SELECT "Played" FROM table_9408 WHERE "Points for" = '343'
wikisql
CREATE TABLE table_39399 ( "Year" real, "Champion" text, "Country" text, "Venue" text, "Location" text, "Score" text, "Winner's share ( $ )" real )
What was the winning score in 2000?
SELECT "Score" FROM table_39399 WHERE "Year" = '2000'
wikisql
CREATE TABLE table_2856898_1 ( profit_before_tax__£m_ VARCHAR, turnover__£m_ VARCHAR )
What was the profit before tax when the turnover was 431.06?
SELECT profit_before_tax__£m_ FROM table_2856898_1 WHERE turnover__£m_ = "431.06"
sql_create_context
CREATE TABLE table_13663 ( "Rank" real, "Heat" real, "Cyclist" text, "Nation" text, "Result" text )
Which Rank has a Heat larger than 7?
SELECT MAX("Rank") FROM table_13663 WHERE "Heat" > '7'
wikisql
CREATE TABLE table_1341843_19 ( candidates VARCHAR, incumbent VARCHAR )
Who were the candidates in the district whose incumbent is Joe Waggonner?
SELECT candidates FROM table_1341843_19 WHERE incumbent = "Joe Waggonner"
sql_create_context
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...
患者53751020全部检验报告单中的标本采集部位在2000年10月30日到2002年2月6日内都是哪一部位?
SELECT jybgb.BBCJBW FROM hz_info JOIN mzjzjlb JOIN jybgb 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 mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGD...
css
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
Give the number of patients that survived had a and procedure icd9 code of 3772.
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 = "3772"
mimicsql_data
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
Visualize a bar chart about the distribution of All_Neutral and Team_ID , rank in ascending by the y-axis.
SELECT All_Neutral, Team_ID FROM basketball_match ORDER BY Team_ID
nvbench
CREATE TABLE table_25794138_1 ( stadium VARCHAR, team VARCHAR )
What stadium(sO does san juan jabloteh play in?
SELECT stadium FROM table_25794138_1 WHERE team = "San Juan Jabloteh"
sql_create_context
CREATE TABLE table_46665 ( "Country" text, "Preliminary" real, "Interview" real, "Swimsuit" real, "Evening Gown" real, "Average" real )
What is the lowest average score where the evening gown score was 8.811?
SELECT MIN("Average") FROM table_46665 WHERE "Evening Gown" = '8.811'
wikisql
CREATE TABLE zzmzjzjlb ( 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...
查询52622012病患的检验报告单中结果指标均异常的检验报告单?需要检验报告的单号
SELECT jybgb.BGDH FROM hz_info JOIN zzmzjzjlb JOIN jybgb ON 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 hz_info.RYBH = '52622012' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FRO...
css
CREATE TABLE Drama_Workshop_Groups ( Workshop_Group_ID INTEGER, Address_ID INTEGER, Currency_Code CHAR(15), Marketing_Region_Code CHAR(15), Store_Name VARCHAR(255), Store_Phone VARCHAR(255), Store_Email_Address VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Clients ( Client...
List the distinct payment method codes with the number of orders mad in a bar chart.
SELECT payment_method_code, COUNT(*) FROM Invoices GROUP BY payment_method_code
nvbench
CREATE TABLE table_23944514_15 ( mountains_classification VARCHAR, aggressive_rider VARCHAR )
Name the mountains classification for bradley white
SELECT mountains_classification FROM table_23944514_15 WHERE aggressive_rider = "Bradley White"
sql_create_context
CREATE TABLE table_name_25 ( ects_credit_points VARCHAR, program VARCHAR )
How many ECTS credit points occur with Master in Management?
SELECT COUNT(ects_credit_points) FROM table_name_25 WHERE program = "master in management"
sql_create_context
CREATE TABLE table_23294081_11 ( no INTEGER )
What is the highest episode number?
SELECT MAX(no) FROM table_23294081_11
sql_create_context
CREATE TABLE table_name_41 ( military_deaths VARCHAR, military_and_or_civilian_wounded VARCHAR, total_deaths VARCHAR )
What is the total number of military deaths when there are 78 military and/or civilian wounded and more than 27 total deaths?
SELECT COUNT(military_deaths) FROM table_name_41 WHERE military_and_or_civilian_wounded = "78" AND total_deaths > 27
sql_create_context
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, lan...
how much heparin sodium (preservative free) was first prescribed to patient 14035?
SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14035) AND prescriptions.drug = 'heparin sodium (preservative free)' ORDER BY prescriptions.startdate LIMIT 1
mimic_iii
CREATE TABLE table_28334 ( "Country" text, "Exports" text, "Imports" text, "Total Trade" text, "Trade Balance" text )
In the country United Arab Emirates, what is the number of imports?
SELECT "Imports" FROM table_28334 WHERE "Country" = 'United Arab Emirates'
wikisql
CREATE TABLE table_76686 ( "Full name" text, "Alias" text, "Age\u00b9" real, "From" text, "Occupation\u00b2" text, "Specialty" text, "Position/ Eliminated" text )
What is Occupation , when Age is greater than 24, when Alias is 'Black'?
SELECT "Occupation\u00b2" FROM table_76686 WHERE "Age\u00b9" > '24' AND "Alias" = 'black'
wikisql
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) 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, C...
名字是奚星晖的患者在医院编码5472060出院诊断疾病名称不包含社交的医疗就诊记录编号是多少呀?
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '奚星晖' AND t_kc21.MED_SER_ORG_NO = '5472060' AND NOT t_kc21.OUT_DIAG_DIS_NM LIKE '%社交%'
css
CREATE TABLE film_actor ( actor_id SMALLINT UNSIGNED, film_id SMALLINT UNSIGNED, last_update TIMESTAMP ) CREATE TABLE language ( language_id TINYINT UNSIGNED, name CHAR(20), last_update TIMESTAMP ) CREATE TABLE country ( country_id SMALLINT UNSIGNED, country VARCHAR(50), last_updat...
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?, and show by the total number in asc please.
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' ORDER BY COUNT(payment_date)
nvbench
CREATE TABLE table_204_975 ( id number, "year" number, "competition" text, "location" text, "event" text, "final-rank" text, "final-score" number, "qualifying rank" number, "qualifying score" number )
did the olympic trials or the american cup have more events ?
SELECT "competition" FROM table_204_975 WHERE "competition" IN ('olympic trials', 'american cup') GROUP BY "competition" ORDER BY COUNT("event") DESC LIMIT 1
squall
CREATE TABLE table_name_81 ( venue VARCHAR, notes VARCHAR )
What venue has 7964 pb notes?
SELECT venue FROM table_name_81 WHERE notes = "7964 pb"
sql_create_context
CREATE TABLE shop ( Shop_ID int, Shop_Name text, Location text, Open_Date text, Open_Year int ) CREATE TABLE device ( Device_ID int, Device text, Carrier text, Package_Version text, Applications text, Software_Platform text ) CREATE TABLE stock ( Shop_ID int, Device...
Create a bar chart showing how many location across location, list Y from high to low order.
SELECT Location, COUNT(Location) FROM shop GROUP BY Location ORDER BY COUNT(Location) DESC
nvbench
CREATE TABLE table_77740 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
How many people attended the game at VFL Park?
SELECT SUM("Crowd") FROM table_77740 WHERE "Venue" = 'vfl park'
wikisql
CREATE TABLE table_45335 ( "Year" real, "Domestic freight" real, "Domestic mail" real, "International freight" real, "International mail" real, "Total freight and mail" real, "Change" text )
How much international mail has 4,650 international freight and more than 0 domestic mail?
SELECT SUM("International mail") FROM table_45335 WHERE "International freight" = '4,650' AND "Domestic mail" > '0'
wikisql
CREATE TABLE artist ( artist_name text, country text, gender text, preferred_genre text ) CREATE TABLE files ( f_id number, artist_name text, file_size text, duration text, formats text ) CREATE TABLE song ( song_name text, artist_name text, country text, f_id numbe...
What are the names of the different artists from Bangladesh who never received a rating higher than a 7?
SELECT DISTINCT artist_name FROM artist WHERE country = "Bangladesh" EXCEPT SELECT DISTINCT artist_name FROM song WHERE rating > 7
spider
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 ...
08年2月6日到18年10月8日期间,87902700这名患者全段甲状旁腺激素这个指标的所有记录
SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.RYBH = '...
css
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREA...
Users who favorited posts answered by an user.
SELECT P.Id AS "post_link", UV.Id AS "user_link" FROM Votes AS V INNER JOIN Posts AS P ON P.ParentId = V.PostId INNER JOIN Users AS UV ON UV.Id = V.UserId INNER JOIN Users AS UA ON UA.Id = P.OwnerUserId WHERE UA.Id = '##UserId##' AND P.PostTypeId = 2 AND V.VoteTypeId = 5 ORDER BY P.Id, UV.DisplayName
sede
CREATE TABLE table_name_35 ( name VARCHAR, roll VARCHAR )
Who has a roll value of 422?
SELECT name FROM table_name_35 WHERE roll = 422
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellv...
what was the first time patient 006-157753 was prescribed a medication using an nd route 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 = '006-157753' AND patient.hospitaldischargetime IS NULL)) AND me...
eicu
CREATE TABLE table_name_4 ( high_rebounds VARCHAR, high_assists VARCHAR )
Who had the high rebounds of the game that Deron Williams (5) had the high assists?
SELECT high_rebounds FROM table_name_4 WHERE high_assists = "deron williams (5)"
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, ...
医院7755077在2011年3月10日到2017年6月16日期间,有多少科室在门诊就诊中开出的检验报告单低于10张
SELECT COUNT(*) FROM (SELECT zyjybgb.KSBM FROM mzjzjlb JOIN zyjybgb ON mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE mzjzjlb.YLJGDM = '7755077' AND zyjybgb.BGRQ BETWEEN '2011-03-10' AND '2017-06-16' GROUP BY zyjybgb.KSBM HAVING COUNT(*) < 10 UNION SELECT mzjybgb.KSBM FROM mzjzj...
css
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConce...
Closed questions on a tag with 1 <= score <= 5.
SELECT Posts.Id AS "post_link", Posts.CreationDate, Posts.Score, Posts.ClosedDate FROM Posts WHERE (Posts.Score >= 1 AND Posts.Score <= 5) AND Posts.AcceptedAnswerId IS NULL AND (NOT Posts.ClosedDate IS NULL) AND Tags LIKE '##Tag##' ORDER BY Posts.Score DESC LIMIT 50
sede
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, Crea...
Latest (not closed) questions from users with reputation <= N.
SELECT Posts.Id AS "post_link", Users.Reputation FROM Posts, Users WHERE Posts.OwnerUserId = Users.Id AND Posts.PostTypeId = 1 AND Posts.ClosedDate IS NULL AND Users.Reputation < '##UserReputationThreshold##' ORDER BY Posts.CreationDate DESC LIMIT 100
sede
CREATE TABLE Participants_in_Events ( Event_ID INTEGER, Participant_ID INTEGER ) CREATE TABLE Participants ( Participant_ID INTEGER, Participant_Type_Code CHAR(15), Participant_Details VARCHAR(255) ) CREATE TABLE Events ( Event_ID INTEGER, Service_ID INTEGER, Event_Details VARCHAR(255)...
Return a bar chart on what are the ids and details of events that have more than one participants?, and show in asc by the Y.
SELECT T1.Event_Details, T1.Event_ID FROM Events AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID = T2.Event_ID GROUP BY T1.Event_Details ORDER BY T1.Event_ID
nvbench
CREATE TABLE table_14183 ( "School" text, "Location" text, "Mascot" text, "Enrollment" real, "IHSAA Class" text, "County" text )
What is the mascot at Borden?
SELECT "Mascot" FROM table_14183 WHERE "School" = 'borden'
wikisql
CREATE TABLE table_name_86 ( total VARCHAR, set_2 VARCHAR )
What is the Total of Set 2 of 24:22?
SELECT total FROM table_name_86 WHERE set_2 = "24:22"
sql_create_context
CREATE TABLE table_name_98 ( points INTEGER, drawn INTEGER )
Which Points have a Drawn larger than 1?
SELECT AVG(points) FROM table_name_98 WHERE drawn > 1
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
how many patients whose lab test name is ethanol?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "Ethanol"
mimicsql_data
CREATE TABLE table_name_10 ( trofeo_fast_team VARCHAR, winner VARCHAR )
Which Trofeo Fast Team has a Winner of alessandro paganessi?
SELECT trofeo_fast_team FROM table_name_10 WHERE winner = "alessandro paganessi"
sql_create_context
CREATE TABLE table_204_634 ( id number, "tour" number, "official title" text, "venue" text, "city" text, "date\nstart" text, "date\nfinish" text, "prize money\nusd" number, "report" text )
how many series awarded at least $ 500,000 in prize money ?
SELECT COUNT(*) FROM table_204_634 WHERE "prize money\nusd" >= 500000
squall
CREATE TABLE status ( statusId INTEGER, status TEXT ) CREATE TABLE constructorStandings ( constructorStandingsId INTEGER, raceId INTEGER, constructorId INTEGER, points REAL, position INTEGER, positionText TEXT, wins INTEGER ) CREATE TABLE circuits ( circuitId INTEGER, circu...
Find the id and location of circuits that belong to France or Belgium Plot them as bar chart, and could you display circuitId in ascending order?
SELECT location, circuitId FROM circuits WHERE country = "France" OR country = "Belgium" ORDER BY circuitId
nvbench
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location...
how much did patient 13622 weigh first measured in 08/last year?
SELECT 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 = 13622)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit wt'...
mimic_iii
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...
Find All_Games and Team_ID , and visualize them by a bar chart, I want to order in asc by the x-axis.
SELECT All_Games, Team_ID FROM basketball_match ORDER BY All_Games
nvbench
CREATE TABLE table_41231 ( "Location" text, "Aircraft" text, "Tail number" text, "Aircraft damage" text, "Fatalities" text )
What was the location of the Ju-52 aircraft?
SELECT "Location" FROM table_41231 WHERE "Aircraft" = 'ju-52'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, a...
what is the price of diagnosis of s/p hip surgery - fracture?
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'diagnosis' AND cost.eventid IN (SELECT diagnosis.diagnosisid FROM diagnosis WHERE diagnosis.diagnosisname = 's/p hip surgery - fracture')
eicu