context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_35056 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
what is the date of the tournament in michalovce
SELECT "Date" FROM table_35056 WHERE "Tournament" = 'michalovce'
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...
编号为6716051的医疗机构在2004年12月11日到2008年12月18日内的总检查费用如何
SELECT SUM(t_kc22.AMOUNT) FROM t_kc22 WHERE t_kc22.t_kc21_MED_SER_ORG_NO = '6716051' AND t_kc22.STA_DATE BETWEEN '2004-12-11' AND '2008-12-18' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE table_name_76 ( rank VARCHAR, total INTEGER )
Name the total number of ranks when total is less than 1
SELECT COUNT(rank) FROM table_name_76 WHERE total < 1
sql_create_context
CREATE TABLE table_name_86 ( lost INTEGER, points VARCHAR, drawn VARCHAR )
What is the sum of losses that have points of 11 and more than 1 draw?
SELECT SUM(lost) FROM table_name_86 WHERE points = 11 AND drawn > 1
sql_create_context
CREATE TABLE table_203_262 ( id number, "year" number, "team" text, "co-drivers" text, "car" text, "class" text, "laps" number, "pos." text, "class\npos." text )
who was john nielsen co driver for team lister in 2004 ?
SELECT "co-drivers" FROM table_203_262 WHERE "year" = 2004 AND "team" = 'lister racing' AND "co-drivers" <> 'john nielsen'
squall
CREATE TABLE table_17043 ( "Player" text, "Position" text, "School" text, "Hometown" text, "MLB Draft" text )
What is the hometown of Bubba Starling?
SELECT "Hometown" FROM table_17043 WHERE "Player" = 'Bubba Starling'
wikisql
CREATE TABLE table_77145 ( "Rank" real, "Mountain Peak" text, "Region" text, "Mountain Range" text, "Location" text )
Which Mountain Peak has a Region of baja california, and a Location of 28.1301 n 115.2206 w?
SELECT "Mountain Peak" FROM table_77145 WHERE "Region" = 'baja california' AND "Location" = '28.1301°n 115.2206°w'
wikisql
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId nu...
Question answered by HDE that contain 'star'.
SELECT q.Id AS "post_link" FROM Posts AS q INNER JOIN Posts AS a ON q.Id = a.ParentId WHERE a.OwnerUserId = '##User:int##' AND q.Body LIKE '%star%'
sede
CREATE TABLE table_42409 ( "City of license" text, "Identifier" text, "Frequency" text, "Power" text, "Class" text, "RECNet" text )
What is Class, when Power is 78 Watts?
SELECT "Class" FROM table_42409 WHERE "Power" = '78 watts'
wikisql
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE comment_instructor ( instructor_id int, ...
500 -level classes , are they offered in the Fall or Winter term ?
SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number BETWEEN 500 AND 500 + 100 AND semester.semester IN ('FA', 'WN') AND semester.semester_id = course_of...
advising
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), ...
For those employees who do not work in departments with managers that have ids between 100 and 200, show me the trend about salary over hire_date with a line chart.
SELECT HIRE_DATE, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE diagnosis ( diagn...
how many hours has elapsed since the first time patient 032-24135 received a lab test for -eos on the current hospital visit?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', lab.labresulttime)) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '032-24135' AND patient.hosp...
eicu
CREATE TABLE table_52877 ( "Date" text, "Score" text, "Set 1" text, "Set 2" text, "Set 3" text, "Total" text )
What is the Set 2 with a Total of 45 12, and a Set 3 with 15 2?
SELECT "Set 2" FROM table_52877 WHERE "Total" = '45–12' AND "Set 3" = '15–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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
Give me the number of white-russian ethnic background patients who have t5 fracture as their primary disease.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND demographic.diagnosis = "T5 FRACTURE"
mimicsql_data
CREATE TABLE table_41529 ( "Player" text, "Position" text, "Date of Birth (Age)" text, "Caps" text, "Province / Club" text )
What is Player, when Caps is Example, and when Position is Center?
SELECT "Player" FROM table_41529 WHERE "Caps" = 'example' AND "Position" = 'center'
wikisql
CREATE TABLE table_18424435_5 ( directed_by VARCHAR, us_air_date VARCHAR )
Who directed the episode that aired on July 29, 2011?
SELECT directed_by FROM table_18424435_5 WHERE us_air_date = "July 29, 2011"
sql_create_context
CREATE TABLE table_name_36 ( total VARCHAR, silver VARCHAR, rank VARCHAR, nation VARCHAR )
What is the total number of Total with more than 16 rank for the nation of Romania with more than 0 for silver?
SELECT COUNT(total) FROM table_name_36 WHERE rank > 16 AND nation = "romania" AND silver > 0
sql_create_context
CREATE TABLE Guests ( guest_id INTEGER, gender_code CHAR(1), guest_first_name VARCHAR(80), guest_last_name VARCHAR(80), date_of_birth DATETIME ) CREATE TABLE Apartment_Facilities ( apt_id INTEGER, facility_code CHAR(15) ) CREATE TABLE Apartment_Bookings ( apt_booking_id INTEGER, ap...
How many apartment bookings in each weekday? Show me a bar chart binning booking end date by weekday, could you display Y-axis in asc order?
SELECT booking_end_date, COUNT(booking_end_date) FROM Apartment_Bookings ORDER BY COUNT(booking_end_date)
nvbench
CREATE TABLE table_37243 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text )
On what Date is the Minnesota Vikings the Opponent?
SELECT "Date" FROM table_37243 WHERE "Opponent" = 'minnesota vikings'
wikisql
CREATE TABLE table_name_53 ( nationality VARCHAR, position VARCHAR, school_club_team VARCHAR )
What is the nationality of the guard who played for Florida International?
SELECT nationality FROM table_name_53 WHERE position = "guard" AND school_club_team = "florida international"
sql_create_context
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE T...
Quickest new contributor answers to new contributor questions.
WITH FirstPosts AS (SELECT MIN(Id) AS PostId FROM Posts WHERE OwnerUserId > 0 GROUP BY OwnerUserId) SELECT A.Id AS "post_link", Q.OwnerUserId AS "user_link", A.OwnerUserId AS "user_link", CAST((JULIANDAY(A.CreationDate) - JULIANDAY(Q.CreationDate)) AS INT) AS Seconds FROM Posts AS Q, Posts AS A WHERE A.ParentId = Q.Id ...
sede
CREATE TABLE table_name_65 ( goals_against INTEGER, goal_difference VARCHAR, position VARCHAR, points VARCHAR, goals_for VARCHAR )
Which Goals against has Points smaller than 26, and Goals for smaller than 38, and a Position larger than 14, and a Goal Difference smaller than -32?
SELECT MAX(goals_against) FROM table_name_65 WHERE points < 26 AND goals_for < 38 AND position > 14 AND goal_difference < -32
sql_create_context
CREATE TABLE table_29352 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (millions)" text )
Who wrote the episode that aired on September 26, 2010?
SELECT "Written by" FROM table_29352 WHERE "Original air date" = 'September 26, 2010'
wikisql
CREATE TABLE table_44452 ( "Season" text, "Races" real, "Wins" real, "Podiums" real, "Poles" real )
What is Season, when Races is less than 16?
SELECT "Season" FROM table_44452 WHERE "Races" < '16'
wikisql
CREATE TABLE table_36852 ( "Result" text, "Date" text, "Race" text, "Venue" text, "Group" text, "Distance" text, "Weight (kg)" real, "Time" text, "Jockey" text, "Winner/2nd" text )
What was the time for the G2 group at the Hobartville Stakes?
SELECT "Time" FROM table_36852 WHERE "Group" = 'g2' AND "Race" = 'hobartville stakes'
wikisql
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, ...
list all UA flights from BOSTON to SAN FRANCISCO with fare code QX
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, fare, flight, flight_fare WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND fare.fare_basis_code = 'QX' AND flight_fare.fare_i...
atis
CREATE TABLE table_name_65 ( rank VARCHAR, event VARCHAR )
What is Rank, when Event is 'LAPT3 Punta Del Este'?
SELECT rank FROM table_name_65 WHERE event = "lapt3 punta del este"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text...
在2004年1月21日到2017年9月23日之间患者孔幼怡就诊过的医生统共有多少个?
SELECT COUNT(wdmzjzjlb.ZZYSGH) FROM person_info JOIN hz_info JOIN wdmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE person_info.XM = '孔幼怡' AND wdmzjzjlb.JZKSRQ BETWEEN '2004-01-21' AND '2017-09-23' UNION SELECT COUNT(bd...
css
CREATE TABLE table_27756314_8 ( date VARCHAR, team VARCHAR )
What is the date for the game with team orlando?
SELECT date FROM table_27756314_8 WHERE team = "Orlando"
sql_create_context
CREATE TABLE table_name_61 ( location VARCHAR, aircraft VARCHAR )
What was the location of the Ju-52 aircraft?
SELECT location FROM table_name_61 WHERE aircraft = "ju-52"
sql_create_context
CREATE TABLE table_name_18 ( date VARCHAR, name VARCHAR )
what is the date for tirrana?
SELECT date FROM table_name_18 WHERE name = "tirrana"
sql_create_context
CREATE TABLE table_61095 ( "Name" text, "Date" text, "Year" real, "Location" text, "Killed" text, "Injured" text )
What is Name, when Location is 'DZ'?
SELECT "Name" FROM table_61095 WHERE "Location" = 'dz'
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
what is the number of patients whose drug name is metformin (glucophage)?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "MetFORMIN (Glucophage)"
mimicsql_data
CREATE TABLE table_204_421 ( id number, "name" text, "nationality" text, "position" text, "spartak career" text, "appearances" number, "goals" number )
baranov has played from 2004 to the present . what is his nationality ?
SELECT "nationality" FROM table_204_421 WHERE "name" = 'vasili baranov'
squall
CREATE TABLE Courses ( course_id INTEGER, author_id INTEGER, subject_id INTEGER, course_name VARCHAR(120), course_description VARCHAR(255) ) CREATE TABLE Subjects ( subject_id INTEGER, subject_name VARCHAR(120) ) CREATE TABLE Course_Authors_and_Tutors ( author_id INTEGER, author_tu...
Return a bar chart about the distribution of password and author_tutor_ATB .
SELECT password, author_tutor_ATB FROM Course_Authors_and_Tutors ORDER BY personal_name
nvbench
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 ...
病患36963389检测丙戊酸在2012年2月7日起到2019年5月3日结束的医务人员工号及姓名分别是什么?
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE jyjgzbb.JYRQ BETWEEN '2012-02-07' AND '2019-05-0...
css
CREATE TABLE table_1225 ( "Round #" real, "Pick #" real, "Player" text, "Position" text, "College" text )
Who was the highest pick
SELECT MIN("Pick #") FROM table_1225
wikisql
CREATE TABLE table_13400 ( "2012" real, "2011" real, "2010" real, "2009" real, "2008" real )
Which 2009 has a 2012 larger than 9,265?
SELECT MAX("2009") FROM table_13400 WHERE "2012" > '9,265'
wikisql
CREATE TABLE table_name_72 ( crowd INTEGER, away_team VARCHAR )
What was the crowd when the away team was hawthorn?
SELECT MIN(crowd) FROM table_name_72 WHERE away_team = "hawthorn"
sql_create_context
CREATE TABLE table_14429 ( "Estimate" text, "Name" text, "Nat." text, "Ship Type" text, "Principal victims" text, "Where sunk" text, "Date" text )
Who were the victims of the US ship that sank in the Mississippi River near Memphis?
SELECT "Principal victims" FROM table_14429 WHERE "Nat." = 'us' AND "Where sunk" = 'mississippi river near memphis'
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescription...
how many patients whose discharge location is left against medical advi and year of birth is less than 1887?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "LEFT AGAINST MEDICAL ADVI" AND demographic.dob_year < "1887"
mimicsql_data
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...
把团伙成员魏德水最常开的药品排序出来是啥样?
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '魏德水' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC
css
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...
My answers, by answer date. My answers ordered by score
SELECT q.Id, q.Title, q.Body, a.Id, a.Body, a.CreationDate, a.LastEditDate, a.LastEditorUserId, a.Score FROM Posts AS q INNER JOIN Posts AS a ON q.Id = a.ParentId AND a.PostTypeId = 2 AND q.PostTypeId = 1 WHERE a.OwnerUserId = '##UserId##' ORDER BY a.CreationDate
sede
CREATE TABLE entrepreneur ( entrepreneur_id number, people_id number, company text, money_requested number, investor text ) CREATE TABLE people ( people_id number, name text, height number, weight number, date_of_birth text )
What are the names of entrepreneurs?
SELECT T2.name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.people_id = T2.people_id
spider
CREATE TABLE table_name_45 ( position VARCHAR, overall VARCHAR, pick__number VARCHAR )
Which Position has an Overall larger than 147, and a Pick # of 21?
SELECT position FROM table_name_45 WHERE overall > 147 AND pick__number = 21
sql_create_context
CREATE TABLE table_15471 ( "Year" real, "Team" text, "Chassis" text, "Engine" text, "Points" real )
What year did the Cosworth v8 engine participate in?
SELECT AVG("Year") FROM table_15471 WHERE "Engine" = 'cosworth v8'
wikisql
CREATE TABLE table_name_94 ( Id VARCHAR )
What is 1984, when 1979 is '1R'?
SELECT 1984 FROM table_name_94 WHERE 1979 = "1r"
sql_create_context
CREATE TABLE people ( Birth_Place VARCHAR )
How many distinct birth places are there?
SELECT COUNT(DISTINCT Birth_Place) FROM people
sql_create_context
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( c...
for the first time in 08/last year, when did patient 031-23605 receive urine, catheter specimen microbiology test?
SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-23605')) AND microlab.culturesite = 'urine, catheter specimen...
eicu
CREATE TABLE table_66101 ( "Continent" text, "Location" text, "City" text, "Date" text, "Year" real )
What location had a year of 1971 and a city of Tokyo?
SELECT "Location" FROM table_66101 WHERE "Year" = '1971' AND "City" = 'tokyo'
wikisql
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 jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY...
For all employees who have the letters D or S in their first name, a line chart shows the change of salary over hire_date, and sort by the x axis in ascending.
SELECT HIRE_DATE, SALARY FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY HIRE_DATE
nvbench
CREATE TABLE table_12280396_1 ( county VARCHAR, elevation__m_ VARCHAR )
What is the county with an elevation of 1262?
SELECT county FROM table_12280396_1 WHERE elevation__m_ = 1262
sql_create_context
CREATE TABLE table_203_396 ( id number, "year" number, "domestic passengers" number, "international passengers" number, "total passengers" number, "change" text )
how many years did international passengers number at least 100,000 ?
SELECT COUNT("year") FROM table_203_396 WHERE "international passengers" >= 100000
squall
CREATE TABLE table_203_667 ( id number, "year" number, "driver" text, "co-driver" text, "car" text, "notes" text )
do chipper adams and justin beyendeza have more than 3 wins ?
SELECT (SELECT COUNT(*) FROM table_203_667 WHERE "driver" = 'chipper adams' AND "co-driver" = 'justin beyendeza') > 3
squall
CREATE TABLE table_73697 ( "Season" real, "Celebrity" text, "Notability/Profession" text, "Professional partner" text, "Finish" text )
What was the profession of the celebrity who was featured on season 15 and finished 7th place?
SELECT "Notability/Profession" FROM table_73697 WHERE "Season" = '15' AND "Finish" = '7th'
wikisql
CREATE TABLE table_name_60 ( winner VARCHAR, score VARCHAR )
Which winner won by a score of 6 7(4), 7 6(3), [11 9]?
SELECT winner FROM table_name_60 WHERE score = "6–7(4), 7–6(3), [11–9]"
sql_create_context
CREATE TABLE table_52744 ( "Date" text, "Visiting Team" text, "Final Score" text, "Host Team" text, "Stadium" text )
During the game at Candlestick Park, who was the visiting team?
SELECT "Visiting Team" FROM table_52744 WHERE "Stadium" = 'candlestick park'
wikisql
CREATE TABLE table_225200_4 ( district VARCHAR, reason_for_change VARCHAR )
Name the district for rep. warren r. davis died during previous congress
SELECT district FROM table_225200_4 WHERE reason_for_change = "Rep. Warren R. Davis died during previous congress"
sql_create_context
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, ...
how many patients of black/haitian ethnicity had their lab test item id 50904?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "BLACK/HAITIAN" AND lab.itemid = "50904"
mimicsql_data
CREATE TABLE table_63452 ( "Rank" real, "Athlete" text, "Country" text, "Time" text, "Notes" text )
What country is ranked higher than 5?
SELECT "Country" FROM table_63452 WHERE "Rank" > '5'
wikisql
CREATE TABLE table_name_99 ( year INTEGER, venue VARCHAR, margin VARCHAR )
Name the average year for brookvale oval and margin more than 46
SELECT AVG(year) FROM table_name_99 WHERE venue = "brookvale oval" AND margin > 46
sql_create_context
CREATE TABLE table_name_49 ( year INTEGER, chassis VARCHAR )
What is the average Year with Chassis equalling cooper t60?
SELECT AVG(year) FROM table_name_49 WHERE chassis = "cooper t60"
sql_create_context
CREATE TABLE table_name_90 ( after_debt VARCHAR, total_receipts VARCHAR )
What is the after debt has receipts of $379,794?
SELECT after_debt FROM table_name_90 WHERE total_receipts = "$379,794"
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 are admitted before the year 2168 and followed the procedure, procedure on two vessels?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2168" AND procedures.long_title = "Procedure on two vessels"
mimicsql_data
CREATE TABLE table_77886 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
On which date was the match in Manama, Bahrain?
SELECT "Date" FROM table_77886 WHERE "Venue" = 'manama, bahrain'
wikisql
CREATE TABLE table_23527 ( "Pos" real, "Driver" text, "Vehicle" text, "Top 13 Time" text, "Shoot-Out Time" text, "Best Time of Day" text )
which vehicles got best time of day 1:17.17
SELECT "Vehicle" FROM table_23527 WHERE "Best Time of Day" = '1:17.17'
wikisql
CREATE TABLE table_62 ( "Crop (kilotonnes)" text, "New South Wales" real, "Victoria" real, "Queensland" real, "Western Australia" real, "South Australia" real, "Tasmania" real, "Total" real )
what's the minimum tasmania value
SELECT MIN("Tasmania") FROM table_62
wikisql
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId...
duplicate questions where answers have bounties.
WITH pclosed AS (SELECT p.Id AS id FROM Posts AS p INNER JOIN PostHistory AS ph ON ph.PostId = p.Id WHERE p.PostTypeId = 1 AND ph.PostHistoryTypeId = 10 AND ph.Comment = 101 AND ClosedDate > 0), aclosed AS (SELECT a.Id AS id FROM Posts AS a INNER JOIN pclosed ON a.ParentId = pclosed.Id), closedbounty AS (SELECT pclosed...
sede
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE jybgb ( BBCJBW text, BBDM tex...
名叫奚芳芳的病患的检验报告单的报告日期在14年4月18日以前的是在哪些住院门诊的?列出流水号
SELECT wdmzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN wdmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE person_info.XM = '奚芳芳' AND NOT wdmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2014-04-1...
css
CREATE TABLE loan ( loan_id text, loan_type text, cust_id text, branch_id text, amount number ) CREATE TABLE customer ( cust_id text, cust_name text, acc_type text, acc_bal number, no_of_loans number, credit_score number, branch_id number, state text ) CREATE TABLE ...
Find the number of different cities which banks are located at.
SELECT COUNT(DISTINCT city) FROM bank
spider
CREATE TABLE table_72000 ( "Call sign" text, "Frequency MHz" real, "City of license" text, "ERP W" real, "Class" text, "FCC info" text )
Give me the MHz Frequency of Allapattah, Florida.
SELECT "Frequency MHz" FROM table_72000 WHERE "City of license" = 'allapattah, florida'
wikisql
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) 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), CO...
For all employees who have the letters D or S in their first name, show me about the distribution of job_id and the sum of department_id , and group by attribute job_id in a bar chart, order by the X in ascending.
SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID
nvbench
CREATE TABLE table_30822 ( "Rank" real, "Rider" text, "Country" text, "Winning span" text, "MotoGP/500cc" real, "350cc" real, "Moto2/250cc" real, "Moto3/125cc" real, "80cc/50cc" real, "Total" real )
What is the minimum MotoGP/500cc ranking?
SELECT MIN("MotoGP/500cc") FROM table_30822
wikisql
CREATE TABLE table_50473 ( "Rank" real, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the total for the team with 0 bronze and 3 silver?
SELECT SUM("Total") FROM table_50473 WHERE "Bronze" = '0' AND "Silver" = '3'
wikisql
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE...
Is ARTDES 454 an option for Core ?
SELECT COUNT(*) > 0 FROM course, program, program_course WHERE course.department = 'ARTDES' AND course.number = 454 AND program_course.category LIKE '%Core%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_id = program_course.program_id
advising
CREATE TABLE table_40011 ( "Date" text, "Score" text, "Set 1" text, "Set 2" text, "Set 3" text, "Set 4" text, "Set 5" text, "Total" text )
What set 2 has a set 4 of 21-25?
SELECT "Set 2" FROM table_40011 WHERE "Set 4" = '21-25'
wikisql
CREATE TABLE t_kc21 ( 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, ...
列出对于凤锐达患者医疗记录中医疗费总额高于7564.57元的入院诊断疾病号码和名称都是哪些?
SELECT t_kc21.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_NM = '凤锐达' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 7564.57)
css
CREATE TABLE table_30007801_1 ( Id VARCHAR )
What is the smallest 1st runner up value?
SELECT MIN(1 AS st_runner_up) FROM table_30007801_1
sql_create_context
CREATE TABLE table_22921 ( "Self-identification" text, "Moldovan census" real, "% Core Moldova" text, "Transnistrian census" real, "% Transnistria + Bender" text, "Total" real, "%" text )
Name the % for total being 57613
SELECT "%" FROM table_22921 WHERE "Total" = '57613'
wikisql
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, ...
在10年9月29日到21年10月4日内患者22625548的所有检验结果指标记录的检测人为马皓轩的检验指标流水号是多少?
SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz...
css
CREATE TABLE table_21509 ( "Fin. Pos" real, "Car No." real, "Driver" text, "Team" text, "Laps" real, "Time/Retired" text, "Grid" real, "Laps Led" real, "Points" text )
How many drivers where there when the time/retired +3 laps and points were 24?
SELECT COUNT("Driver") FROM table_21509 WHERE "Time/Retired" = '+3 Laps' AND "Points" = '24'
wikisql
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefin...
[draft] list answers and score for a given tag.
SELECT Posts.Id AS "post_link", Score, Posts.CreationDate FROM Posts INNER JOIN PostTags ON Posts.ParentId = PostTags.PostId INNER JOIN Tags ON PostTags.TagId = Tags.Id WHERE Posts.OwnerUserId = @UserId AND Tags.TagName = @Tag ORDER BY Posts.CreationDate
sede
CREATE TABLE table_70690 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text )
What catalog has a format of ED remaster CD and a date of December 19, 2001?
SELECT "Catalog" FROM table_70690 WHERE "Format" = 'ed remaster cd' AND "Date" = 'december 19, 2001'
wikisql
CREATE TABLE table_name_98 ( gold INTEGER, silver VARCHAR, nation VARCHAR )
What is the average value for Gold, when the value for Silver is greater than 2, and when the Nation is West Germany?
SELECT AVG(gold) FROM table_name_98 WHERE silver > 2 AND nation = "west germany"
sql_create_context
CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE field ( fie...
Show me IEEE Visualization papers .
SELECT DISTINCT paper.paperid FROM paper, venue WHERE venue.venueid = paper.venueid AND venue.venuename = 'IEEE Visualization'
scholar
CREATE TABLE table_name_28 ( champion VARCHAR, engine VARCHAR, season VARCHAR )
Who was the champion that drove the car with the Ford engine in 1971?
SELECT champion FROM table_name_28 WHERE engine = "ford" AND season = "1971"
sql_create_context
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABL...
IS EARTH 147 a required class for me to graduate ?
SELECT COUNT(*) > 0 FROM course, program_course WHERE course.department = 'EARTH' AND course.number = 147 AND program_course.category LIKE '%Core%' AND program_course.course_id = course.course_id
advising
CREATE TABLE book ( book_id number, title text, issues number, writer text ) CREATE TABLE publication ( publication_id number, book_id number, publisher text, publication_date text, price number )
What are the title and issues of the books?
SELECT title, issues FROM book
spider
CREATE TABLE table_name_68 ( motorway VARCHAR, scheduled_completion VARCHAR, county VARCHAR )
Which motorway is in brod-posavina county and has a scheduled completion in 2013?
SELECT motorway FROM table_name_68 WHERE scheduled_completion = "2013" AND county = "brod-posavina"
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...
what is maximum age of patients whose marital status is married and discharge location is home?
SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.discharge_location = "HOME"
mimicsql_data
CREATE TABLE table_17294 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Series" text )
What is the team of april 25?
SELECT "Team" FROM table_17294 WHERE "Date" = 'April 25'
wikisql
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
Give me the comparison about ACC_Percent over the ACC_Regular_Season , and rank in asc by the bar.
SELECT ACC_Regular_Season, ACC_Percent FROM basketball_match ORDER BY ACC_Regular_Season
nvbench
CREATE TABLE table_name_15 ( jersey__number VARCHAR )
What is the 2000-2001 Team with a Jersey # that is 19?
SELECT 2000 AS _2001_team FROM table_name_15 WHERE jersey__number = 19
sql_create_context
CREATE TABLE table_name_46 ( year INTEGER, team VARCHAR )
Question doesn't make sense since there is no team of pramac d'antin ducati
SELECT MIN(year) FROM table_name_46 WHERE team = "pramac d'antin ducati"
sql_create_context
CREATE TABLE table_14624447_24 ( class VARCHAR, position VARCHAR )
What are all classes for the position SLB?
SELECT class FROM table_14624447_24 WHERE position = "SLB"
sql_create_context
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 demographic (...
what is the number of patients whose age is less than 58 and lab test category is chemistry?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "58" AND lab."CATEGORY" = "Chemistry"
mimicsql_data
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Tags ( Id number, TagName text, Cou...
Top scoring comments for a user (and whether user owned a Q or A on that thread).
SELECT c.Id AS "comment_link", c.Score, c.PostId AS "post_link", c.Text, c.CreationDate, 'posts_on_that_q&a' = (SELECT COUNT(p.Id) FROM Posts AS p WHERE p.OwnerUserId = '##UserId##' AND (p.Id = c.PostId OR p.ParentId = c.PostId OR p.ParentId = (SELECT o.ParentId FROM Posts AS o WHERE o.Id = c.PostId))) FROM Comments AS...
sede
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,...
what is admission time and diagnoses short title of subject name chandra schulman?
SELECT demographic.admittime, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Chandra Schulman"
mimicsql_data
CREATE TABLE table_24820 ( "Condition" text, "Prothrombin time" text, "Partial thromboplastin time" text, "Bleeding time" text, "Platelet count" text )
What is the platelet count when partial thromboplastin time and bleeding time are unaffected?
SELECT "Platelet count" FROM table_24820 WHERE "Partial thromboplastin time" = 'Unaffected' AND "Bleeding time" = 'Unaffected'
wikisql
CREATE TABLE table_77652 ( "Date" text, "Round" text, "Opponents" text, "H / A" text, "Result F\u2013A" text, "Attendance" real )
Which date has roma as opponent and a H/A of A?
SELECT "Date" FROM table_77652 WHERE "Opponents" = 'roma' AND "H / A" = 'a'
wikisql