context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_labitems ( row_id number...
is there any record of microbiology test done for patient 81432 in the previous year?
SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 81432) AND DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')
mimic_iii
CREATE TABLE field ( fieldid int ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREA...
How many papers does jeffrey heer have in chi ?
SELECT DISTINCT COUNT(paper.paperid) FROM author, paper, venue, writes WHERE author.authorname = 'jeffrey heer' AND venue.venueid = paper.venueid AND venue.venuename = 'chi' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
scholar
CREATE TABLE bdmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
自2017.9.16日起,至2018.5.10日止,把患者郑和璧这段时间被开出的所有检验报告单中的标本采集部位给一一列出来
SELECT jybgb.BBCJBW FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb 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 AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = ...
css
CREATE TABLE table_204_985 ( id number, "season" text, "competition" text, "round" text, "club" text, "home" text, "away" text, "aggregate" text )
fc schalke 04 and what other club beat them ?
SELECT "club" FROM table_204_985 WHERE "club" <> 'fc schalke 04' AND "aggregate" < "aggregate"
squall
CREATE TABLE table_203_475 ( id number, "stage" number, "date" text, "route" text, "terrain" text, "length" text, "winner" text )
how many routes have below 100 km total ?
SELECT COUNT("route") FROM table_203_475 WHERE "length" < 100
squall
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...
Post History Types that don't occur.
SELECT Pt.* FROM PostHistoryTypes AS pt LEFT JOIN PostHistory AS ph ON pt.Id = ph.PostHistoryTypeId WHERE ph.PostHistoryTypeId IS NULL
sede
CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Coun...
Give me the comparison about the sum of meter_100 over the meter_200 , and group by attribute meter_200.
SELECT meter_200, SUM(meter_100) FROM swimmer GROUP BY meter_200
nvbench
CREATE TABLE table_17311759_8 ( high_rebounds VARCHAR, game VARCHAR )
Who scored the most rebounds in game 64?
SELECT high_rebounds FROM table_17311759_8 WHERE game = 64
sql_create_context
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,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, JO...
For those employees who do not work in departments with managers that have ids between 100 and 200, a line chart shows the change of department_id over hire_date, and could you display by the X-axis in ascending?
SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY HIRE_DATE
nvbench
CREATE TABLE table_57732 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Series" text )
Name the score for howard (8) high rebounds
SELECT "Score" FROM table_57732 WHERE "High rebounds" = 'howard (8)'
wikisql
CREATE TABLE table_54701 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
When did a home team score 4.12 (36)?
SELECT "Date" FROM table_54701 WHERE "Home team score" = '4.12 (36)'
wikisql
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CR...
what is the amount of days it has elapsed since the first time patient 28443 had a lipids 20% intake on the current icu visit?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', inputevents_cv.charttime)) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28443) AND icustays.outtime IS NULL) ...
mimic_iii
CREATE TABLE table_44578 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
What is the record with a 3:56 time?
SELECT "Record" FROM table_44578 WHERE "Time" = '3:56'
wikisql
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Has_Allergy ( StuID INTEGE...
Return a histogram on how many students live in each city?, and list the total number in ascending order.
SELECT city_code, COUNT(*) FROM Student GROUP BY city_code ORDER BY COUNT(*)
nvbench
CREATE TABLE table_name_68 ( runner_up VARCHAR, location VARCHAR )
Who was the Runner-up in Hossegor?
SELECT runner_up FROM table_name_68 WHERE location = "hossegor"
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic (...
what is the number of patients who underwent radical cystectomy?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.short_title = "Radical cystectomy"
mimicsql_data
CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount numbe...
How many % of questions are accepted / answered?.
SELECT SUM(CASE WHEN NOT AcceptedAnswerId IS NULL THEN 1 ELSE 0 END) AS Accepted, SUM(CASE WHEN AcceptedAnswerId IS NULL THEN 1 ELSE 0 END) AS NotAccepted, SUM(CASE WHEN NOT ClosedDate IS NULL THEN 1 ELSE 0 END) AS Closed, SUM(CASE WHEN AnswerCount = 0 THEN 1 ELSE 0 END) AS Unanswered, COUNT(*) AS Total FROM Posts
sede
CREATE TABLE table_75146 ( "INEGI code" real, "Municipality" text, "Municipal Seat" text, "Area (km 2 )" real, "Population (2005)" real, "Population density (/km 2 )" real, "Human Development Index (2000)" real )
WHat is the amount of Human Development Index (2000) that has a Population (2005) of 54,929, and an Area (km 2 ) larger than 343.6?
SELECT COUNT("Human Development Index (2000)") FROM table_75146 WHERE "Population (2005)" = '54,929' AND "Area (km 2 )" > '343.6'
wikisql
CREATE TABLE table_204_44 ( id number, "face value" number, "\u20ac0.01" number, "\u20ac0.02" number, "\u20ac0.05" number, "\u20ac0.10" number, "\u20ac0.20" number, "\u20ac0.50" number, "\u20ac1.00" number, "\u20ac2.00" number )
how many face values are there on the chart ?
SELECT COUNT("face value") FROM table_204_44
squall
CREATE TABLE table_name_14 ( league_cup_goals INTEGER, fa_cup_goals VARCHAR, fa_cup_apps VARCHAR )
What is the lowest league cup goals for the entry with fa cup goals greater than 0 and FA cup apps larger than 2?
SELECT MIN(league_cup_goals) FROM table_name_14 WHERE fa_cup_goals > 0 AND fa_cup_apps > 2
sql_create_context
CREATE TABLE table_67977 ( "7:00" text, "7:30" text, "8:00" text, "8:30" text, "9:00" text, "9:30" text, "10:00" text, "10:30" text )
What 7:00 has a 9:30 of tout le monde en parle?
SELECT "7:00" FROM table_67977 WHERE "9:30" = 'tout le monde en parle'
wikisql
CREATE TABLE movie ( mid number, title text, year number, director text ) CREATE TABLE reviewer ( rid number, name text ) CREATE TABLE rating ( rid number, mid number, stars number, ratingdate time )
Find the ids of reviewers who didn't only give 4 star.
SELECT rid FROM rating WHERE stars <> 4
spider
CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT ) CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER )
Return a bar chart on what is the average age for a male in each job?, rank in descending by the Y.
SELECT job, AVG(age) FROM Person WHERE gender = 'male' GROUP BY job ORDER BY AVG(age) DESC
nvbench
CREATE TABLE table_23281862_6 ( location_attendance VARCHAR, high_points VARCHAR )
Where was the game in which Carl Landry (25) did the most high points played?
SELECT location_attendance FROM table_23281862_6 WHERE high_points = "Carl Landry (25)"
sql_create_context
CREATE TABLE table_79451 ( "Name" text, "Position" text, "League Apps" text, "League Goals" real, "FA Cup Apps" text, "FA Cup Goals" real, "League Cup Apps" text, "League Cup Goals" real, "Total Apps" text, "Total Goals" real )
What is the most total goals for a player having 0 FA Cup goals and 41 League appearances?
SELECT MAX("Total Goals") FROM table_79451 WHERE "FA Cup Goals" = '0' AND "League Apps" = '41'
wikisql
CREATE TABLE table_name_37 ( chassis VARCHAR, entrant VARCHAR )
Which chassis had an entrant of John Mecom?
SELECT chassis FROM table_name_37 WHERE entrant = "john mecom"
sql_create_context
CREATE TABLE table_27274566_2 ( date VARCHAR, home_team VARCHAR, result VARCHAR )
How many dates are shown for the home team of orlando pirates and result of 1 3?
SELECT COUNT(date) FROM table_27274566_2 WHERE home_team = "Orlando Pirates" AND result = "1–3"
sql_create_context
CREATE TABLE table_27661 ( "Date" text, "Tournament" text, "Location" text, "Opponent" text, "Stadium" text, "Score" text, "Indian Scorers" text )
If the stadium name is the Thuwunna Stadium, what is the date?
SELECT "Date" FROM table_27661 WHERE "Stadium" = 'Thuwunna Stadium'
wikisql
CREATE TABLE table_203_405 ( id number, "week" number, "date" text, "opponent" text, "result" text, "attendance" number )
were there more or less than 15 points scored in week 7 ?
SELECT (SELECT "result" FROM table_203_405 WHERE "week" = 7) > 15
squall
CREATE TABLE table_40124 ( "University" text, "Men's" real, "Women's" real, "Runner-up" real, "Total Championships" real )
How many runner-ups does the university with more than 0 men's and less than 4 total championships have?
SELECT "Runner-up" FROM table_40124 WHERE "Men's" > '0' AND "Total Championships" < '4'
wikisql
CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate real ) CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight re...
A bar chart shows the distribution of Sex and the average of Weight , and group by attribute Sex, show by the bar in desc.
SELECT Sex, AVG(Weight) FROM people GROUP BY Sex ORDER BY Sex DESC
nvbench
CREATE TABLE table_name_64 ( record VARCHAR, opponent VARCHAR )
What is the record when they played New York?
SELECT record FROM table_name_64 WHERE opponent = "new york"
sql_create_context
CREATE TABLE table_2679061_6 ( pick__number INTEGER, player VARCHAR )
What is the highest pick number for player don barber?
SELECT MAX(pick__number) FROM table_2679061_6 WHERE player = "Don Barber"
sql_create_context
CREATE TABLE table_43936 ( "Rank" text, "Event" text, "Place" text, "Name" text, "Prize" text )
What is Rank, when Event is 'LAPT3 Punta Del Este'?
SELECT "Rank" FROM table_43936 WHERE "Event" = 'lapt3 punta del este'
wikisql
CREATE TABLE table_15178 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the largest gold with a Total of 2, and a Rank smaller than 2?
SELECT MAX("Gold") FROM table_15178 WHERE "Total" = '2' AND "Rank" < '2'
wikisql
CREATE TABLE table_76808 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text )
Which player is T3?
SELECT "Player" FROM table_76808 WHERE "Place" = 't3'
wikisql
CREATE TABLE table_32925 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What day did they play on week 4?
SELECT "Date" FROM table_32925 WHERE "Week" = '4'
wikisql
CREATE TABLE table_name_2 ( record VARCHAR, high_points VARCHAR, team VARCHAR )
What is Record, when High Points is 'Thaddeus Young (19)', and when Team is '@ Orlando'?
SELECT record FROM table_name_2 WHERE high_points = "thaddeus young (19)" AND team = "@ orlando"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
give the number of patients whose drug code is desi30o and lab test fluid is joint fluid.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "DESI30O" AND lab.fluid = "Joint Fluid"
mimicsql_data
CREATE TABLE table_10785 ( "Call sign" text, "Frequency MHz" text, "City of license" text, "ERP W" text, "FCC info" text )
Name the city of license for call sign of kcmp
SELECT "City of license" FROM table_10785 WHERE "Call sign" = 'kcmp'
wikisql
CREATE TABLE table_19973 ( "Region" real, "Group A" text, "Group B" text, "Group C" text, "Group D" text, "Group E" text, "Group F" text )
Who is in group c when wisconsin is in group d?
SELECT "Group C" FROM table_19973 WHERE "Group D" = 'Wisconsin'
wikisql
CREATE TABLE table_78449 ( "Building" text, "City" text, "Height" text, "Stories" real, "Status" text )
How tall is the 52 story building?
SELECT "Height" FROM table_78449 WHERE "Stories" = '52'
wikisql
CREATE TABLE table_5111 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
What score has an attendance less than 10,553?
SELECT "Score" FROM table_5111 WHERE "Attendance" < '10,553'
wikisql
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_fl...
what is the FIRST class fare from INDIANAPOLIS to ORLANDO
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, fare_basis, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'INDIANAPOLIS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_cod...
atis
CREATE TABLE diagnoses ( 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, ...
what is primary disease and procedure long title of subject id 22377?
SELECT demographic.diagnosis, procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "22377"
mimicsql_data
CREATE TABLE table_5572 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents in Final" text, "Score in Final" text )
Which Opponents in Final has a Date of september 16, 1990?
SELECT "Opponents in Final" FROM table_5572 WHERE "Date" = 'september 16, 1990'
wikisql
CREATE TABLE table_name_48 ( date VARCHAR, silbert VARCHAR )
What is the date of the poll with Silbert at 10.0%?
SELECT date FROM table_name_48 WHERE silbert = "10.0%"
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 diagnoses ( ...
what is the number of patients with hemochromatos-rbc trans and base drug type?
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.short_title = "Hemochromatos-rbc trans" AND prescriptions.drug_type = "BASE"
mimicsql_data
CREATE TABLE table_name_12 ( away_captain VARCHAR, date VARCHAR )
Which Away captain has a Date of 26,27,28,29 december 1998?
SELECT away_captain FROM table_name_12 WHERE date = "26,27,28,29 december 1998"
sql_create_context
CREATE TABLE table_73680 ( "Name" text, "Position" text, "Period" text, "Appearances\u00b9" real, "Goals\u00b9" real, "Nationality\u00b2" text )
List the player that scored 4 times.
SELECT "Name" FROM table_73680 WHERE "Goals\u00b9" = '4'
wikisql
CREATE TABLE table_name_91 ( role VARCHAR, year VARCHAR )
What was the role in 2001?
SELECT role FROM table_name_91 WHERE year = "2001"
sql_create_context
CREATE TABLE table_name_77 ( segment_a VARCHAR, netflix VARCHAR )
Which segment a's netflix figure is s04e24?
SELECT segment_a FROM table_name_77 WHERE netflix = "s04e24"
sql_create_context
CREATE TABLE match_season ( Season real, Player text, Position text, Country int, Team int, Draft_Pick_Number int, Draft_Class text, College text ) CREATE TABLE country ( Country_id int, Country_name text, Capital text, Official_native_language text ) CREATE TABLE team ...
Show the country names and the corresponding number of players in a bar chart, and I want to order in desc by the Y-axis.
SELECT Country_name, COUNT(*) FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country GROUP BY T1.Country_name ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_67303 ( "Driver" text, "Constructor" text, "Laps" text, "Time/Retired" text, "Grid" text )
What shows for laps when the Time/Retired was +1:08.577?
SELECT "Laps" FROM table_67303 WHERE "Time/Retired" = '+1:08.577'
wikisql
CREATE TABLE table_203_672 ( id number, "week" number, "date" text, "opponent" text, "result" text, "venue" text, "attendance" number )
what is the difference in points scored during the november 19 , 1978 against the denver broncos ?
SELECT ABS("result" - "result") FROM table_203_672 WHERE "date" = 'november 19, 1978'
squall
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, ...
Top 100 users with very similar tag score distribution to you.
WITH Raw AS (SELECT Posts.OwnerUserId AS UserId, PostTags.TagId, SUM(5 - 2 * Votes.VoteTypeId) AS Score FROM Posts, Votes, PostTags WHERE Votes.PostId = Posts.Id AND Votes.VoteTypeId BETWEEN 2 AND 3 AND Posts.PostTypeId = 2 AND Posts.ParentId = PostTags.PostId AND Posts.OwnerUserId > 0 GROUP BY Posts.OwnerUserId, PostT...
sede
CREATE TABLE table_23916539_3 ( record VARCHAR, opponent VARCHAR )
If the opponent is the Stampeders, what is the record?
SELECT record FROM table_23916539_3 WHERE opponent = "Stampeders"
sql_create_context
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE l...
is it patient 013-38992's heartrate ever greater than 74.0 in 12/2105?
SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-38992')) AND vitalperiodic.heartrate > 74.0 AND NOT vitalperiodi...
eicu
CREATE TABLE table_25435 ( "Edition" text, "Round" text, "Date" text, "Against" text, "Surface" text, "Opponent" text, "W\u2013L" text, "Result" text )
Name the surface against monaco
SELECT "Surface" FROM table_25435 WHERE "Against" = 'Monaco'
wikisql
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 mzjzjlb ( HXPLC number, HZXM ...
那些已经被门诊诊断为维生素B缺乏病的病患们的检测指标514736的平均数值以及最值都是多少?
SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDSM = '维生素B缺乏病' AND jyjgzbb.JCZBDM =...
css
CREATE TABLE table_name_63 ( opponent_in_the_final VARCHAR, championship VARCHAR )
Who was the opponent in the championship in Johannesburg, South Africa?
SELECT opponent_in_the_final FROM table_name_63 WHERE championship = "johannesburg, south africa"
sql_create_context
CREATE TABLE table_17628022_2 ( pregame_host VARCHAR, sideline_reporters VARCHAR )
Who were the pregame hosts when the sideline reporters were Steve Armitage and Brenda Irving?
SELECT pregame_host FROM table_17628022_2 WHERE sideline_reporters = "Steve Armitage and Brenda Irving"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
what is diagnoses short title of diagnoses icd9 code 29690?
SELECT diagnoses.short_title FROM diagnoses WHERE diagnoses.icd9_code = "29690"
mimicsql_data
CREATE TABLE table_name_7 ( date VARCHAR, attendance VARCHAR )
When has Attendances of 45,795?
SELECT date FROM table_name_7 WHERE attendance = "45,795"
sql_create_context
CREATE TABLE table_name_55 ( score VARCHAR, away_team VARCHAR )
What is the score when Fulham is the away team?
SELECT score FROM table_name_55 WHERE away_team = "fulham"
sql_create_context
CREATE TABLE table_14218 ( "Rank" real, "Heat" real, "Athlete" text, "Country" text, "Time" real )
What is the sum of rank for the athlete kerron stewart, and a time smaller than 11.05?
SELECT SUM("Rank") FROM table_14218 WHERE "Athlete" = 'kerron stewart' AND "Time" < '11.05'
wikisql
CREATE TABLE table_48231 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Can you tell me the High rebounds that has the Date of november 5?
SELECT "High rebounds" FROM table_48231 WHERE "Date" = 'november 5'
wikisql
CREATE TABLE table_28715942_6 ( original_artist VARCHAR, track VARCHAR )
Who is the original artist of 'Use Somebody'?
SELECT original_artist FROM table_28715942_6 WHERE track = "Use Somebody"
sql_create_context
CREATE TABLE wedding ( Church_ID int, Male_ID int, Female_ID int, Year int ) CREATE TABLE church ( Church_ID int, Name text, Organized_by text, Open_Date int, Continuation_of text ) CREATE TABLE people ( People_ID int, Name text, Country text, Is_Male text, Age ...
A bar chart about the number of countries for all people whose age is smaller than the average, display Y in ascending order.
SELECT Country, COUNT(Country) FROM people WHERE Age < (SELECT AVG(Age) FROM people) GROUP BY Country ORDER BY COUNT(Country)
nvbench
CREATE TABLE table_14422 ( "Date" text, "Opponent" text, "City" text, "Result" text, "Score" text )
What was the result of the game in Milwaukee?
SELECT "Result" FROM table_14422 WHERE "City" = 'milwaukee'
wikisql
CREATE TABLE Document_Types ( document_type_code VARCHAR(10), document_description VARCHAR(255) ) CREATE TABLE Documents ( document_id INTEGER, document_type_code VARCHAR(10), grant_id INTEGER, sent_date DATETIME, response_received_date DATETIME, other_details VARCHAR(255) ) CREATE TAB...
Can you draw the trend of how many date from over the date from?
SELECT date_from, COUNT(date_from) FROM Project_Staff
nvbench
CREATE TABLE table_name_80 ( partner VARCHAR, date VARCHAR )
Who was the partner for the game on October 20, 2013?
SELECT partner FROM table_name_80 WHERE date = "october 20, 2013"
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, ...
what is the number of patients whose primary disease is newborn and year of death is less than or equal to 2122?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "NEWBORN" AND demographic.dod_year <= "2122.0"
mimicsql_data
CREATE TABLE table_name_75 ( bleeding_time VARCHAR, condition VARCHAR )
Which Bleeding has a Condition of congenital afibrinogenemia?
SELECT bleeding_time FROM table_name_75 WHERE condition = "congenital afibrinogenemia"
sql_create_context
CREATE TABLE table_10612 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the date of the game at Princes Park?
SELECT "Date" FROM table_10612 WHERE "Venue" = 'princes park'
wikisql
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...
对于编号是35540831的这个病患其检验报告单的报告日期全部在二一年十二月十五号以前的住院就诊记录以及住院就诊流水号有啥?
SELECT zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '35540831' AND NOT zyjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2012-12-15')
css
CREATE TABLE table_name_69 ( ceremony VARCHAR, nominee VARCHAR )
In which ceremony was Jayant nominated for an award?
SELECT ceremony FROM table_name_69 WHERE nominee = "jayant"
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 microlab ( microl...
how many days have elapsed since patient 027-203413 received a lab test of bedside glucose for the first time in this hospital encounter?
SELECT 1 * (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 = '027-203413' AND patient.hosp...
eicu
CREATE TABLE table_41450 ( "Country" text, "Uranium required 2006-08" text, "% of world demand" text, "Indigenous mining production 2006" text, "Deficit (-surplus)" text )
Which country has an Indigenous mining production 2006 of 0?
SELECT "Country" FROM table_41450 WHERE "Indigenous mining production 2006" = '0'
wikisql
CREATE TABLE table_68656 ( "Member" text, "Party" text, "Electorate" text, "State" text, "Term in office" text )
Which term in office has a qld state, a Party of labor, and an Electorate of fisher?
SELECT "Term in office" FROM table_68656 WHERE "State" = 'qld' AND "Party" = 'labor' AND "Electorate" = 'fisher'
wikisql
CREATE TABLE table_name_42 ( gp_gs INTEGER, avg_g VARCHAR, effic VARCHAR )
What is the lowest gp-gs that has an avg/g less than 234.3, with 410.80 as the effic?
SELECT MIN(gp_gs) FROM table_name_42 WHERE avg_g < 234.3 AND effic = "410.80"
sql_create_context
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id nu...
how many of metoprolol were prescribed to patient 92846 in total in this hospital visit?
SELECT SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 92846 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'metoprolol'
mimic_iii
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE T...
Close votes per tag based on PendingFlags.
SELECT TagName, COUNT(*) FROM (SELECT DISTINCT t.TagName, p.Id FROM PendingFlags AS pf INNER JOIN Posts AS p ON p.Id = pf.PostId INNER JOIN PostTags AS pt ON pt.PostId = p.Id INNER JOIN Tags AS t ON t.Id = pt.TagId WHERE pf.FlagTypeId IN (13, 14) AND p.ClosedDate IS NULL AND p.PostTypeId = 1) AS tq GROUP BY TagName ORD...
sede
CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops int,...
what ground transportation is available at the ATLANTA airport
SELECT DISTINCT ground_service.transport_type FROM airport, airport_service, city, ground_service WHERE airport.airport_code = airport_service.airport_code AND city.city_code = airport_service.city_code AND city.city_name = 'ATLANTA' AND ground_service.airport_code = airport.airport_code
atis
CREATE TABLE table_name_52 ( format VARCHAR, catalog VARCHAR )
For the catalog title DP068-07, what formats are available?
SELECT format FROM table_name_52 WHERE catalog = "dp068-07"
sql_create_context
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propul...
please list the cost of all flights from PHILADELPHIA to DEN airport next sunday
SELECT DISTINCT fare.fare_id FROM airport, airport_service, city, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE (airport.airport_code = 'DEN' AND DATE_DAY_1.day_number = 27 AND DATE_DAY_1.month_number = 8 AND DATE_DAY_1.year = 1991 AND DAYS_1...
atis
CREATE TABLE table_train_92 ( "id" int, "thyroid_disease" bool, "heart_disease" bool, "global_deterioration_scale" int, "rosen_modified_hachinski_ischemic_score" int, "hypertension" bool, "NOUSE" float )
patients with a score of 2 or less on the global deterioration scale
SELECT * FROM table_train_92 WHERE global_deterioration_scale <= 2
criteria2sql
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, star...
Next semester , what classes is Dr. Daniel Ferris teaching ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Daniel Ferris%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.off...
advising
CREATE TABLE table_23157997_13 ( youth_classification VARCHAR, mountains_classification VARCHAR, winner VARCHAR )
Who was the Youth Classification in the race with Kenneth Hanson as Mountains Classification and Lucas Sebastian Haedo as winner?
SELECT youth_classification FROM table_23157997_13 WHERE mountains_classification = "Kenneth Hanson" AND winner = "Lucas Sebastian Haedo"
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemics...
had patient 035-19333 been prescribed cordarone, lactated ringers or lantus last year?
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-19333')) AND medication.drugname IN ('cordarone', 'lactated ringers', ...
eicu
CREATE TABLE table_17751942_4 ( wins VARCHAR, team VARCHAR )
How many wins do the Erie Otters have?
SELECT wins FROM table_17751942_4 WHERE team = "Erie Otters"
sql_create_context
CREATE TABLE table_16278894_1 ( capital VARCHAR, county VARCHAR )
What is the capital of Uasin Gishu county?
SELECT capital FROM table_16278894_1 WHERE county = "Uasin Gishu"
sql_create_context
CREATE TABLE table_name_27 ( total_goals VARCHAR, league_cup_goals INTEGER )
How many Total Goals values have 0 League Cup Goals?
SELECT COUNT(total_goals) FROM table_name_27 WHERE league_cup_goals < 0
sql_create_context
CREATE TABLE table_name_85 ( plural VARCHAR, meaning VARCHAR )
What is the plural for the Meaning of night?
SELECT plural FROM table_name_85 WHERE meaning = "night"
sql_create_context
CREATE TABLE table_name_81 ( yards INTEGER, player VARCHAR, games VARCHAR, reception VARCHAR )
What is the average yards for Jimmie Giles in a game larger than 15 and reception larger than 2?
SELECT AVG(yards) FROM table_name_81 WHERE games > 15 AND reception > 2 AND player = "jimmie giles"
sql_create_context
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
5862783这个医疗机构从零五年八月四日到一零年十一月六日有过多少在转诊门诊的就诊记录
SELECT COUNT(*) FROM mzjzjlb JOIN hz_info_mzjzjlb JOIN hz_info ON hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.mzjzjlb_id = mzjzjlb.mzjzjlb_id AND hz_info_mzjzjlb.YLJGDM = hz_info.YLJGDM WHERE hz_info.YLJGDM = '58...
css
CREATE TABLE table_19261 ( "Player" text, "Touchdowns" real, "Extra points" real, "Field goals" real, "Points" real )
Name the most extra points for john heston
SELECT MAX("Extra points") FROM table_19261 WHERE "Player" = 'John Heston'
wikisql
CREATE TABLE table_14909 ( "Year" real, "Crime Index Total" real, "Violent crime" real, "Non-violent Crime" real, "Crime rate Per 1000" real, "Violent crime Rate per 1000" real, "Non-violent crime Rate per 1000" real, "Murder" real, "Rape" real, "Robbery" real, "Aggravated As...
Which non-violent crime rate per 1000 peope has the following criteria: crime rate per 1000 greater than 82.8, violent crime smaller than 305, robbery less than 147 and a crime index total greater than 1540?
SELECT AVG("Violent crime Rate per 1000") FROM table_14909 WHERE "Crime rate Per 1000" > '82.8' AND "Violent crime" < '305' AND "Robbery" < '147' AND "Crime Index Total" > '1540'
wikisql
CREATE TABLE table_29626 ( "Game" real, "October" real, "Opponent" text, "Score" text, "Location/Attendance" text, "Record" text, "Points" real )
How many games did they play on october 9?
SELECT COUNT("Opponent") FROM table_29626 WHERE "October" = '9'
wikisql
CREATE TABLE table_name_33 ( points_for VARCHAR, losing_bonus VARCHAR, club VARCHAR )
Which Points for has a Losing bonus of 2, and a Club of bridgend sports rfc?
SELECT points_for FROM table_name_33 WHERE losing_bonus = "2" AND club = "bridgend sports rfc"
sql_create_context