context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
what is the number of patients whose discharge location is disc-tran cancer/chldrn h and diagnoses short title is obstr incisional hernia?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "DISC-TRAN CANCER/CHLDRN H" AND diagnoses.short_title = "Obstr incisional hernia"
mimicsql_data
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
这位邹鹏举的患者在13年9月4日到19年6月28日期间医保的消费金额有多少
SELECT SUM(t_kc24.PER_ACC_PAY) FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_NM = '邹鹏举' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2013-09-04' AND '2019-06-28'
css
CREATE TABLE table_18536769_1 ( call_sign VARCHAR, owner VARCHAR )
When vista radio is the owner how many call signs are there?
SELECT COUNT(call_sign) FROM table_18536769_1 WHERE owner = "Vista Radio"
sql_create_context
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE cost ( costid num...
what is the name of drug patient 007-9853 was prescribed during the same day after receiving a treatment of hyperkalemia - dialysis procedure?
SELECT t2.drugname FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-9853') AND treatment.treatmen...
eicu
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...
Give me the comparison about the amount of All_Home over the All_Home , and group by attribute All_Home by a bar chart.
SELECT All_Home, COUNT(All_Home) FROM basketball_match GROUP BY All_Home
nvbench
CREATE TABLE table_80130 ( "Position" real, "Club" text, "Played" real, "Points" text, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real )
What is the average loss with a goal higher than 51 and wins higher than 14?
SELECT AVG("Losses") FROM table_80130 WHERE "Goals against" > '51' AND "Wins" > '14'
wikisql
CREATE TABLE table_3760 ( "Artist" text, "Country" text, "Number-one single(s)" text, "Year" real, "Weeks at #1" real, "Straight to #1 ?" text )
How many weeks was K.Maro at #1?
SELECT MAX("Weeks at #1") FROM table_3760 WHERE "Artist" = 'K.Maro'
wikisql
CREATE TABLE table_54849 ( "Track" real, "Recorded" text, "Catalogue" text, "Release Date" text, "Song Title" text, "Time" text )
What catalogue has a track less than 16 and 2/3/56 recorded with a song titled Lawdy Miss Clawdy?
SELECT "Catalogue" FROM table_54849 WHERE "Track" < '16' AND "Recorded" = '2/3/56' AND "Song Title" = 'lawdy miss clawdy'
wikisql
CREATE TABLE table_train_34 ( "id" int, "gender" string, "allergy_to_adhesive" bool, "contraception" bool, "use_of_cyclosporin" bool, "use_of_digoxin" bool, "liver_disease" bool, "rhabomyolysis" bool, "allergy_to_hydrocortisone" bool, "use_of_statins" bool, "NOUSE" float )
chronic liver disease ( cirrhosis )
SELECT * FROM table_train_34 WHERE liver_disease = 1
criteria2sql
CREATE TABLE table_name_2 ( erp_w VARCHAR, city_of_license VARCHAR )
What is Charleston, SC ERP W?
SELECT erp_w FROM table_name_2 WHERE city_of_license = "charleston, sc"
sql_create_context
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE employees ( EMPLOYE...
For those employees who did not have any job in the past, give me the comparison about the amount of hire_date over the hire_date bin hire_date by time.
SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history)
nvbench
CREATE TABLE table_name_33 ( frequency VARCHAR, facility_id VARCHAR )
Which Frequency has a Facility ID of 13598?
SELECT frequency FROM table_name_33 WHERE facility_id = 13598
sql_create_context
CREATE TABLE table_10699 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Round" real, "Time" text, "Location" text )
I want the location for round of 3 and time of 4:40
SELECT "Location" FROM table_10699 WHERE "Round" = '3' AND "Time" = '4:40'
wikisql
CREATE TABLE table_22815259_1 ( result VARCHAR, cowboys_points VARCHAR )
Name the result for cowboys points being 23
SELECT COUNT(result) FROM table_22815259_1 WHERE cowboys_points = 23
sql_create_context
CREATE TABLE table_25189 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Series" text )
List all high assists in series 2-3.
SELECT "High assists" FROM table_25189 WHERE "Series" = '2-3'
wikisql
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...
Number of questions with dependency-injection and guice tag.
SELECT Id, AcceptedAnswerId, CreationDate FROM Posts WHERE Tags LIKE '%dependency-injection%' AND Tags LIKE '%guice%'
sede
CREATE TABLE table_name_7 ( pick INTEGER, draft VARCHAR, player VARCHAR )
What is the lowest Pick, when Draft is less than 1991, and when Player is 'Tom Sasso Category:Articles with hCards'?
SELECT MIN(pick) FROM table_name_7 WHERE draft < 1991 AND player = "tom sasso category:articles with hcards"
sql_create_context
CREATE TABLE table_30295 ( "Vessel" text, "Built" real, "Max Speed" text, "Length" text, "Breadth" text, "Flag" text, "Propulsion" text )
What is the propulsion when the vessel is marianarray?
SELECT "Propulsion" FROM table_30295 WHERE "Vessel" = 'Marianarray'
wikisql
CREATE TABLE table_17482534_1 ( title VARCHAR, no_in_series VARCHAR )
What is the title of episode number 96 in the series?
SELECT title FROM table_17482534_1 WHERE no_in_series = "96"
sql_create_context
CREATE TABLE ftxmzjzjlb ( 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, MZZYZD...
那个在2001年11月11日到15年3月7日这段时间里,16229426病患的全部检察结果指标记录的检测人为66553479的检查指标流水号是多少?
SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON 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 AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.B...
css
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 ...
门诊给患者韩奇正诊断为疾病Z28.586,那检测指标609254的结果定量及其单位是什么
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb 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 = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZ...
css
CREATE TABLE table_65479 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What is the Attendance of the game against Minnesota Vikings?
SELECT COUNT("Attendance") FROM table_65479 WHERE "Opponent" = 'minnesota vikings'
wikisql
CREATE TABLE phone ( Carrier VARCHAR, Price VARCHAR )
What is the carrier of the most expensive phone?
SELECT Carrier FROM phone ORDER BY Price DESC LIMIT 1
sql_create_context
CREATE TABLE table_10975034_5 ( cfl_team VARCHAR, player VARCHAR )
What is the cfl team with ryan folk?
SELECT cfl_team FROM table_10975034_5 WHERE player = "Ryan Folk"
sql_create_context
CREATE TABLE Faculty ( FacID VARCHAR, fname VARCHAR, lname VARCHAR ) CREATE TABLE Student ( fname VARCHAR, lname VARCHAR, advisor VARCHAR )
Show first name and last name for all the students advised by Michael Goodrich.
SELECT T2.fname, T2.lname FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor WHERE T1.fname = "Michael" AND T1.lname = "Goodrich"
sql_create_context
CREATE TABLE table_name_79 ( episode_number INTEGER, air_date VARCHAR )
What is the lowest of Episode Number that has a Air Date on 20 july 2007?
SELECT MIN(episode_number) FROM table_name_79 WHERE air_date = "20 july 2007"
sql_create_context
CREATE TABLE table_name_83 ( opposing_teams VARCHAR, date VARCHAR )
Who were the opposing teams on 08/02/1969?
SELECT opposing_teams FROM table_name_83 WHERE date = "08/02/1969"
sql_create_context
CREATE TABLE table_name_62 ( year INTEGER, nominated_work VARCHAR, category VARCHAR )
In what year was The House of Blue Leaves nominated for outstanding actress in a play?
SELECT SUM(year) FROM table_name_62 WHERE nominated_work = "the house of blue leaves" AND category = "outstanding actress in a play"
sql_create_context
CREATE TABLE table_name_81 ( attendance INTEGER, date VARCHAR )
How many attended the game on 4 February 2003?
SELECT AVG(attendance) FROM table_name_81 WHERE date = "4 february 2003"
sql_create_context
CREATE TABLE table_3768 ( "No." real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (million)" text )
How many people wrote the episode with a production code of 2j5507?
SELECT COUNT("Written by") FROM table_3768 WHERE "Production code" = '2J5507'
wikisql
CREATE TABLE table_3415 ( "Season" real, "Series" text, "Team" text, "Races" real, "Wins" real, "Poles" real, "F/Laps" real, "Podiums" real, "Points" real, "Position" text )
How many positions are shown for the 2010 season?
SELECT COUNT("Position") FROM table_3415 WHERE "Season" = '2010'
wikisql
CREATE TABLE table_79038 ( "Name" text, "Circuit" text, "Date" text, "Winning driver" text, "Winning constructor" text, "Report" text )
What Circuit has a Winning constructor of bugatti, and a Winning driver of edward bret?
SELECT "Circuit" FROM table_79038 WHERE "Winning constructor" = 'bugatti' AND "Winning driver" = 'edward bret'
wikisql
CREATE TABLE Elimination ( Elimination_ID text, Wrestler_ID text, Team text, Eliminated_By text, Elimination_Move text, Time text ) CREATE TABLE wrestler ( Wrestler_ID int, Name text, Reign text, Days_held text, Location text, Event text )
Draw a scatter chart for what are the reigns and days held of all wrestlers?
SELECT Reign, Days_held FROM wrestler
nvbench
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE Posts ( Id number, PostTypeId number, Accepted...
Azure thread volume with accepted answers by month.
SELECT COUNT(*) AS AnsweredVolume, TIME_TO_STR(P.CreationDate, '%Y') AS "year", TIME_TO_STR(P.CreationDate, '%m') AS Month FROM Posts AS P WHERE (Tags LIKE '%<azure%' OR Tags LIKE '%<windows-azure%' OR Tags LIKE '%<sql-azure>%' OR Tags LIKE '%<tfs-azure>%' OR Tags LIKE '%<servicebus>%' OR Tags LIKE '%<acs>%' OR Tags LI...
sede
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, ...
陶梦秋病人做的下肢各项指标的检验情况咋样
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb 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 = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzb...
css
CREATE TABLE table_34528 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text )
Who is the visitor in Philadelphia on March 6?
SELECT "Visitor" FROM table_34528 WHERE "Home" = 'philadelphia' AND "Date" = 'march 6'
wikisql
CREATE TABLE table_79633 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text, "Arena" text, "Points" real )
What is the Attendance of the game with a Record of 37 21 12 and less than 86 Points?
SELECT AVG("Attendance") FROM table_79633 WHERE "Record" = '37–21–12' AND "Points" < '86'
wikisql
CREATE TABLE table_name_41 ( catalog_nr VARCHAR, title VARCHAR, format VARCHAR, label VARCHAR )
What is the Catalog-Nr of the Epic Label Stereo LP named For Little Ones?
SELECT catalog_nr FROM table_name_41 WHERE format = "stereo lp" AND label = "epic" AND title = "for little ones"
sql_create_context
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE diagnoses_icd ( row_id n...
how many patients had been staying in careunit csru?
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.careunit = 'csru')
mimic_iii
CREATE TABLE table_21378160_2 ( score VARCHAR, round VARCHAR )
What was the score of round 3?
SELECT score FROM table_21378160_2 WHERE round = "3"
sql_create_context
CREATE TABLE table_10713 ( "Result" text, "Record" text, "Opponent" text, "Method" text, "Round" real, "Time" text, "Location" text )
How long was his fight against kim kyoung-suk?
SELECT "Time" FROM table_10713 WHERE "Opponent" = 'kim kyoung-suk'
wikisql
CREATE TABLE airlines ( alid integer, name text, iata varchar(2), icao varchar(3), callsign text, country text, active varchar(2) ) CREATE TABLE routes ( rid integer, dst_apid integer, dst_ap varchar(4), src_apid bigint, src_ap varchar(4), alid bigint, airline va...
What are the number of the countries of all airlines whose names start with Orbit?, could you display in asc by the X?
SELECT country, COUNT(country) FROM airlines WHERE name LIKE 'Orbit%' GROUP BY country ORDER BY country
nvbench
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course_prerequisite ( pre_course_id ...
This semester who will teach Advanced Al Techniques ?
SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN course ON course.course_id = course_offering.course_id INNER JOIN semester...
advising
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), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
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, give me the comparison about the average of manager_id over the job_id , and group by attribute job_id, rank by the total number in asc.
SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY AVG(MANAGER_ID)
nvbench
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, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( ...
find the marital status and diagnosis of the subject id 74032.
SELECT demographic.marital_status, demographic.diagnosis FROM demographic WHERE demographic.subject_id = "74032"
mimicsql_data
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number...
Top stackoverflow users from Karur.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "rank", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%Karur%' OR UPPER(Location) LIKE '%Karur%' OR Location LIKE '%Karur%' ORDER BY Reputation DESC
sede
CREATE TABLE table_77620 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text )
What was the score with a 16 14 6 record?
SELECT "Score" FROM table_77620 WHERE "Record" = '16–14–6'
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_CLINIC_ID text, MED_DIRE_CD tex...
2012年9月30日到2012年12月13日,编号为2529055的医院有多少科室涉及的医疗费总额不低于2796.97元
SELECT COUNT(*) FROM (SELECT gwyjzb.MED_ORG_DEPT_CD FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '2529055' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2012-09-30' AND '2012-12-13' GROUP BY gwyjzb.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) >= 2796.97 UNION SELECT fgwyjzb...
css
CREATE TABLE table_78190 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the crowd size of the match featuring Hawthorn as the Away team?
SELECT "Crowd" FROM table_78190 WHERE "Away team" = 'hawthorn'
wikisql
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE flight_stop ( flight...
which airlines fly from BWI to DALLAS FORT WORTH
SELECT DISTINCT airline.airline_code FROM airline, airport, 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 = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY...
atis
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE lab ( labid numbe...
count the number of patients who have taken a sedative - midazolam two times since 3 years ago.
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, COUNT(*) AS c1 FROM patient WHERE patient.patientunitstayid = (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'sedative - midazolam' AND DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(), '-3 year')) GROUP ...
eicu
CREATE TABLE table_name_48 ( played INTEGER, goals_for VARCHAR, wins VARCHAR )
What is the lowest played number when goals for is 47, and wins is smaller than 14?
SELECT MIN(played) FROM table_name_48 WHERE goals_for = 47 AND wins < 14
sql_create_context
CREATE TABLE table_name_74 ( final_score VARCHAR, stadium VARCHAR )
What was the final score of the game at the astrodome?
SELECT final_score FROM table_name_74 WHERE stadium = "astrodome"
sql_create_context
CREATE TABLE table_66642 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Attendance" text )
Who was the home team that has a tie no of 1?
SELECT "Home team" FROM table_66642 WHERE "Tie no" = '1'
wikisql
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
从02年11月11日起到02年12月10日结束医疗机构6691879计生处理的住院就诊数有多少?
SELECT COUNT(*) FROM zyjzjlb JOIN hz_info_zyjzjlb JOIN hz_info ON hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.zyjzjlb_id = zyjzjlb.zyjzjlb_id AND hz_info_zyjzjlb.YLJGDM = hz_info.YLJGDM WHERE hz_info.YLJGDM = '66...
css
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number,...
what was the name of the medicine that was prescribed to patient 8116 in this hospital encounter for the last time?
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8116 AND admissions.dischtime IS NULL) ORDER BY prescriptions.startdate DESC LIMIT 1
mimic_iii
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, ...
provide the average age of patients who are male and have been diagnosed with brain mass; intracranial hemorrhage.
SELECT AVG(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.diagnosis = "BRAIN MASS;INTRACRANIAL HEMORRHAGE"
mimicsql_data
CREATE TABLE table_170 ( "#" real, "Episode" text, "Air Date" text, "Timeslot (EST)" text, "Rating" text, "Share" text, "18\u201349 Rating" text, "Viewers (millions)" text, "Rank" text )
What is the rating for the episode in which the 18-49 rating is 0.4?
SELECT "Rating" FROM table_170 WHERE "18\u201349 Rating" = '0.4'
wikisql
CREATE TABLE table_name_18 ( location__all_in_nagano__ VARCHAR, name VARCHAR )
Which location includes Sakakita BS?
SELECT location__all_in_nagano__ FROM table_name_18 WHERE name = "sakakita bs"
sql_create_context
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) 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...
what are the three most commonly given lab tests for patients who were diagnosed with reg enteritis, sm intest previously within 2 months, until 2 years ago?
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, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.i...
mimic_iii
CREATE TABLE table_name_33 ( report VARCHAR, winning_driver VARCHAR, circuit VARCHAR )
Which report has a Winning driver of peter collins, and a Circuit of syracuse?
SELECT report FROM table_name_33 WHERE winning_driver = "peter collins" AND circuit = "syracuse"
sql_create_context
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, ...
calculate the duration of patient 6374's stay in the last icu.
SELECT STRFTIME('%j', icustays.outtime) - STRFTIME('%j', icustays.intime) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 6374) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1
mimic_iii
CREATE TABLE zyb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
这家医院6975310的科室中有多少是在04年10月23日到18年10月29日期间的医疗费总额不低于448.65元的?
SELECT COUNT(*) FROM (SELECT qtb.MED_ORG_DEPT_CD FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '6975310' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2004-10-23' AND '2018-10-29' GROUP BY qtb.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) >= 448.65 UNION SELECT gyb.MED_ORG_DEPT_CD FRO...
css
CREATE TABLE table_train_179 ( "id" int, "systolic_blood_pressure_sbp" int, "fasting_plasma_glucose_fpg" float, "diastolic_blood_pressure_dbp" int, "diabetes" bool, "body_mass_index_bmi" float, "triglyceride_tg" float, "hypertension" bool, "age" float, "NOUSE" float )
fasting glucose > 100 mg / dl and < 126 mg / dl all individuals enrolled in the study should have at least 6th grade reading / writing ability.
SELECT * FROM table_train_179 WHERE fasting_plasma_glucose_fpg > 100 AND fasting_plasma_glucose_fpg < 126
criteria2sql
CREATE TABLE table_60373 ( "Nation" text, "Distance" text, "Athlete" text, "Venue" text, "Date" text )
What is Nation, when Date is '2004-07-22'?
SELECT "Nation" FROM table_60373 WHERE "Date" = '2004-07-22'
wikisql
CREATE TABLE table_name_14 ( rank VARCHAR, assists VARCHAR )
What was the rank of the player who had 13 assists?
SELECT rank FROM table_name_14 WHERE assists = "13"
sql_create_context
CREATE TABLE climber ( Climber_ID int, Name text, Country text, Time text, Points real, Mountain_ID int ) CREATE TABLE mountain ( Mountain_ID int, Name text, Height real, Prominence real, Range text, Country text )
Return the countries of the mountains that have a height larger than 5000, and count them by a bar chart
SELECT Country, COUNT(Country) FROM mountain WHERE Height > 5000 GROUP BY Country
nvbench
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...
住院中医诊断在住院就诊41737510564的编号和名称都为什么?
SELECT zyjzjlb.ZYZYZDZZBM, zyjzjlb.ZYZYZDZZMC FROM zyjzjlb WHERE zyjzjlb.JZLSH = '41737510564'
css
CREATE TABLE table_name_40 ( score VARCHAR, record VARCHAR )
Which Score has a Record of 1-2?
SELECT score FROM table_name_40 WHERE record = "1-2"
sql_create_context
CREATE TABLE table_name_44 ( score VARCHAR, opponent_in_the_final VARCHAR )
What was the score when the opponent in the final was iroda tulyaganova?
SELECT score FROM table_name_44 WHERE opponent_in_the_final = "iroda tulyaganova"
sql_create_context
CREATE TABLE table_name_34 ( combination_classification VARCHAR, points_classification VARCHAR, team_classification VARCHAR )
Which Combination classification has Points classification of daniele bennati, and a Team classification of quick step?
SELECT combination_classification FROM table_name_34 WHERE points_classification = "daniele bennati" AND team_classification = "quick step"
sql_create_context
CREATE TABLE city ( City_ID int, County_ID int, Name text, White real, Black real, Amerindian real, Asian real, Multiracial real, Hispanic real ) CREATE TABLE county_public_safety ( County_ID int, Name text, Population int, Police_officers int, Residents_per_offi...
Show white percentages of cities and the crime rates of counties they are in. Plot them as scatter chart.
SELECT White, Crime_rate FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID
nvbench
CREATE TABLE table_203_139 ( id number, "name" text, "abbr." text, "leader" text, "ideology" text, "political position" text, "mps" text )
which party has the most mps ?
SELECT "name" FROM table_203_139 ORDER BY "mps" DESC LIMIT 1
squall
CREATE TABLE table_name_29 ( away_team VARCHAR, tie_no VARCHAR )
Who was the away team when the Tie no was 34?
SELECT away_team FROM table_name_29 WHERE tie_no = "34"
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, ...
Find out the religion of the patient with patient id 26746.
SELECT demographic.religion FROM demographic WHERE demographic.subject_id = "26746"
mimicsql_data
CREATE TABLE table_30736 ( "Region name" text, "State name" text, "Region #" real, "Page count" real, "Regional Page #" text )
What states have a regional page # of 1, 5-7, 9-11, 13-15?
SELECT "State name" FROM table_30736 WHERE "Regional Page #" = '1, 5-7, 9-11, 13-15'
wikisql
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, ...
C# Unanswered questions for archeologists.
SELECT q.Id AS "post_link", q.Tags FROM Posts AS q WHERE (SELECT COUNT(*) FROM Posts AS a WHERE a.ParentId = q.Id AND a.Score > 0) = 0 AND q.CommunityOwnedDate IS NULL AND q.ClosedDate IS NULL AND q.ParentId IS NULL AND q.AcceptedAnswerId IS NULL AND q.Tags LIKE '%c#%' AND q.LastActivityDate <= DATEADD(mm, -6, GETDATE(...
sede
CREATE TABLE table_17118006_2 ( farmers INTEGER, projects VARCHAR )
How many farmers were included by the department with 32 projects?
SELECT MAX(farmers) FROM table_17118006_2 WHERE projects = 32
sql_create_context
CREATE TABLE table_23476629_2 ( hometown VARCHAR, province VARCHAR )
What is the hometown of contestants who are from the province of Huesca?
SELECT hometown FROM table_23476629_2 WHERE province = "Huesca"
sql_create_context
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city...
Is there a lab component for 520 ?
SELECT COUNT(*) > 0 FROM course WHERE department = 'EECS' AND has_lab = 'Y' AND number = 520
advising
CREATE TABLE table_203_285 ( id number, "year" number, "location" text, "gold" text, "silver" text, "bronze" text )
where were the championships held before the 1962 prague championships ?
SELECT "location" FROM table_203_285 WHERE "year" < 1962 ORDER BY "year" DESC LIMIT 1
squall
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 diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime ti...
how many patients have been admitted into a hospital since 2101?
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE STRFTIME('%y', admissions.admittime) >= '2101'
mimic_iii
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...
看看药品621283-a在0一年十二月十九日到0七年十一月十八日,被患者吕德业总共开出过多少次
SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '吕德业' AND t_kc22.STA_DATE BETWEEN '2001-12-19' AND '2007-11-18' AND t_kc22.SOC_SRT_DIRE_CD = '621283-a'
css
CREATE TABLE table_16570286_4 ( wickets INTEGER, average VARCHAR )
What number of wickets were there when the average was 22.66?
SELECT MAX(wickets) FROM table_16570286_4 WHERE average = "22.66"
sql_create_context
CREATE TABLE table_name_35 ( d_47 VARCHAR, d_48 VARCHAR, d_42 VARCHAR )
Name the D 47 when it has a D 48 of d 49 and D 42 of r 42
SELECT d_47 FROM table_name_35 WHERE d_48 = "d 49" AND d_42 = "r 42"
sql_create_context
CREATE TABLE table_name_67 ( crowd INTEGER, date VARCHAR, away_team VARCHAR )
How many Crowd that has a Date on saturday, 29 january and an Away team of collingwood?
SELECT AVG(crowd) FROM table_name_67 WHERE date = "saturday, 29 january" AND away_team = "collingwood"
sql_create_context
CREATE TABLE table_1773707_2 ( length VARCHAR, height VARCHAR )
What are the lengths of the models that are mm (in) tall?
SELECT length FROM table_1773707_2 WHERE height = "mm (in)"
sql_create_context
CREATE TABLE table_name_55 ( away_team VARCHAR, tie_no VARCHAR )
Who were the away team in tie number 20?
SELECT away_team FROM table_name_55 WHERE tie_no = "20"
sql_create_context
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
根据不同的出院诊断疾病编码和科室编码,列出编码为0081088的医院所有医疗就诊记录中患者的平均年龄都是什么?
SELECT MED_ORG_DEPT_CD, OUT_DIAG_DIS_CD, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '0081088' GROUP BY MED_ORG_DEPT_CD, OUT_DIAG_DIS_CD
css
CREATE TABLE table_name_10 ( date_won VARCHAR, championship VARCHAR )
Name the date won for wwe intercontinental championship
SELECT date_won FROM table_name_10 WHERE championship = "wwe intercontinental championship"
sql_create_context
CREATE TABLE table_72229 ( "Country" text, "Interview" text, "Swimsuit" text, "Evening Gown" text, "Average" text )
What was the evening gown score when the swimsuit was 9.61?
SELECT "Evening Gown" FROM table_72229 WHERE "Swimsuit" = '9.61'
wikisql
CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, nu...
How many papers were written on question answering in 2011 through 2016 ?
SELECT DISTINCT COUNT(paper.paperid) FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'question answering' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year >= 2011
scholar
CREATE TABLE table_name_88 ( position VARCHAR, round VARCHAR, pick VARCHAR, college VARCHAR )
Which Notre Dame position has a pick lower than 5 and round 7?
SELECT position FROM table_name_88 WHERE pick < 5 AND college = "notre dame" AND round = 7
sql_create_context
CREATE TABLE table_18428024_3 ( no_in_series VARCHAR, directed_by VARCHAR )
How many series did John Banas direct?
SELECT no_in_series FROM table_18428024_3 WHERE directed_by = "John Banas"
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
how many patients whose diagnoses long title is arterial embolism and thrombosis of lower extremity and lab test abnormal status is abnormal?
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.long_title = "Arterial embolism and thrombosis of lower extremity" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE table_24532 ( "No." real, "Date" text, "Tournament" text, "Winning score" text, "To par" text, "Margin of victory" text, "Runner(s)-up" text, "Winners share ( \u20ac )" real )
What is the date of the winning score 74-67-71-73=285?
SELECT "Date" FROM table_24532 WHERE "Winning score" = '74-67-71-73=285'
wikisql
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, ...
count the number of current patients whose age is in their 40s.
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.dischtime IS NULL AND admissions.age BETWEEN 40 AND 49
mimic_iii
CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturd...
i'd like to make a trip from WASHINGTON to SAN FRANCISCO
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 = 'WASHINGTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN...
atis
CREATE TABLE table_26250199_1 ( result VARCHAR, original_artist VARCHAR )
The original artist Joan Osborne has what result?
SELECT result FROM table_26250199_1 WHERE original_artist = "Joan Osborne"
sql_create_context
CREATE TABLE table_203_289 ( id number, "version" text, "length" text, "album" text, "remixed by" text, "year" number, "comment" text )
what versions are at least 7 minutes long ?
SELECT "version" FROM table_203_289 WHERE "length" >= 7
squall