context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
what is minimum age of patients whose admission type is emergency and year of death is less than 2158?
SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.dod_year < "2158.0"
mimicsql_data
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...
名叫孙弘量的患者曾做过哪些检查
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM 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_NM = '孙弘量' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE table_name_4 ( club VARCHAR, goals VARCHAR )
What club had 0 goals?
SELECT club FROM table_name_4 WHERE goals = 0
sql_create_context
CREATE TABLE table_name_52 ( rank INTEGER, games INTEGER )
What is the smallest rank when there are more than 2 games?
SELECT MIN(rank) FROM table_name_52 WHERE games > 2
sql_create_context
CREATE TABLE table_203_466 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
what is the difference in medals between cuba and mexico ?
SELECT (SELECT "total" FROM table_203_466 WHERE "nation" = 'cuba') - (SELECT "total" FROM table_203_466 WHERE "nation" = 'mexico')
squall
CREATE TABLE table_77693 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Where did North Melbourne play as the home team?
SELECT "Venue" FROM table_77693 WHERE "Home team" = 'north melbourne'
wikisql
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
在00年1月17日直到11年5月4日这一段时间,病患云天干内所有检验结果指标记录中的仪器编号以及名称分别叫什么?
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb...
css
CREATE TABLE region ( region_id number, region_code text, region_name text ) CREATE TABLE affected_region ( region_id number, storm_id number, number_city_affected number ) CREATE TABLE storm ( storm_id number, name text, dates_active text, max_speed number, damage_millions...
List the name for storms and the number of affected regions for each storm.
SELECT T1.name, COUNT(*) FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id
spider
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid numb...
count the number of patients for whom prednisone 50 mg po tabs was prescribed in the same hospital visit after having been diagnosed with pneumonia.
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'pneumonia') AS t1 JOIN (SELECT patient.uniquepid, medication.drugstarttim...
eicu
CREATE TABLE table_12306 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
What is the Away team when Arsenal is the Home team?
SELECT "Away team" FROM table_12306 WHERE "Home team" = 'arsenal'
wikisql
CREATE TABLE weather ( date TEXT, max_temperature_f INTEGER, mean_temperature_f INTEGER, min_temperature_f INTEGER, max_dew_point_f INTEGER, mean_dew_point_f INTEGER, min_dew_point_f INTEGER, max_humidity INTEGER, mean_humidity INTEGER, min_humidity INTEGER, max_sea_level_pre...
Show the number of stations installed change over the installation date of in station table using a line chart, order in ascending by the installation_date.
SELECT installation_date, COUNT(installation_date) FROM station GROUP BY installation_date ORDER BY installation_date
nvbench
CREATE TABLE table_2601 ( "Episode #" real, "US Air Date" text, "Rating" text, "Share" real, "Rating/Share (18-49)" text, "Viewers (millions)" text )
How many episodes have episode #11?
SELECT COUNT("US Air Date") FROM table_2601 WHERE "Episode #" = '11'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
provide the number of patients whose procedure long title is creation of conduit between left ventricle and aorta and lab test fluid is pleural?
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 = "Creation of conduit between left ventricle and aorta" AND lab.fluid = "Pleural"
mimicsql_data
CREATE TABLE table_name_98 ( animal_name VARCHAR, tv_series VARCHAR, species VARCHAR )
What animal was yes for tv series and was a terrapins?
SELECT animal_name FROM table_name_98 WHERE tv_series = "yes" AND species = "terrapins"
sql_create_context
CREATE TABLE table_12512 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Raiders points" real, "Opponents" real, "First Downs" real, "Record" text, "Streak" text, "Attendance" real )
What day did the Raiders score 17?
SELECT "Date" FROM table_12512 WHERE "Raiders points" = '17'
wikisql
CREATE TABLE table_67863 ( "Language" text, "Number" text, "percentage (%)" text, "males" text, "females" text )
What females speak Romanian?
SELECT "females" FROM table_67863 WHERE "Language" = 'romanian'
wikisql
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_re...
please give me information on a flight on 4 17 from PHILADELPHIA to BOSTON as early as possible
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 = 'BOSTON' AND date_day.day_number = 17 AND date_day.month_number = 4 AND d...
atis
CREATE TABLE table_10706961_2 ( winning_team VARCHAR, winning_driver VARCHAR )
Which teams won when Bobby Rahal was their winning driver?
SELECT winning_team FROM table_10706961_2 WHERE winning_driver = "Bobby Rahal"
sql_create_context
CREATE TABLE table_name_38 ( song_choice VARCHAR, result VARCHAR, week VARCHAR )
Which song garnered an advanced result during top 20 week ?
SELECT song_choice FROM table_name_38 WHERE result = "advanced" AND week = "top 20"
sql_create_context
CREATE TABLE table_name_50 ( week_11_nov_16 VARCHAR, week_13_nov_30 VARCHAR )
What is the week 11 nov 16 standing with wisconsin (10-1) on week 13 Nov 30?
SELECT week_11_nov_16 FROM table_name_50 WHERE week_13_nov_30 = "wisconsin (10-1)"
sql_create_context
CREATE TABLE table_name_22 ( score VARCHAR, date VARCHAR )
Can you tell me the Score that has the Date of april 8?
SELECT score FROM table_name_22 WHERE date = "april 8"
sql_create_context
CREATE TABLE code_description ( code varchar, description text ) 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 time_inte...
i would like the least expensive airfare flight on sunday to PITTSBURGH from SAN FRANCISCO
SELECT DISTINCT FLIGHT_0.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, airport_service AS AIRPORT_SERVICE_3, city AS CITY_0, city AS CITY_1, city AS CITY_2, city AS CITY_3, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, date_day AS DATE...
atis
CREATE TABLE table_name_14 ( tyres VARCHAR, year VARCHAR, laps VARCHAR )
Which tyre was before 1995 with 142 laps?
SELECT tyres FROM table_name_14 WHERE year < 1995 AND laps = 142
sql_create_context
CREATE TABLE table_25438110_5 ( casinos VARCHAR, fy09_$millions VARCHAR )
How many casinos are associated with a FY2009 $mil value of exactly $279?
SELECT COUNT(casinos) FROM table_25438110_5 WHERE fy09_$millions = "$279"
sql_create_context
CREATE TABLE table_name_5 ( nationality VARCHAR, title VARCHAR )
What is the Nationality of the Deacon of S. Maria in Via Lata?
SELECT nationality FROM table_name_5 WHERE title = "deacon of s. maria in via lata"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
count the number of patients whose ethnicity is black/cape verdean and primary disease is st elevated myocardial infarction\cardiac cath?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH"
mimicsql_data
CREATE TABLE table_203_543 ( id number, "year" text, "show" text, "role" text, "channel" text, "extra" text )
what was the name of the last television show between 2004 and february , 2013 in which mauli dave played herself ?
SELECT "show" FROM table_203_543 WHERE "role" = 'herself'
squall
CREATE TABLE table_5144 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time/Retired" text, "Grid" real )
What is the average grid with a number of laps smaller than 8?
SELECT AVG("Grid") FROM table_5144 WHERE "Laps" < '8'
wikisql
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE T...
For 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 first_name and salary , and list in desc by the Y.
SELECT FIRST_NAME, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SALARY DESC
nvbench
CREATE TABLE table_22625 ( "Country" text, "TV Network(s)" text, "Series Premiere" text, "Weekly Schedule" text, "Status" text )
What is every status with a weekly schedule of Monday to Thursday @ 11:00 pm?
SELECT "Status" FROM table_22625 WHERE "Weekly Schedule" = 'Monday to Thursday @ 11:00 pm'
wikisql
CREATE TABLE table_name_27 ( date VARCHAR, tournament VARCHAR )
What is the date of the Los Angeles open?
SELECT date FROM table_name_27 WHERE tournament = "los angeles open"
sql_create_context
CREATE TABLE table_66165 ( "Rank:" real, "Premier:" text, "Party:" text, "Assumed Office:" text, "Left Office:" text, "TOTAL Time in Office:" text )
what is the rank when the assumed office is 9 april 1903?
SELECT SUM("Rank:") FROM table_66165 WHERE "Assumed Office:" = '9 april 1903'
wikisql
CREATE TABLE table_78713 ( "Model" text, "First Year" real, "Distribution" text, "Engine" text, "Displacement cc" real, "Power hp (kW)" text )
What is the total number of First Year, when Displacement CC is greater than 4719, when Engine is V8, when Power HP (kW) is '335 (246)', and when Model is 'Ghibli SS'?
SELECT COUNT("First Year") FROM table_78713 WHERE "Displacement cc" > '4719' AND "Engine" = 'v8' AND "Power hp (kW)" = '335 (246)' AND "Model" = 'ghibli ss'
wikisql
CREATE TABLE table_204_414 ( id number, "name" text, "armenian" text, "location" text, "# of prisoners designed for" number, "notes" text )
name the location used the most number of times in the table .
SELECT "location" FROM table_204_414 GROUP BY "location" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE table_1473672_4 ( college_junior_club_team VARCHAR, nhl_team VARCHAR )
Name the number of teams for college/junior club for philadelphia flyers
SELECT COUNT(college_junior_club_team) FROM table_1473672_4 WHERE nhl_team = "Philadelphia Flyers"
sql_create_context
CREATE TABLE table_name_77 ( team__number2 VARCHAR )
What was the 2nd leg score in the matchup with a team 2 of KK Borac?
SELECT 2 AS nd_leg FROM table_name_77 WHERE team__number2 = "kk borac"
sql_create_context
CREATE TABLE table_name_88 ( week VARCHAR, result VARCHAR )
What week's game had a result of l 35 37?
SELECT week FROM table_name_88 WHERE result = "l 35–37"
sql_create_context
CREATE TABLE table_51312 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What date was fitzroy the away team?
SELECT "Date" FROM table_51312 WHERE "Away team" = 'fitzroy'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE p...
when did patient 002-19168 receive a prescription since 54 months ago for the last time?
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 = '002-19168')) AND DATETIME(medication.drugstarttime) >= DATETIM...
eicu
CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE ...
show me all FIRST class fares from NEW YORK to MIAMI leaving on a TUESDAY
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis AS FARE_BASIS_0, fare_basis AS FARE_BASIS_1, flight, flight_fare WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_...
atis
CREATE TABLE table_name_93 ( tournament VARCHAR, outcome VARCHAR, opponent VARCHAR )
Which tournament has an Outcome of runner-up, and an Opponent of ma a zec pe kiri ?
SELECT tournament FROM table_name_93 WHERE outcome = "runner-up" AND opponent = "maša zec peškirič"
sql_create_context
CREATE TABLE table_name_2 ( fs VARCHAR, sp INTEGER, places VARCHAR, name VARCHAR )
Name the average SP+FS with places less tha 94 for renata baierova
SELECT AVG(sp) + fs FROM table_name_2 WHERE places < 94 AND name = "renata baierova"
sql_create_context
CREATE TABLE table_name_76 ( name VARCHAR, pick__number VARCHAR, round VARCHAR )
Which player was picked in round 15 with a pick smaller than 13?
SELECT name FROM table_name_76 WHERE pick__number < 13 AND round = 15
sql_create_context
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDa...
Number of unique users with accept answers for tagslike.
SELECT COUNT(DISTINCT Posts.OwnerUserId) FROM Posts, PostTags, Tags WHERE Posts.PostTypeId = 2 AND Posts.Id IN (SELECT Posts.AcceptedAnswerId FROM Posts, PostTags, Tags WHERE Posts.PostTypeId = 1 AND Posts.Id = PostTags.PostId AND PostTags.TagId = Tags.Id AND Tags.TagName LIKE '%##TagName##%')
sede
CREATE TABLE table_36697 ( "Game" text, "Date" text, "Home Team" text, "Result" text, "Road Team" text, "TV Time" text )
What was the TV time for the road game against Phoenix where the score was 98-99?
SELECT "TV Time" FROM table_36697 WHERE "Home Team" = 'phoenix' AND "Result" = '98-99'
wikisql
CREATE TABLE table_203_88 ( id number, "language" text, "number" number, "percentage (%)" number, "males" number, "females" number )
what is the highest percentage of speakers other than polish ?
SELECT "language" FROM table_203_88 WHERE "language" <> 'polish' ORDER BY "percentage (%)" DESC LIMIT 1
squall
CREATE TABLE ENROLL ( CLASS_CODE varchar(5), STU_NUM int, ENROLL_GRADE varchar(50) ) CREATE TABLE CLASS ( CLASS_CODE varchar(5), CRS_CODE varchar(10), CLASS_SECTION varchar(2), CLASS_TIME varchar(20), CLASS_ROOM varchar(8), PROF_NUM int ) CREATE TABLE EMPLOYEE ( EMP_NUM int, ...
Show the number of courses for each course description in a stacked bar chart The x-axis is course description and group by instructor's name, rank CRS_DESCRIPTION in asc order.
SELECT CRS_DESCRIPTION, COUNT(CRS_DESCRIPTION) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE GROUP BY EMP_FNAME, CRS_DESCRIPTION ORDER BY CRS_DESCRIPTION
nvbench
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...
所有在医疗就诊83739399515中给患者开出的药品,把编码和名称及其金额列好,删除金额最低的药品,其余按金额降序排列
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.AMOUNT FROM t_kc22 WHERE t_kc21_t_kc22.MED_CLINIC_ID = '83739399515' AND t_kc22.AMOUNT > (SELECT MIN(t_kc22.AMOUNT) FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.ME...
css
CREATE TABLE event ( Event_ID int, Date text, Venue text, Name text, Event_Attendance int ) CREATE TABLE journalist ( journalist_ID int, Name text, Nationality text, Age text, Years_working int ) CREATE TABLE news_report ( journalist_ID int, Event_ID int, Work_Type ...
Visualize the average experience working length of journalists working on different role type using a bar chart.
SELECT Work_Type, AVG(Years_working) FROM journalist AS t1 JOIN news_report AS t2 ON t1.journalist_ID = t2.journalist_ID GROUP BY t2.Work_Type
nvbench
CREATE TABLE table_42469 ( "Player" text, "Nationality" text, "Position" text, "Years in Orlando" text, "School/Club Team" text )
What is the Position for Orlando for 1989 1999?
SELECT "Position" FROM table_42469 WHERE "Years in Orlando" = '1989–1999'
wikisql
CREATE TABLE Project_outcomes ( outcome_code VARCHAR )
How many Patent outcomes are generated from all the projects?
SELECT COUNT(*) FROM Project_outcomes WHERE outcome_code = 'Patent'
sql_create_context
CREATE TABLE table_204_530 ( id number, "type" text, "stage" number, "cyclist" text, "team" text, "reason" text )
how many people withdrew in the 4th stage ?
SELECT COUNT("type") FROM table_204_530 WHERE "stage" = 4
squall
CREATE TABLE table_name_6 ( position INTEGER, points VARCHAR, bike_no VARCHAR, driver___passenger VARCHAR )
What is the lowest Postion, when Bike No is greater than 10, when Driver / Passenger is Nicky Pulinx / Ondrej Cermak, and when Points is greater than 244?
SELECT MIN(position) FROM table_name_6 WHERE bike_no > 10 AND driver___passenger = "nicky pulinx / ondrej cermak" AND points > 244
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE patient ( uniquepid text, ...
tell me the minimum cost of a hospital that involved pancreatitis - relapsing last year?
SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'pancreatitis - relapsing')) AND DATETIME(cos...
eicu
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
之前,患者28448699在哪里就诊的?
SELECT txmzjzjlb.YLJGDM 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 = '28448699' UNION SELECT ftxmzjzjlb.YLJGDM FROM hz_info JOIN ftxmzjzjlb ON hz_info.YLJGDM = ftxmzjzjlb.YLJGDM AND hz_info.KH = ftxmzjzjlb.KH AND hz_i...
css
CREATE TABLE table_204_467 ( id number, "date" text, "opponents" text, "h/a" text, "result\nf-a" text, "scorers" text, "attendance" number )
what was the difference in score on january 2 1922 ?
SELECT ABS("result\nf-a" - "result\nf-a") FROM table_204_467 WHERE "date" = '2 january 1922'
squall
CREATE TABLE table_name_12 ( driver VARCHAR, grid VARCHAR )
Which driver drove in grid 19?
SELECT driver FROM table_name_12 WHERE grid = 19
sql_create_context
CREATE TABLE table_9647 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Round" real, "Time" text, "Location" text )
What is Round, when Method is 'submission (reverse armbar)'?
SELECT "Round" FROM table_9647 WHERE "Method" = 'submission (reverse armbar)'
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
what is lab test name of subject id 19187?
SELECT lab.label FROM lab WHERE lab.subject_id = "19187"
mimicsql_data
CREATE TABLE table_203_394 ( id number, "title" text, "author" text, "date" number, "length\n(first edition)" text )
who authored the least number of titles ?
SELECT "author" FROM table_203_394 GROUP BY "author" ORDER BY COUNT("title") LIMIT 1
squall
CREATE TABLE table_30557 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
Which team drafted a player from HC Slavia Praha (Czechoslovakia)?
SELECT "NHL team" FROM table_30557 WHERE "College/junior/club team" = 'HC Slavia Praha (Czechoslovakia)'
wikisql
CREATE TABLE participates_in ( stuid number, actid number ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE activity ( actid number, activity_name text ) CREATE TABLE faculty...
Find the first names of the faculty members who participate in Canoeing and Kayaking.
SELECT T1.lname FROM faculty AS T1 JOIN faculty_participates_in AS T2 ON T1.facid = T2.facid JOIN activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Canoeing' INTERSECT SELECT T1.lname FROM faculty AS T1 JOIN faculty_participates_in AS T2 ON T1.facid = T2.facid JOIN activity AS T3 ON T2.actid = T2.actid WH...
spider
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, ...
病人名叫周泰宁在11年11月14日到13年6月11日内什么时间审核检验报告单的具体时间都是什么?
SELECT zyjybgb.SHSJ FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb ON person_info.RYBH = hz_info.RYBH AND 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 WHERE person_info.XM = '周泰宁' ...
css
CREATE TABLE Catalog_Contents_Additional_Attributes ( catalog_entry_id INTEGER, catalog_level_number INTEGER, attribute_id INTEGER, attribute_value VARCHAR(255) ) CREATE TABLE Catalog_Contents ( catalog_entry_id INTEGER, catalog_level_number INTEGER, parent_entry_id INTEGER, previous_en...
Visualize a bar chart for what are the name and level of catalog structure with level number between 5 and 10, and I want to list in ascending by the y axis.
SELECT catalog_level_name, catalog_level_number FROM Catalog_Structure WHERE catalog_level_number BETWEEN 5 AND 10 ORDER BY catalog_level_number
nvbench
CREATE TABLE table_203_269 ( id number, "season" text, "competition" text, "round" text, "club" text, "home" text, "away" text, "aggregate" text )
who had the least aggregate wins ?
SELECT "club" FROM table_203_269 ORDER BY "aggregate" LIMIT 1
squall
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
查一下17172279这个病人在医院7202022的就诊记录中,给他开出的药品中哪个药的单价是最高的?药品的编号和名称及其单价分别是啥
SELECT SOC_SRT_DIRE_CD, SOC_SRT_DIRE_NM, UNIVALENT FROM t_kc22 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '17172279' AND MED_SER_ORG_NO = '7202022') ORDER BY UNIVALENT DESC LIMIT 1
css
CREATE TABLE medicine ( id number, name text, trade_name text, fda_approved text ) 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, chromosom...
How many medicines were not approved by the FDA?
SELECT COUNT(*) FROM medicine WHERE fda_approved = 'No'
spider
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline...
i'd like a flight from COLUMBUS to PHOENIX stopping in CINCINNATI and serving DINNER what 's available
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop, food_service WHERE ((CITY_2.city_code = AIRPORT_SERVICE_2.city_code AND CITY_2.city_name = 'CINCINN...
atis
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
患者76364706被开出过金额不低于3367.94元的药品在哪几次医疗记录中?列出有什么医疗就诊编号?
SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '76364706' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE AMOUNT >= 3367.94)
css
CREATE TABLE table_name_47 ( result VARCHAR, attendance VARCHAR )
What was the result of the game that was attended by 16,000 people?
SELECT result FROM table_name_47 WHERE attendance = "16,000"
sql_create_context
CREATE TABLE department ( dept_name text, building text, budget number ) CREATE TABLE student ( id text, name text, dept_name text, tot_cred number ) CREATE TABLE prereq ( course_id text, prereq_id text ) CREATE TABLE takes ( id text, course_id text, sec_id text, s...
What is the year and semester with the most courses?
SELECT semester, year FROM section GROUP BY semester, year ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_2593 ( "Year" text, "Day" text, "Date" text, "Driver" text, "Team" text, "Manufacturer" text, "Laps" text, "Miles (km)" text, "Race Time" text, "Average Speed (mph)" text, "Report" text )
What was the report for the Sunday race where the winner had an average speed of 128.27 mph?
SELECT "Report" FROM table_2593 WHERE "Day" = 'Sunday' AND "Average Speed (mph)" = '128.27'
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...
Count the number of patients whose diagnosis short title is ocl crtd art without infrct that have a lab test abnormal status of delta.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Ocl crtd art wo infrct" AND lab.flag = "delta"
mimicsql_data
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...
among patients diagnosed with poison-drug/medicin nec, how many of them were married?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "MARRIED" AND diagnoses.short_title = "Poison-drug/medicin NEC"
mimicsql_data
CREATE TABLE table_name_43 ( championship VARCHAR, margin VARCHAR )
Which championship had a margin of 10 strokes?
SELECT championship FROM table_name_43 WHERE margin = "10 strokes"
sql_create_context
CREATE TABLE table_name_21 ( player VARCHAR, total_reb VARCHAR, fg_pct VARCHAR, def_reb VARCHAR )
Which player has a FG Pct less than 45.9, a def reb less than 43, and a total reb of 9?
SELECT player FROM table_name_21 WHERE fg_pct < 45.9 AND def_reb < 43 AND total_reb = 9
sql_create_context
CREATE TABLE table_49754 ( "City" text, "Country" text, "IATA" text, "ICAO" text, "Airport" text )
what is the iata for malta international airport?
SELECT "IATA" FROM table_49754 WHERE "Airport" = 'malta international airport'
wikisql
CREATE TABLE table_name_98 ( score VARCHAR, date VARCHAR )
Can you tell me the Score that has the Date of 11/17/1979?
SELECT score FROM table_name_98 WHERE date = "11/17/1979"
sql_create_context
CREATE TABLE table_201_36 ( id number, "year" number, "title" text, "role" text, "notes" text )
which film has their role under igiyook ?
SELECT "title" FROM table_201_36 WHERE "role" = 'igiyook'
squall
CREATE TABLE table_63706 ( "Year" real, "Baden" text, "W\u00fcrttemberg" text, "Nordbayern" text, "S\u00fcdbayern" text )
What's the Nordbayern with a W rttemberg of Union B ckingen in the year before 1932?
SELECT "Nordbayern" FROM table_63706 WHERE "Year" < '1932' AND "W\u00fcrttemberg" = 'union böckingen'
wikisql
CREATE TABLE table_name_82 ( floors INTEGER, name VARCHAR )
What is the lowest number of floors recorded for buildings built by Dubai Marriott Harbour Hotel & Suites?
SELECT MIN(floors) FROM table_name_82 WHERE name = "dubai marriott harbour hotel & suites"
sql_create_context
CREATE TABLE table_name_26 ( fate VARCHAR, ship VARCHAR )
What is the fate for the Bremen ship?
SELECT fate FROM table_name_26 WHERE ship = "bremen"
sql_create_context
CREATE TABLE table_24425976_2 ( episode_title VARCHAR, production_code VARCHAR )
What is the name of the episode with a production code of 107?
SELECT episode_title FROM table_24425976_2 WHERE production_code = "107"
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...
列出患者49963274的检验报告单中结果指标均正常的检验报告单号
SELECT jybgb.BGDH 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 = '49963274' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM jyjgzbb WH...
css
CREATE TABLE table_4558 ( "Actor/actress" text, "Character" text, "Rank" text, "Tenure" text, "Episodes" text )
What character did actor Damien Richardson play?
SELECT "Character" FROM table_4558 WHERE "Actor/actress" = 'damien richardson'
wikisql
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,...
病患号码是47642343的那个人在其医疗记录里被开出的药品均超出748.1元有多少次?以及具体的编号是多少?
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '47642343' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT <= 748.1)
css
CREATE TABLE table_13677808_1 ( technology VARCHAR, rank VARCHAR )
How many times is denmark ranked in technology?
SELECT COUNT(technology) FROM table_13677808_1 WHERE rank = "Denmark"
sql_create_context
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of name and the average of code , and group by attribute name, and could you show by the Name in ascending please?
SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name
nvbench
CREATE TABLE table_47271 ( "Name" text, "Years" text, "League" real, "Scottish Cup" real, "League Cup" real, "Europe" real, "Total" real )
Which Scottish Cup has a League smaller than 561, Years of 1989 1995 1997 2001, and Europe smaller than 11?
SELECT COUNT("Scottish Cup") FROM table_47271 WHERE "League" < '561' AND "Years" = '1989–1995 1997–2001' AND "Europe" < '11'
wikisql
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 had coronary arteriogram nec on urgent admission?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "URGENT" AND procedures.short_title = "Coronary arteriogram NEC"
mimicsql_data
CREATE TABLE table_16088 ( "Character" text, "Australia & New Zealand (Sydney - first run, Melbourne, Auckland)" text, "London" text, "Toronto / Broadway" text, "Brazil" text, "UK Tour" text, "US Tour" text, "Italy (Milan, Rome, Trieste)" text )
How many characters is by Babs Rubenstein?
SELECT COUNT("London") FROM table_16088 WHERE "US Tour" = 'Babs Rubenstein'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE cost ( costid number, uniquepi...
count the number of patients who received a electrolyte administration - intravenous procedure during the same month following a diagnosis of acute coronary syndrome since 3 years ago.
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'acute coronary syndrome' AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-3 year')) AS t1...
eicu
CREATE TABLE table_66003 ( "Rank" real, "Athlete" text, "Country" text, "Time" text, "Notes" text )
who is the athlete with the rank smaller than 2?
SELECT "Athlete" FROM table_66003 WHERE "Rank" < '2'
wikisql
CREATE TABLE table_name_38 ( high_schools INTEGER, cemeteries VARCHAR )
How many High schools in the Region with 8 Cemeteries?
SELECT SUM(high_schools) FROM table_name_38 WHERE cemeteries = 8
sql_create_context
CREATE TABLE table_68538 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text )
Who was the opponent when the loss was Wells (4-7)?
SELECT "Opponent" FROM table_68538 WHERE "Loss" = 'wells (4-7)'
wikisql
CREATE TABLE table_name_38 ( reference VARCHAR, strain VARCHAR )
what is the reference when the strain is msb8?
SELECT reference FROM table_name_38 WHERE strain = "msb8"
sql_create_context
CREATE TABLE table_26131 ( "Election Year" real, "Assembly" text, "Winning Party/Coalition" text, "Chief Minister" text, "Speaker" text )
What is the name of the speaker if the chief minister is M.G. Ramachandran?
SELECT "Speaker" FROM table_26131 WHERE "Chief Minister" = 'M.G. Ramachandran'
wikisql
CREATE TABLE table_203_290 ( id number, "game" number, "date" text, "opponent" text, "location" text, "score" text, "ot" text, "attendance" number, "record" text )
how many games did they win in 2009 ?
SELECT COUNT("game") FROM table_203_290 WHERE "score" = 'w'
squall
CREATE TABLE table_1595 ( "Official Name" text, "Status" text, "Area km 2" text, "Population" real, "Census Ranking" text )
at area 191.43 what is the total number of census ranking?
SELECT COUNT("Census Ranking") FROM table_1595 WHERE "Area km 2" = '191.43'
wikisql
CREATE TABLE table_name_79 ( competition VARCHAR, final_score VARCHAR )
what is the competition that had a final score of 6:5?
SELECT competition FROM table_name_79 WHERE final_score = "6:5"
sql_create_context