context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
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...
新生儿外科的门诊量怎么样在08年2月20日到17年3月13日期间
SELECT COUNT(*) FROM zzmzjzjlb WHERE zzmzjzjlb.JZKSMC = '新生儿外科' AND zzmzjzjlb.JZKSRQ BETWEEN '2008-02-20' AND '2017-03-13' UNION SELECT COUNT(*) FROM fzzmzjzjlb WHERE fzzmzjzjlb.JZKSMC = '新生儿外科' AND fzzmzjzjlb.JZKSRQ BETWEEN '2008-02-20' AND '2017-03-13'
css
CREATE TABLE table_59960 ( "Opposing Teams" text, "Against" real, "Date" text, "Venue" text, "Status" text )
What venue has Scotland as the opposing teams?
SELECT "Venue" FROM table_59960 WHERE "Opposing Teams" = 'scotland'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time )...
what was the drug that was prescribed to patient 002-58884 on the first hospital visit via the mucous mem route for the first time?
SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-58884' AND NOT patient.hospitaldischargetime IS NULL ORDER BY p...
eicu
CREATE TABLE table_57326 ( "Week" real, "Date" text, "Opponent" text, "Home/Away Game" text, "Result" text )
What is the date of the away game in week 8?
SELECT "Date" FROM table_57326 WHERE "Home/Away Game" = 'away' AND "Week" = '8'
wikisql
CREATE TABLE table_name_2 ( socialist_ticket VARCHAR, republican_ticket VARCHAR )
Who's the Socialist ticket with a Republican ticket of john a. may?
SELECT socialist_ticket FROM table_name_2 WHERE republican_ticket = "john a. may"
sql_create_context
CREATE TABLE table_name_97 ( capacity INTEGER, location VARCHAR, year VARCHAR )
What is the highest capacity in Aslantepe in 2002-2005?
SELECT MAX(capacity) FROM table_name_97 WHERE location = "aslantepe" AND year = "2002-2005"
sql_create_context
CREATE TABLE table_27715173_6 ( record VARCHAR, date VARCHAR )
How many records are there for the game on november 24?
SELECT COUNT(record) FROM table_27715173_6 WHERE date = "November 24"
sql_create_context
CREATE TABLE table_name_33 ( total_deaths VARCHAR, total_casualties VARCHAR )
How many deaths were there when the total casualties were 6?
SELECT total_deaths FROM table_name_33 WHERE total_casualties = "6"
sql_create_context
CREATE TABLE table_15187735_10 ( episode VARCHAR, segment_a VARCHAR )
Name the total number of episodes for s fire extinguisher
SELECT COUNT(episode) FROM table_15187735_10 WHERE segment_a = "s Fire Extinguisher"
sql_create_context
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 ...
疾病S14.067的病号郑思源在门诊诊断时的氨基末端B型利钠肽的结果定量及其单位分别是多少?
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB ...
css
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
how many patients belonging to white ethnic origin were admitted in the year less than or equal to 2120?
SELECT MAX(demographic.age) FROM demographic WHERE demographic.ethnicity = "WHITE" AND demographic.admityear >= "2120"
mimicsql_data
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...
柳娟秀这个病人的检验报告单结果指标均异常的有哪些?看看检验报告的单号
SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '柳...
css
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TI...
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, visualize a bar chart about the distribution of job_id and the sum of salary , and group by attribute job_id, display X from low to high order please.
SELECT JOB_ID, SUM(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID
nvbench
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, a scatter chart shows the correlation between price and revenue , and group by attribute name.
SELECT T1.Price, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Name
nvbench
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required t...
flights between NEW YORK and MIAMI
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'NEW YORK' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MIAMI...
atis
CREATE TABLE table_62109 ( "Mission" text, "Resident Country" text, "Local Location" text, "Local Mission" text, "Non-Resident Head of Mission" text, "Local Position" text )
What is Local Location, when Resident Country is 'Belgium', and when Mission is 'Poland'?
SELECT "Local Location" FROM table_62109 WHERE "Resident Country" = 'belgium' AND "Mission" = 'poland'
wikisql
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, ...
Most popular StackOverflow tags in May 2014.
SELECT num.TagName AS Tag, rate.Rate AS QuestionsInMay, num.Num AS QuestionsTotal FROM (SELECT COUNT(DISTINCT OwnerUserId) AS Rate, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId AND Posts.CreationDate < '2014-05-01' AND Posts.CreationDate > '2014-04-01' GROUP BY TagName) AS rat...
sede
CREATE TABLE staff ( staff_id number, staff_address_id number, nickname text, first_name text, middle_name text, last_name text, date_of_birth time, date_joined_staff time, date_left_staff time ) CREATE TABLE addresses ( address_id number, line_1_number_building text, ci...
What is average lesson price taught by staff with first name as Janessa and last name as Sawayn?
SELECT AVG(price) FROM lessons AS T1 JOIN staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn"
spider
CREATE TABLE table_61485 ( "Clubs" text, "Seasons at this level" text, "Settlements" text, "Season joined league" text, "Position in 1959\u20131960" text )
In which season did the vora settlements join the league?
SELECT "Season joined league" FROM table_61485 WHERE "Settlements" = 'évora'
wikisql
CREATE TABLE table_name_9 ( county VARCHAR, area__sq_mi_ VARCHAR )
Which is the total number in the 2010 Census in Oconee County where the area in square miles was less than 674?
SELECT SUM(2010 AS _census_population) FROM table_name_9 WHERE county = "oconee county" AND area__sq_mi_ < 674
sql_create_context
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...
病患82923898在7620449号这个医院入院是其诊断的疾病名字没有震颤麻痹这几个字的医疗就诊记录编码有啥?
SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '82923898' AND MED_SER_ORG_NO = '7620449' AND NOT IN_DIAG_DIS_NM LIKE '%震颤麻痹%'
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 prescription...
give me the number of patients whose admission type is elective and drug type is additive.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND prescriptions.drug_type = "ADDITIVE"
mimicsql_data
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, ...
All answers by deleted users.
SELECT a.Id AS "post_id", a.OwnerDisplayName FROM Posts AS a WHERE a.OwnerUserId IS NULL ORDER BY a.CreationDate
sede
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), Document_Type_Description VARCHAR(255) ) CREATE TABLE Projects ( Project_ID INTEGER, Project_Details VARCHAR(255) ) CREATE TABLE Accounts ( Account_ID INTEGER, Statement_ID INTEGER, Account_...
Give me a histogram for how many documents are there of each type?, rank from high to low by the y axis.
SELECT Document_Type_Code, COUNT(*) FROM Documents GROUP BY Document_Type_Code ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_42300 ( "Office" text, "Democratic ticket" text, "Republican ticket" text, "American Labor ticket" text, "Socialist ticket" text )
Who's the Republican ticket with a Socialist ticket of edna mitchell blue?
SELECT "Republican ticket" FROM table_42300 WHERE "Socialist ticket" = 'edna mitchell blue'
wikisql
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), ...
For those employees who did not have any job in the past, find hire_date and the average of department_id bin hire_date by weekday, and visualize them by a bar chart, rank by the total number in descending.
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(DEPARTMENT_ID) DESC
nvbench
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
Top 20 most famous (viewed) questions.
SELECT Id AS "post_link", OwnerUserId AS "user_link", ViewCount FROM Posts WHERE PostTypeId = 1 ORDER BY ViewCount DESC LIMIT 20
sede
CREATE TABLE table_name_63 ( against VARCHAR, date VARCHAR )
Which Against has a Date of 30/05/1981?
SELECT COUNT(against) FROM table_name_63 WHERE date = "30/05/1981"
sql_create_context
CREATE TABLE table_name_16 ( year VARCHAR, town VARCHAR )
What year was the structure in greensboro, north carolina considered tallest?
SELECT year FROM table_name_16 WHERE town = "greensboro, north carolina"
sql_create_context
CREATE TABLE table_10477224_1 ( species VARCHAR, sepal_width VARCHAR, sepal_length VARCHAR )
Name the number of species with sepal width of 3.4 and sepal length of 5.4
SELECT COUNT(species) FROM table_10477224_1 WHERE sepal_width = "3.4" AND sepal_length = "5.4"
sql_create_context
CREATE TABLE table_name_16 ( format VARCHAR, region VARCHAR )
What is the Format of the release in Greece?
SELECT format FROM table_name_16 WHERE region = "greece"
sql_create_context
CREATE TABLE gwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
从11年2月9日开始,截止到2012年12月3日,列出郑乐山这个患者在6652553这个医院中被开过的所有药品的名字和编码
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_NM = '郑乐山' AND gwyjzb.MED_SER_ORG_NO = '6652553' AND gwyjzb.IN_HOSP_DATE BETWEEN '2011-02-09' AND '2012-12-03' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHER...
css
CREATE TABLE table_43905 ( "Date" text, "Home team" text, "Score" text, "Away team" text, "Venue" text, "Crowd" real, "Box Score" text, "Report" text )
What was the score of the game where the adelaide 36ers were the home team?
SELECT "Score" FROM table_43905 WHERE "Home team" = 'adelaide 36ers'
wikisql
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...
how many patients are admitted under elective type and diagnosed with icd9 code 42833?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND diagnoses.icd9_code = "42833"
mimicsql_data
CREATE TABLE table_39047 ( "Unit" text, "Russian" text, "Translation" text, "Ratio" text, "Cubic inches (exact)" text, "Metric value" text, "Imperial" text, "US Customary" text )
What is the Russian word for wine glass that contains 4.16 fl. oz.?
SELECT "Russian" FROM table_39047 WHERE "US Customary" = '4.16 fl. oz.'
wikisql
CREATE TABLE table_203_234 ( id number, "description" text, "total" number, "poland" number, "baltic states(resettled in poland during war)" number, "resettled in poland during war(from ussr and romania)" number, "sudetendeutsch" number, "se europe\n(hungary, romania, yugoslavia & slovak...
what is the difference between suicides in poland and sudetendeutsch ?
SELECT (SELECT "poland" FROM table_203_234 WHERE "description" = 'suicides') - (SELECT "sudetendeutsch" FROM table_203_234 WHERE "description" = 'suicides')
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...
看看这位患者医疗就诊时的盐酸托莫西汀胶囊的使用频次和每次用量,编号是37357466652的医疗就诊
SELECT USE_FRE, EACH_DOSAGE FROM t_kc22 WHERE MED_CLINIC_ID = '37357466652' AND SOC_SRT_DIRE_NM = '盐酸托莫西汀胶囊'
css
CREATE TABLE table_name_16 ( opponent VARCHAR, round VARCHAR, rules VARCHAR )
Which Opponent has a Round of 4, and a Rules of thai boxing?
SELECT opponent FROM table_name_16 WHERE round = "4" AND rules = "thai boxing"
sql_create_context
CREATE TABLE table_203_598 ( id number, "date" text, "time" text, "opponent" text, "site" text, "tv" text, "result" text, "attendance" number )
how many games had attendance of over 50,000 ?
SELECT COUNT(*) FROM table_203_598 WHERE "attendance" > 50000
squall
CREATE TABLE table_name_57 ( status VARCHAR, floors VARCHAR, year VARCHAR )
What is the status of the building with more than 28 floor and a year of 2013?
SELECT status FROM table_name_57 WHERE floors > 28 AND year = 2013
sql_create_context
CREATE TABLE table_18132 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Results" text, "Candidates" text )
Who were the candidates in the district first elected in 1998 whose incumbent ended up being Paul Ryan?
SELECT "Candidates" FROM table_18132 WHERE "First elected" = '1998' AND "Incumbent" = 'Paul Ryan'
wikisql
CREATE TABLE aircraft ( aid number(9,0), name varchar2(30), distance number(6,0) ) CREATE TABLE certificate ( eid number(9,0), aid number(9,0) ) CREATE TABLE flight ( flno number(4,0), origin varchar2(20), destination varchar2(20), distance number(6,0), departure_date date, ...
Return a histogram on what are the names and distances for all airplanes?
SELECT name, distance FROM aircraft
nvbench
CREATE TABLE table_33035 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Attendance" text )
What game did Jets have an attendance of 78,722?
SELECT "Game site" FROM table_33035 WHERE "Attendance" = '78,722'
wikisql
CREATE TABLE table_63052 ( "Rank" real, "Lane" real, "Athlete" text, "Country" text, "Time" real, "React" real )
What is the lowest react of the athlete from the United States who has a lane less than 4?
SELECT MIN("React") FROM table_63052 WHERE "Country" = 'united states' AND "Lane" < '4'
wikisql
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...
count the number of patients whose admission type is urgent and who were admitted before 2190.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.admityear < "2190"
mimicsql_data
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40)...
For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about the distribution of phone_number and salary , and show by the bar from high to low.
SELECT PHONE_NUMBER, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY PHONE_NUMBER DESC
nvbench
CREATE TABLE table_37463 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Record" text, "Attendance" text )
What is the attendance that has fedex field as the game site with 3 as the week?
SELECT "Attendance" FROM table_37463 WHERE "Game site" = 'fedex field' AND "Week" = '3'
wikisql
CREATE TABLE table_name_96 ( rowers VARCHAR, time VARCHAR )
Who are the rowers with the time of 5:54.57?
SELECT rowers FROM table_name_96 WHERE time = "5:54.57"
sql_create_context
CREATE TABLE table_name_53 ( album_title VARCHAR, title VARCHAR )
Which Album title has a Title of ?
SELECT album_title FROM table_name_53 WHERE title = "滑板"
sql_create_context
CREATE TABLE table_name_95 ( wins VARCHAR, division VARCHAR, finish VARCHAR )
What is the Western Division of Wins with a 4th Finish?
SELECT wins FROM table_name_95 WHERE division = "western" AND finish = "4th"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ...
give me the number of patients whose diagnoses long title is chronic kidney disease, stage iv (severe) and drug type is main?
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 = "Chronic kidney disease, Stage IV (severe)" AND prescriptions.drug_type = "MAIN"
mimicsql_data
CREATE TABLE table_78420 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the highest crowd in Victoria Park?
SELECT MAX("Crowd") FROM table_78420 WHERE "Venue" = 'victoria park'
wikisql
CREATE TABLE table_20801 ( "Institution" text, "Location" text, "Nickname" text, "Enrollment" real, "Established" real )
Nickname of the school established in 1773
SELECT "Nickname" FROM table_20801 WHERE "Established" = '1773'
wikisql
CREATE TABLE table_name_11 ( dialcode VARCHAR, location VARCHAR )
What Dialcode has a location of Edmonton?
SELECT dialcode FROM table_name_11 WHERE location = "edmonton"
sql_create_context
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
what is patient 003-54278's height for the last time until 02/2103?
SELECT patient.admissionheight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '003-54278') AND NOT patient.admissionheight IS NULL AND STRFTIME('%y-%m', patient.unitadmittime) <= '2103-02' ORDER BY patient.unitadmittime DESC LIMIT...
eicu
CREATE TABLE table_74314 ( "Track no." real, "Track" text, "Original Artist" text, "Soloist(s)" text, "Vocal Percussionist" text, "Arranger(s)" text )
Who is the vocal percussionist for Sex Bomb?
SELECT "Vocal Percussionist" FROM table_74314 WHERE "Track" = 'Sex Bomb'
wikisql
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
For those records from the products and each product's manufacturer, show me about the correlation between price and code in a scatter chart.
SELECT T1.Price, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code
nvbench
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 DEPARTMENT ( DEPT_CODE varchar(10), DEPT_NAME varchar(30), SCHOOL_CODE varchar(8), EMP_NU...
Draw a bar chart for what is the first name and GPA of every student that has a GPA lower than average?, and display from high to low by the names.
SELECT STU_FNAME, SUM(STU_GPA) FROM STUDENT WHERE STU_GPA < (SELECT AVG(STU_GPA) FROM STUDENT) GROUP BY STU_FNAME ORDER BY STU_FNAME DESC
nvbench
CREATE TABLE table_26600 ( "Week" real, "Date" text, "Opponent" text, "Location" text, "Final Score" text, "Attendance" real, "Record" text )
Name the number of dates for alouettes
SELECT COUNT("Date") FROM table_26600 WHERE "Opponent" = 'Alouettes'
wikisql
CREATE TABLE table_name_17 ( gold INTEGER, bronze VARCHAR, rank VARCHAR )
What is the average gold with a bronze smaller than 5 with a rank of 8?
SELECT AVG(gold) FROM table_name_17 WHERE bronze < 5 AND rank = "8"
sql_create_context
CREATE TABLE table_73055 ( "Name" text, "Nickname" text, "First season" text, "Location" text, "Home ground(s)" text, "Coach" text, "Captain" text )
With the nickname the swans, what is the home ground?
SELECT "Home ground(s)" FROM table_73055 WHERE "Nickname" = 'Swans'
wikisql
CREATE TABLE table_22753245_1 ( margin VARCHAR, party VARCHAR, winner VARCHAR )
How many margin results are listed in the election that was won by L. Adaikalaraj C and the party was the Indian national congress?
SELECT COUNT(margin) FROM table_22753245_1 WHERE party = "Indian National Congress" AND winner = "L. Adaikalaraj c"
sql_create_context
CREATE TABLE table_204_153 ( id number, "tournament" text, "2001" text, "2002" text, "2003" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text, "2013" text, "2014" text, "w-l" text ...
what tournament has 5-5 as it 's w l record ?
SELECT "tournament" FROM table_204_153 WHERE "tournament" = '5-5'
squall
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
count the number of patients whose primary disease is coronary artery disease\coronary artery bypass graft /sda and year of birth is less than 2097?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT /SDA" AND demographic.dob_year < "2097"
mimicsql_data
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, ...
how many people received a cont inv mec ven <96 hrs procedure within 2 months after they had been diagnosed with anemia-other chronic dis since 1 year ago?
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'anemia-other chron...
mimic_iii
CREATE TABLE table_75818 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What is the Location and Attendance with a Record of 21 22?
SELECT "Location Attendance" FROM table_75818 WHERE "Record" = '21–22'
wikisql
CREATE TABLE table_dev_28 ( "id" int, "gender" string, "systolic_blood_pressure_sbp" int, "consent" bool, "hemoglobin_a1c_hba1c" float, "hematocrit_hct" float, "fasting_triglycerides" int, "fasting_blood_glucose_fbg" float, "diastolic_blood_pressure_dbp" int, "hba1c" float, "...
hematocrit of less than or equal to 30 % .
SELECT * FROM table_dev_28 WHERE hematocrit_hct <= 30
criteria2sql
CREATE TABLE table_name_42 ( date VARCHAR, away_team VARCHAR )
Which Date has an Away team of south melbourne?
SELECT date FROM table_name_42 WHERE away_team = "south melbourne"
sql_create_context
CREATE TABLE table_75550 ( "Week" real, "Date" text, "Opponent" text, "Location" text, "Time ( ET )" text, "Result" text, "Record" text )
What is the record of the game that has a result of w 45 17?
SELECT "Record" FROM table_75550 WHERE "Result" = 'w 45–17'
wikisql
CREATE TABLE table_train_229 ( "id" int, "hemoglobin_a1c_hba1c" float, "active_metabolic" bool, "body_weight" float, "hba1c" float, "age" float, "NOUSE" float )
minimal weight of 40 kg
SELECT * FROM table_train_229 WHERE body_weight >= 40
criteria2sql
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, ...
需要查看04251278145这个检验报告出报告单的年、月、日
SELECT BGRQ FROM jybgb WHERE BGDH = '04251278145'
css
CREATE TABLE table_31653 ( "Year" real, "Competition" text, "Date" text, "Location" text, "Score" text, "Result" text )
What was the result of Sopot (pol)?
SELECT "Result" FROM table_31653 WHERE "Location" = 'sopot (pol)'
wikisql
CREATE TABLE table_dev_20 ( "id" int, "anemia" bool, "gender" string, "systolic_blood_pressure_sbp" int, "hemoglobin_a1c_hba1c" float, "platelets" int, "dyslipidemia" bool, "renal_disease" bool, "creatinine_clearance_cl" float, "neutropenia" int, "estimated_glomerular_filtrat...
anemia ( hemoglobin < 12 g / dl in male , < 11 g / dl in female )
SELECT * FROM table_dev_20 WHERE anemia = 1 OR ((gender = 'male' AND hemoglobin_a1c_hba1c < 12) OR (gender = 'female' AND hemoglobin_a1c_hba1c < 11))
criteria2sql
CREATE TABLE table_4340 ( "Engine" text, "Horsepower" text, "Torque" text, "Carburetor" text, "Compression Ratio" text, "Bore & Stroke" text, "VIN Code" text )
Tell me the VIN code for compression ratio of 10.50:1
SELECT "VIN Code" FROM table_4340 WHERE "Compression Ratio" = '10.50:1'
wikisql
CREATE TABLE table_name_89 ( competition VARCHAR, position VARCHAR, year VARCHAR )
Which competition held the 1st position in 2009?
SELECT competition FROM table_name_89 WHERE position = "1st" AND year = 2009
sql_create_context
CREATE TABLE table_204_128 ( id number, "region" text, "date" text, "label" text, "format" text, "catalog" text )
which region was the last to release ?
SELECT "region" FROM table_204_128 ORDER BY "date" DESC LIMIT 1
squall
CREATE TABLE table_23536 ( "Year" text, "Winner" text, "First Runner Up" text, "Third Place" text, "Consolation Winner/4th" text, "Finals Location" text )
When did Austin Austin TX get the third place?
SELECT "Year" FROM table_23536 WHERE "Third Place" = 'Austin Austin TX'
wikisql
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 the number of patients whose admission location is emergency room admit and lab test name is eosinophils?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND lab.label = "Eosinophils"
mimicsql_data
CREATE TABLE table_77091 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Nets points" real, "Opponents" real, "Record" text, "Streak" text )
How many opponents were there in a game higher than 20 on January 28?
SELECT "Opponents" FROM table_77091 WHERE "Game" > '20' AND "Date" = 'january 28'
wikisql
CREATE TABLE table_name_70 ( name VARCHAR, college VARCHAR, aafc_team VARCHAR, position VARCHAR )
Which Name has a AAFC Team of los angeles dons, and a Position of fb, and a College of oklahoma a&m?
SELECT name FROM table_name_70 WHERE aafc_team = "los angeles dons" AND position = "fb" AND college = "oklahoma a&m"
sql_create_context
CREATE TABLE table_56383 ( "Bowling figures Wickets-Runs (Overs)" text, "Bowler" text, "Versus" text, "Venue" text, "Date" text )
During the competition at Port Elizabeth, where the opponent was Australia, what were the bowling figures?
SELECT "Bowling figures Wickets-Runs (Overs)" FROM table_56383 WHERE "Venue" = 'port elizabeth' AND "Versus" = 'australia'
wikisql
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
病人孙子怡的医疗记录中,有过哪些医疗费总额超过3407.67元的信息,看看入院诊断疾病名和编码分别是什么
SELECT OUT_DIAG_DIS_CD, OUT_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_NM = '孙子怡' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc24 WHERE MED_AMOUT > 3407.67)
css
CREATE TABLE ENROLL ( CLASS_CODE varchar(5), STU_NUM int, ENROLL_GRADE varchar(50) ) 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 DEPARTM...
A bar chart about what are the total number of credits offered by each department?, list in desc by the x-axis.
SELECT DEPT_CODE, SUM(T1.CRS_CREDIT) FROM COURSE AS T1 JOIN CLASS AS T2 ON T1.CRS_CODE = T2.CRS_CODE GROUP BY T1.DEPT_CODE ORDER BY DEPT_CODE DESC
nvbench
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 average age of patients whose admission type is emergency and primary disease is pituitary bleed?
SELECT AVG(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.diagnosis = "PITUITARY BLEED"
mimicsql_data
CREATE TABLE table_69577 ( "Year" real, "Team" text, "Chassis" text, "Engine" text, "Rank" text, "Points" real )
Which chassis is ranked 24th?
SELECT "Chassis" FROM table_69577 WHERE "Rank" = '24th'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
give me the number of patients whose diagnoses short title is arthropathy nos-unspec and lab test name is urobilinogen?
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 = "Arthropathy NOS-unspec" AND lab.label = "Urobilinogen"
mimicsql_data
CREATE TABLE table_54629 ( "Rank" real, "English title" text, "Chinese title" text, "Average" real, "Peak" real, "Premiere" real, "Finale" real, "HK viewers" text )
How many entries have a HK viewers of 2.23 million, and a Rank below 2?
SELECT COUNT("Peak") FROM table_54629 WHERE "HK viewers" = '2.23 million' AND "Rank" > '2'
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
find the number of patients whose admission location is phys referral/normal deli and were diagnosed with subarachnoid hemorrhage.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND diagnoses.short_title = "Subarachnoid hemorrhage"
mimicsql_data
CREATE TABLE gwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
看看在医疗机构1539337的记录里,这位窦霞月的患者在06年6月24日到13年2月13日期间接受了多少次检查
SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '窦霞月' AND t_kc22.STA_DATE BETWEEN '2006-06-24' AND '2013-02-13' AND gwyjzb.MED_SER_ORG_NO = '1539337' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_...
css
CREATE TABLE table_11783 ( "Date" text, "Venue" text, "Result" text, "Competition" text, "Scored" real )
What is the average number scored in a friendly at kryoia soveto, moscow?
SELECT AVG("Scored") FROM table_11783 WHERE "Competition" = 'friendly' AND "Venue" = 'kryoia soveto, moscow'
wikisql
CREATE TABLE table_27776 ( "Season" real, "Series" text, "Team" text, "Races" real, "Wins" real, "Poles" real, "F/Laps" real, "Podiums" real, "Points" text, "Position" text )
What was his minimum number wins in a single year?
SELECT MIN("Wins") FROM table_27776
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number...
calculate the two year survival probability of patients that were prescribed nacl 0.9% mbp after they were diagnosed with abdominal compartment syndrome?
SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 2 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid...
eicu
CREATE TABLE table_204_561 ( id number, "fence" number, "name" text, "jockey" text, "age" number, "handicap (st-lb)" text, "starting price" text, "fate" text )
who is the last horse on the list that was pulled up ?
SELECT "name" FROM table_204_561 WHERE "fate" = 'pulled up' ORDER BY id DESC LIMIT 1
squall
CREATE TABLE qtb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
患者华鹏运曾经都做过哪些治疗项目
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_NM = '华鹏运' AND t_kc22.MED_INV_ITEM_TYPE = '治疗费' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.P...
css
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
what number of patients with abdominal abscess had drug type as main?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = "ABDOMINAL ABSCESS" AND prescriptions.drug_type = "MAIN"
mimicsql_data
CREATE TABLE table_name_66 ( lost VARCHAR, matches VARCHAR )
Name the lost for matches of 1 928
SELECT lost FROM table_name_66 WHERE matches = "1 928"
sql_create_context
CREATE TABLE table_203_390 ( id number, "year" number, "venue" text, "winners" text, "runner-up" text, "3rd place" text )
previous to 2008 how many times was sweden the runner up ?
SELECT COUNT(*) FROM table_203_390 WHERE "year" < 2008 AND "runner-up" = 'sweden'
squall
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, ...
What is the number of patients whose procedure icd9 code is 8659?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.icd9_code = "8659"
mimicsql_data
CREATE TABLE Addresses ( address_id VARCHAR, city VARCHAR ) CREATE TABLE Staff ( first_name VARCHAR, last_name VARCHAR, staff_address_id VARCHAR )
Find out the first name and last name of staff lived in city Damianfort.
SELECT T2.first_name, T2.last_name FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T1.city = "Damianfort"
sql_create_context
CREATE TABLE table_63497 ( "Club" text, "Wins" real, "Losses" real, "Draws" real, "Against" real )
What is the average number of wins for the Terang Club, when there are less than 0 draws?
SELECT AVG("Wins") FROM table_63497 WHERE "Club" = 'terang' AND "Draws" < '0'
wikisql