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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ...
give me the number of patients whose death status is 0 and lab test name is hematocrit, other fluid?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.expire_flag = "0" AND lab.label = "Hematocrit, Other Fluid"
mimicsql_data
CREATE TABLE table_68016 ( "Sydney" text, "Melbourne" text, "Perth" text, "Adelaide" text, "Gold Coast" text, "Auckland" text )
Which Adelaide has a Melbourne of yes, an Auckland of yes, and a Perth of yes?
SELECT "Adelaide" FROM table_68016 WHERE "Melbourne" = 'yes' AND "Auckland" = 'yes' AND "Perth" = 'yes'
wikisql
CREATE TABLE table_203_577 ( id number, "tenure" text, "coach" text, "years" number, "record" text, "pct." number )
how long was thomas stouch coach ?
SELECT "years" FROM table_203_577 WHERE "coach" = 'thomas stouch'
squall
CREATE TABLE table_name_96 ( laps INTEGER, time_retired VARCHAR, grid VARCHAR )
How many laps did the grid 1 engine have?
SELECT SUM(laps) FROM table_name_96 WHERE time_retired = "engine" AND grid = 1
sql_create_context
CREATE TABLE table_name_61 ( club VARCHAR, sport VARCHAR, league VARCHAR )
Which club plays soccer in the nwsl?
SELECT club FROM table_name_61 WHERE sport = "soccer" AND league = "nwsl"
sql_create_context
CREATE TABLE table_3784 ( "Game" real, "February" real, "Opponent" text, "Score" text, "Location/Attendance" text, "Record" text, "Points" real )
What was the teams record when they played the ottawa senators?
SELECT "Record" FROM table_3784 WHERE "Opponent" = 'Ottawa Senators'
wikisql
CREATE TABLE table_204_598 ( id number, "name" text, "state of residence" text, "took office" text, "left office" text, "president served under" text )
which senior advisor is after pete rouse ?
SELECT "name" FROM table_204_598 WHERE "took office" > (SELECT "took office" FROM table_204_598 WHERE "name" = 'pete rouse') ORDER BY "took office" LIMIT 1
squall
CREATE TABLE manufacturers ( name VARCHAR, revenue INTEGER )
Find the name of companies whose revenue is between 100 and 150.
SELECT name FROM manufacturers WHERE revenue BETWEEN 100 AND 150
sql_create_context
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, ...
since 2105 what were the top four most frequent diagnoses that patients were given within the same month after receiving umbilical vein cath?
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissi...
mimic_iii
CREATE TABLE table_76591 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What is the average Game, when Date is 'December 23'?
SELECT AVG("Game") FROM table_76591 WHERE "Date" = 'december 23'
wikisql
CREATE TABLE table_25852 ( "Mother Tongue" text, "Population (2006)" real, "Percentage (2006)" text, "Population (2011)" real, "Percentage (2011)" text )
What was the minimum population in 2011?
SELECT MIN("Population (2011)") FROM table_25852
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...
在2017-05-28之前,患者24453147有哪些门诊就诊的检验报告单?看一下门诊就诊的流水号
SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND 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_mzj...
css
CREATE TABLE table_14423 ( "Date" text, "Opponent" text, "City" text, "Result" text, "Score" text )
What team was the opponent when the score was 25-0?
SELECT "Opponent" FROM table_14423 WHERE "Score" = '25-0'
wikisql
CREATE TABLE table_204_529 ( id number, "year" number, "personnel" text, "album" text, "label" text, "peak positions\nnor" number )
how long was there between tarpan seasons and antologie ?
SELECT ABS((SELECT "year" FROM table_204_529 WHERE "album" = 'tarpan seasons') - (SELECT "year" FROM table_204_529 WHERE "album" = 'antologie'))
squall
CREATE TABLE table_1847 ( "No." text, "Summoned" text, "Elected" text, "Assembled" text, "Dissolved" text, "1st member" text, "2nd member" text )
When 1462/63 was the elected what was the no.?
SELECT "No." FROM table_1847 WHERE "Elected" = '1462/63'
wikisql
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, ...
when was the last time that patient 73155 was prescribed with insulin during their last hospital encounter?
SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 73155 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND prescriptions.drug = 'insulin' ORDER BY prescriptions.startdate DESC LIMIT ...
mimic_iii
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...
门诊诊断患者为结膜炎的尿素的参考值范围有什么下限和上限?
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE wdmzjzjlb.JZZDSM = '结膜炎' AND jyjgzbb.JCZBMC = '尿素' UNION SELECT jyjgzbb.CKZFWXX, jyjgz...
css
CREATE TABLE table_7346 ( "Name" text, "Years" text, "League a" text, "FA Cup" text, "League Cup" text, "Other b" text, "Total" text )
What is the League Cup for 1947 1958?
SELECT "League Cup" FROM table_7346 WHERE "Years" = '1947–1958'
wikisql
CREATE TABLE table_48661 ( "Province" text, "Region" text, "Capital" text, "Districts" real, "UBIGEO" real )
What province in Tumbes has less than 11 districts and a UBIGEO of 2401?
SELECT "Province" FROM table_48661 WHERE "Districts" < '11' AND "Region" = 'tumbes' AND "UBIGEO" = '2401'
wikisql
CREATE TABLE table_14739 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
What score has won as the result on the date of December 14, 2004?
SELECT "Score" FROM table_14739 WHERE "Result" = 'won' AND "Date" = 'december 14, 2004'
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 those employees who did not have any job in the past, what is the relationship between employee_id and commission_pct ?
SELECT EMPLOYEE_ID, COMMISSION_PCT FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history)
nvbench
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time...
what is the number of hours since patient 017-88691 had their first procedure in this hospital encounter?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-88691...
eicu
CREATE TABLE table_name_63 ( rank INTEGER, director VARCHAR )
What is the highest Rank, when Director is 'Henry Hathaway'?
SELECT MAX(rank) FROM table_name_63 WHERE director = "henry hathaway"
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, ...
count the number of patients whose primary disease is abdominal pain and age is less than 68?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ABDOMINAL PAIN" AND demographic.age < "68"
mimicsql_data
CREATE TABLE table_10684 ( "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
Who was the opponent when the score was 6 4, 6 7 (2 7) , 7 5?
SELECT "Opponent" FROM table_10684 WHERE "Score" = '6–4, 6–7 (2–7) , 7–5'
wikisql
CREATE TABLE table_name_5 ( erp_w INTEGER, call_sign VARCHAR )
What is the sum of the erp w of the k222al call sign?
SELECT SUM(erp_w) FROM table_name_5 WHERE call_sign = "k222al"
sql_create_context
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE Po...
\\ bug query on markdown. with bits stolen from http://data.stackexchange.com/stackoverflow/query/494264/longest-answers-by-markdown
SELECT p.Id AS "post_link", 'site://posts/' + CAST(p.Id AS TEXT) + '/edit|' + 'Edit' AS "edit_link", p.OwnerUserId AS "user_link", p.CreationDate FROM Posts AS p, PostHistory AS ph WHERE ph.PostId = p.Id AND ph.PostHistoryTypeId IN (2, 5, 8) AND NOT EXISTS(SELECT * FROM PostHistory AS phtwo WHERE phtwo.PostId = p.Id AN...
sede
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...
provide the number of patients whose procedure long title is intraoperative cardiac pacemaker and lab test category is chemistry?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "Intraoperative cardiac pacemaker" AND lab."CATEGORY" = "Chemistry"
mimicsql_data
CREATE TABLE table_204_681 ( id number, "2011 rank" number, "2010 rank" number, "2009 rank" number, "2008 rank" number, "2007 rank" number, "company (country)" text, "2011 arms sales (us$ m.)" number, "2010 arms sales (us$ m.)" number, "2009 arms sales (us$ m.)" number, "2008...
which is the only company to have under 10 % arms sales as share of company 's total sales ?
SELECT "company (country)" FROM table_204_681 WHERE "arms sales as share of company's total sales (%)," < 10
squall
CREATE TABLE table_14735 ( "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 highest goal difference that the club with 33-5 points and less than 12 wins?
SELECT MAX("Goal Difference") FROM table_14735 WHERE "Points" = '33-5' AND "Wins" < '12'
wikisql
CREATE TABLE table_21991074_3 ( lost INTEGER )
Name the least lost
SELECT MIN(lost) FROM table_21991074_3
sql_create_context
CREATE TABLE table_name_91 ( goals INTEGER, minutes VARCHAR )
What was the highest number of goals when 2428 minutes were played?
SELECT MAX(goals) FROM table_name_91 WHERE minutes = 2428
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...
provide the number of patients whose insurance is self pay and lab test name is c-reactive protein?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Self Pay" AND lab.label = "C-Reactive Protein"
mimicsql_data
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 pie chart for what are the proportion of the teams in elimination?
SELECT Team, COUNT(Team) FROM Elimination GROUP BY Team
nvbench
CREATE TABLE table_21792 ( "Rank" real, "Country" text, "Miss United Continent" real, "Virreina" real, "1st RU" real, "2nd RU" real, "3rd RU" real, "4th RU" real, "Semifinalists" real, "Total" real )
What is the least number of miss united continents?
SELECT MIN("Miss United Continent") FROM table_21792
wikisql
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, v...
what is patient 18726's insurance plan in the last hospital encounter.
SELECT admissions.insurance FROM admissions WHERE admissions.subject_id = 18726 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1
mimic_iii
CREATE TABLE table_70053 ( "County" text, "Live births 2006" real, "GFR 2006" real, "TFR 2006" real, "Whites as % of Pop." text )
What is the lowest total GFR that has 95.80% of the population as Whites, and a TFR total larger than 2.14, in 2006?
SELECT MIN("GFR 2006") FROM table_70053 WHERE "Whites as % of Pop." = '95.80%' AND "TFR 2006" > '2.14'
wikisql
CREATE TABLE table_20233 ( "Date" text, "Cover model" text, "Centerfold model" text, "Interview subject" text, "20 Questions" text, "Pictorials" text )
Who was asked 20 questions in the issue where the cover model is Linda Brava?
SELECT "20 Questions" FROM table_20233 WHERE "Cover model" = 'Linda Brava'
wikisql
CREATE TABLE table_name_34 ( record VARCHAR, date VARCHAR )
Name the record for october 11
SELECT record FROM table_name_34 WHERE date = "october 11"
sql_create_context
CREATE TABLE table_train_256 ( "id" int, "mini_mental_state_examination_mmse" int, "language" string, "mild_cognitive_impairment" bool, "moca_score" int, "dementia" bool, "body_mass_index_bmi" float, "age" float, "NOUSE" float )
english ( wumc ) or spanish speaking ( dh )
SELECT * FROM table_train_256 WHERE language = 'english' OR language = 'spanish'
criteria2sql
CREATE TABLE table_name_98 ( visitor VARCHAR, decision VARCHAR, home VARCHAR )
Who was the visiting team at the game where Edmonton was the home team and the decision was Osgood?
SELECT visitor FROM table_name_98 WHERE decision = "osgood" AND home = "edmonton"
sql_create_context
CREATE TABLE table_25030512_4 ( first_elected VARCHAR, district VARCHAR )
Name the first elected for alabama 3
SELECT COUNT(first_elected) FROM table_25030512_4 WHERE district = "Alabama 3"
sql_create_context
CREATE TABLE table_name_24 ( matches VARCHAR, runs VARCHAR, inns VARCHAR )
Runs smaller than 6106, and Inns smaller than 146 has what total number of matches?
SELECT COUNT(matches) FROM table_name_24 WHERE runs < 6106 AND inns < 146
sql_create_context
CREATE TABLE table_53520 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
On which date was the game where the home teams score was 22.15 (147), and the away teams score was 9.8 (62)
SELECT "Date" FROM table_53520 WHERE "Home team score" = '22.15 (147)' AND "Away team score" = '9.8 (62)'
wikisql
CREATE TABLE table_21480 ( "Year" real, "West Manila" text, "East Manila" text, "Consumer Price Index (2005=100)" text, "West Manila as a share of 1996 real tariff" text, "East Manila as a share of 1996 real tariff" text )
What was the year when West Manila has a tariff increase of 6.5?
SELECT "Year" FROM table_21480 WHERE "West Manila" = '6.5'
wikisql
CREATE TABLE table_43964 ( "Bank type" text, "Number of branches" real, "On-site ATMs" real, "Off-site ATMs" real, "Total ATMs" real )
What is the mean on-site ATMS that have off-site ATMs of 1567, and the total number of ATMs less than 4772?
SELECT AVG("On-site ATMs") FROM table_43964 WHERE "Off-site ATMs" = '1567' AND "Total ATMs" < '4772'
wikisql
CREATE TABLE table_43536 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
What date is aston villa away?
SELECT "Date" FROM table_43536 WHERE "Away team" = 'aston villa'
wikisql
CREATE TABLE table_name_39 ( conv VARCHAR, pens VARCHAR, tries VARCHAR )
How many conversions had 0 pens and 0 tries?
SELECT conv FROM table_name_39 WHERE pens = "0" AND tries = "0"
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 player ( Player_ID int, Player text, Years_Played text, Total_WL text, Singles_WL text, Doubles_WL tex...
How many players played each position. Show a pie chart.
SELECT Position, COUNT(*) FROM match_season GROUP BY Position
nvbench
CREATE TABLE table_name_21 ( score_in_final VARCHAR, date VARCHAR )
What was the Final Score on February 24, 2002?
SELECT score_in_final FROM table_name_21 WHERE date = "february 24, 2002"
sql_create_context
CREATE TABLE table_name_53 ( format VARCHAR, date VARCHAR )
What is the format of the date February 14, 2002?
SELECT format FROM table_name_53 WHERE date = "february 14, 2002"
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 prescription...
count the number of patients who are diagnosed with severe sepsis and have pb route of drug administration.
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 = "Severe sepsis" AND prescriptions.route = "PB"
mimicsql_data
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_care...
what is an insurance plan for patient 138 in the first hospital visit?
SELECT admissions.insurance FROM admissions WHERE admissions.subject_id = 138 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1
mimic_iii
CREATE TABLE table_61449 ( "Tournament" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text )
What is the 2009 value with lq in 2012, 2r in 2011, and lq in 2008?
SELECT "2009" FROM table_61449 WHERE "2012" = 'lq' AND "2011" = '2r' AND "2008" = 'lq'
wikisql
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, U...
[draft] Questions with no up-voted or down-voted answers.
SELECT DISTINCT * FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id WHERE q.PostTypeId = 1 AND a.PostTypeId = 2 AND a.DeletionDate IS NULL AND q.ClosedDate IS NULL AND q.AnswerCount >= '##numOfAnswers?1##'
sede
CREATE TABLE table_name_39 ( date VARCHAR, attendance VARCHAR )
What was the date of the game attended by 45,122?
SELECT date FROM table_name_39 WHERE attendance = "45,122"
sql_create_context
CREATE TABLE table_204_56 ( id number, "year" number, "song" text, "us r&b" number, "us rap" number, "album" text )
what was the only single released in 1993 ?
SELECT "song" FROM table_204_56 WHERE "year" = 1993
squall
CREATE TABLE table_name_14 ( rank VARCHAR, points VARCHAR )
What is the highest 2nd in (m) that has a Rank more than 2 and Points more than 249.3
SELECT MAX(2 AS nd__m_) FROM table_name_14 WHERE rank > 2 AND points > 249.3
sql_create_context
CREATE TABLE table_13067 ( "Position" real, "Club" text, "Games played" real, "Wins" real, "Draws" real, "Loses" real, "Goals scored" real, "Goals conceded" real, "Points" real )
How many games have been played when there are 13 wins and 45 goals were conceded?
SELECT "Games played" FROM table_13067 WHERE "Wins" = '13' AND "Goals conceded" = '45'
wikisql
CREATE TABLE table_34084 ( "Week" real, "Date" text, "Opponent" text, "Time / Time Zone" text, "Game Site" text, "Final Score" text, "Record" text, "Match Report" text )
Where is the game site for the game that had a packers record of 2-3?
SELECT "Game Site" FROM table_34084 WHERE "Record" = '2-3'
wikisql
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name var...
what is DL 's schedule of morning flights to ATLANTA
SELECT DISTINCT flight.flight_id FROM airport_service, city, flight WHERE (city.city_code = airport_service.city_code AND city.city_name = 'ATLANTA' AND flight.departure_time BETWEEN 0 AND 1200 AND flight.to_airport = airport_service.airport_code) AND flight.airline_code = 'DL'
atis
CREATE TABLE table_47178 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text )
What is the place of the player who scored less than 70?
SELECT "Place" FROM table_47178 WHERE "Score" < '70'
wikisql
CREATE TABLE table_name_71 ( location VARCHAR, record VARCHAR )
What is the location of the game with a 6-11-8 record?
SELECT location FROM table_name_71 WHERE record = "6-11-8"
sql_create_context
CREATE TABLE table_name_74 ( dvd_release_date VARCHAR, season VARCHAR, episodes VARCHAR )
On what date was the DVD released for the season with fewer than 13 episodes that aired before season 8?
SELECT dvd_release_date FROM table_name_74 WHERE season < 8 AND episodes < 13
sql_create_context
CREATE TABLE table_1111 ( "Rank" real, "Country" text, "UNWTO Region" text, "International tourist arrivals (2012)" text, "International tourist arrivals (2011)" text, "Change (2011 to 2012)" text, "Change (2010 to 2011)" text )
Which country has a rank of 5?
SELECT "Country" FROM table_1111 WHERE "Rank" = '5'
wikisql
CREATE TABLE table_name_7 ( opponent VARCHAR, score VARCHAR )
Who was the opponent with a score of 109 108?
SELECT opponent FROM table_name_7 WHERE score = "109–108"
sql_create_context
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, Creation...
Percentage of questions with at least one answer (restrict dates).
SELECT TIME_TO_STR(CreationDate, '%j'), CAST(SUM(CASE WHEN AnswerCount > 0 THEN 1 ELSE 0 END) AS FLOAT) / COUNT(Posts.Id) AS Ratio FROM Posts WHERE (PostTypeId = 1 AND CreationDate >= '##Date1##' AND CreationDate <= '##Date2##') GROUP BY TIME_TO_STR(CreationDate, '%j') ORDER BY TIME_TO_STR(CreationDate, '%j')
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
how many patients diagnosed with short title other alter consciousnes have had ascites fluid lab test?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Other alter consciousnes" AND lab.fluid = "Ascites"
mimicsql_data
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
What is the easiest class to fulfill the MDE requirement for me ?
SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_cou...
advising
CREATE TABLE table_18018214_4 ( games_played VARCHAR, points VARCHAR )
How many games had 22 points?
SELECT COUNT(games_played) FROM table_18018214_4 WHERE points = 22
sql_create_context
CREATE TABLE table_name_79 ( circuit VARCHAR, date VARCHAR, name VARCHAR )
Tell me the circuit for 10 may for targa florio
SELECT circuit FROM table_name_79 WHERE date = "10 may" AND name = "targa florio"
sql_create_context
CREATE TABLE customers ( customer_id number, customer_type_code text, address_line_1 text, address_line_2 text, town_city text, state text, email_address text, phone_number text ) CREATE TABLE products ( product_id number, parent_product_id number, product_category_code text...
What are all the different product names, and how many complains has each received?
SELECT t1.product_name, COUNT(*) FROM products AS t1 JOIN complaints AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_name
spider
CREATE TABLE table_68754 ( "Date" text, "Visiting Team" text, "Final Score" text, "Host Team" text, "Stadium" text )
Who was the visiting team who played at the hubert h. humphrey metrodome stadium?
SELECT "Visiting Team" FROM table_68754 WHERE "Stadium" = 'hubert h. humphrey metrodome'
wikisql
CREATE TABLE table_name_86 ( attendance VARCHAR, record VARCHAR )
What is the attendance that has a record of 43-28?
SELECT attendance FROM table_name_86 WHERE record = "43-28"
sql_create_context
CREATE TABLE table_25887826_17 ( pos INTEGER, avg VARCHAR )
How many POS when the average is 1.8529?
SELECT MAX(pos) FROM table_25887826_17 WHERE avg = "1.8529"
sql_create_context
CREATE TABLE table_name_41 ( away_team VARCHAR, venue VARCHAR )
who is the away team when played at junction oval?
SELECT away_team FROM table_name_41 WHERE venue = "junction oval"
sql_create_context
CREATE TABLE table_73331 ( "Year" real, "Division" real, "League" text, "Reg. Season" text, "Playoffs" text, "National Open" text )
What league was involved in 2008?
SELECT "League" FROM table_73331 WHERE "Year" = '2008'
wikisql
CREATE TABLE table_78597 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text )
What is the Place of the Player with a Score of 67?
SELECT "Place" FROM table_78597 WHERE "Score" = '67'
wikisql
CREATE TABLE table_name_42 ( color_commentator_s_ VARCHAR, sideline_reporter_s_ VARCHAR, year VARCHAR )
Who was the color commentator for Eric Dickerson and Melissa Stark in 2001?
SELECT color_commentator_s_ FROM table_name_42 WHERE sideline_reporter_s_ = "eric dickerson and melissa stark" AND year = 2001
sql_create_context
CREATE TABLE table_name_73 ( school VARCHAR, location VARCHAR )
Which school is located in trafalgar?
SELECT school FROM table_name_73 WHERE location = "trafalgar"
sql_create_context
CREATE TABLE table_name_40 ( lost INTEGER, points_1 VARCHAR, drawn VARCHAR, goals_against VARCHAR )
What is the highest lost entry that has a drawn entry less than 6, goals against less than 44, and a points 1 entry of 27?
SELECT MAX(lost) FROM table_name_40 WHERE drawn < 6 AND goals_against < 44 AND points_1 = "27"
sql_create_context
CREATE TABLE table_39710 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
What was the result on October 4, 1993?
SELECT "Result" FROM table_39710 WHERE "Date" = 'october 4, 1993'
wikisql
CREATE TABLE table_name_20 ( laps INTEGER, driver VARCHAR )
What is the sum of laps for Derek Warwick?
SELECT SUM(laps) FROM table_name_20 WHERE driver = "derek warwick"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text, person_info_CSD text, person_info_CSRQ time, person_info_GJDM text, person_info_GJMC text, person_info_JGDM text, person_info_JGMC text, person_info_MZDM text, person_info_MZMC text, person_info_XBDM ...
在02年7月13日到2009年11月4日内名叫戚雅娴的病人所有检验结果指标记录中的仪器编号以及名称分别都是啥?
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC 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.BG...
css
CREATE TABLE table_39003 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text )
What is the highest round with a guard position and an overall greater than 71?
SELECT MAX("Round") FROM table_39003 WHERE "Position" = 'guard' AND "Overall" > '71'
wikisql
CREATE TABLE table_name_85 ( home_team VARCHAR, venue VARCHAR )
Windy hill is the home to what team?
SELECT home_team FROM table_name_85 WHERE venue = "windy hill"
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
for patients id 2560, specify the icd9 code and primary disease.
SELECT demographic.diagnosis, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE table_203_42 ( id number, "model" text, "class" text, "length" text, "fuel" text, "starting price" text )
what is the price of bot the via and tour models combined ?
SELECT SUM("starting price") FROM table_203_42 WHERE "model" IN ('via', 'tour')
squall
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岁的,统计其平均医疗费总数有多少?
SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_AGE > 13 UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_AGE > 13 UNION SELECT zyb.MED_CLINIC_ID FROM zyb WHERE zyb.PERSON_AGE > 13 UNION SELECT mzb.MED_CLINIC_ID FROM mzb WHERE mzb.PERSON...
css
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...
医院1518558全部医疗就诊的记录里参照科室编码与入院诊断编码差别查询一下大病支付的部分和医疗总费用相比,比值最小的是多少
SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_CD, MIN(t_kc24.ILL_PAY / t_kc24.MED_AMOUT) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '1518558' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_CD
css
CREATE TABLE table_1329532_2 ( date_of_election VARCHAR, elected_successor VARCHAR )
What was the election date for Arthur Hodges?
SELECT date_of_election FROM table_1329532_2 WHERE elected_successor = "Arthur Hodges"
sql_create_context
CREATE TABLE table_6207 ( "Date" text, "Episode" real, "Performer 1" text, "Performer 2" text, "Performer 3" text, "Performer 4" text )
Who was performer 3 with karen maruyama as performer 2?
SELECT "Performer 3" FROM table_6207 WHERE "Performer 2" = 'karen maruyama'
wikisql
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
患者凤英发哪些检验报告的结果指标全部正常?看看这些检验报告的单号
SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB ...
css
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 procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime t...
tell me the dose of ns (syringe) that patient 30267 was prescribed in their last hospital encounter?
SELECT SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 30267 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND prescriptions.drug = 'ns (syringe)'
mimic_iii
CREATE TABLE table_name_15 ( date VARCHAR, result VARCHAR )
What was the date of the game with a result of won 4-2?
SELECT date FROM table_name_15 WHERE result = "won 4-2"
sql_create_context
CREATE TABLE table_73999 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text )
Name the result for willis alston
SELECT "Result" FROM table_73999 WHERE "Incumbent" = 'Willis Alston'
wikisql
CREATE TABLE documents_with_expenses ( document_id number, budget_type_code text, document_details text ) CREATE TABLE projects ( project_id number, project_details text ) CREATE TABLE statements ( statement_id number, statement_details text ) CREATE TABLE ref_budget_codes ( budget_ty...
Show all statement id and the number of accounts for each statement.
SELECT statement_id, COUNT(*) FROM accounts GROUP BY statement_id
spider
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
what is procedure short title of subject id 8323?
SELECT procedures.short_title FROM procedures WHERE procedures.subject_id = "8323"
mimicsql_data
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, ...
患者的门诊诊断为2型糖尿病的低密度脂蛋白胆固醇的参考值范围下限和上限均为什么?
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDSM = '2型糖尿病' AND jyjgzbb.JCZBMC = '低密度脂蛋白胆固醇'
css
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) 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...
在2009年06月17日到2018年12月02日期间,医疗机构7756841一共有多少医疗费
SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.MED_SER_ORG_NO = '7756841' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2009-06-17' AND '2018-12-02'
css