context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_62299 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real )
What is the best top-10 result when events are fewer than 39, top-5 is 1 and more than 5 cuts are made?
SELECT MAX("Top-10") FROM table_62299 WHERE "Events" < '39' AND "Top-5" = '1' AND "Cuts made" > '5'
wikisql
CREATE TABLE table_33845 ( "Number (map)" real, "Borough" text, "Population Canada 2011 Census" real, "Area in km\u00b2" real, "Density per km\u00b2" real )
Which Density per km is the lowest one that has a Number (map) smaller than 13, and an Area in km of 11.1?
SELECT MIN("Density per km\u00b2") FROM table_33845 WHERE "Number (map)" < '13' AND "Area in km\u00b2" = '11.1'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
what is the number of patients born before 2090 and with lab test name vitamin b12?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2090" AND lab.label = "Vitamin B12"
mimicsql_data
CREATE TABLE table_22901612_2 ( citation VARCHAR, region VARCHAR )
If the region is the Southern district of Texas, what is the citation?
SELECT citation FROM table_22901612_2 WHERE region = "Southern District of Texas"
sql_create_context
CREATE TABLE table_23014476_1 ( county VARCHAR, others__percentage VARCHAR )
Name the couty for others% 5.8
SELECT county FROM table_23014476_1 WHERE others__percentage = "5.8"
sql_create_context
CREATE TABLE table_16400024_1 ( l2_cache VARCHAR, release_price___usd__ VARCHAR )
What is the l2 cache for the model with a release price of $669?
SELECT l2_cache FROM table_16400024_1 WHERE release_price___usd__ = "$669"
sql_create_context
CREATE TABLE table_name_24 ( opponent VARCHAR, date VARCHAR )
What was the opponent on october 28?
SELECT opponent FROM table_name_24 WHERE date = "october 28"
sql_create_context
CREATE TABLE publication ( abstract varchar, cid int, citation_num int, jid int, pid int, reference_num int, title varchar, year int ) CREATE TABLE publication_keyword ( kid int, pid int ) CREATE TABLE domain_keyword ( did int, kid int ) CREATE TABLE domain ( did i...
return me all the organizations in ' North America ' .
SELECT name FROM organization WHERE continent = 'North America'
academic
CREATE TABLE song ( song_name varchar2(50), artist_name varchar2(50), country varchar2(20), f_id number(10), genre_is varchar2(20), rating number(10), languages varchar2(20), releasedate Date, resolution number(10) ) CREATE TABLE genre ( g_name varchar2(20), rating varchar2(...
What countries are the female artists who sung in the language Bangla from, and count them by a bar chart, could you sort bars from low to high order?
SELECT T1.country, T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T1.gender = "Female" AND T2.languages = "bangla" GROUP BY T1.country ORDER BY T1.country
nvbench
CREATE TABLE table_name_38 ( league_cup INTEGER, total VARCHAR, fa_cup VARCHAR )
Name the most league cups for total more than 19 and FA cups more than 6
SELECT MAX(league_cup) FROM table_name_38 WHERE total > 19 AND fa_cup > 6
sql_create_context
CREATE TABLE table_name_24 ( Id VARCHAR )
What's the 2004 tournament that has a 2R in 2000?
SELECT 2004 FROM table_name_24 WHERE 2000 = "2r"
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, ...
when has patient 007-11182 had the first intake on 08/29/2100?
SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-11182')) AND intakeoutput.cellpath LIKE '%intake%...
eicu
CREATE TABLE table_37015 ( "School" text, "Location" text, "Mascot" text, "County" text, "Enrollment 08-09" real, "IHSAA Class" text, "IHSAA Class Football" text, "Year Joined" real, "Previous Conference" text )
In what county is the school of Merrillville?
SELECT "County" FROM table_37015 WHERE "School" = 'merrillville'
wikisql
CREATE TABLE table_name_27 ( _ VARCHAR, alignment_alignment VARCHAR, link VARCHAR )
What is the alignment that predicts an alignment of the linuxbinary link?
SELECT alignment_alignment AS :_predicts_an_alignment_, _ FROM table_name_27 WHERE link = "linuxbinary"
sql_create_context
CREATE TABLE table_name_79 ( player VARCHAR, score VARCHAR )
What is the name of the player with a 71-69-71-69=280 score?
SELECT player FROM table_name_79 WHERE score = 71 - 69 - 71 - 69 = 280
sql_create_context
CREATE TABLE table_45018 ( "Player" text, "Position" text, "Premier League" real, "FA Cup" real, "League Cup" real, "UEFA Cup" real, "Total" real )
What is the highest total number of appearances when there were less than 4 at the FA cup?
SELECT MAX("Total") FROM table_45018 WHERE "FA Cup" < '4'
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 admission time of Wayne Shelton?
SELECT demographic.admittime FROM demographic WHERE demographic.name = "Wayne Shelton"
mimicsql_data
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE pat...
how much does the average hospital bill include lipase, ascites until 2102?
SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT labevents.hadm_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'lipase, ascites')) AND STRFTIME('%y', cost.chargetime) <= '2102' GROUP BY cost.hadm_id) AS t1
mimic_iii
CREATE TABLE table_17118006_2 ( local_investment__us$_ VARCHAR, bid_pronar_investment__us$_ VARCHAR )
What was the local investment (in $) in the projects of the department with $912,185 BID/PRONAR investment?
SELECT local_investment__us$_ FROM table_17118006_2 WHERE bid_pronar_investment__us$_ = "912,185"
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 ) ...
find the number of patients whose lab test fluid is cerebrospinal fluid(csf) and hospital stay is more than 3 days.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "3" AND lab.fluid = "Cerebrospinal Fluid (CSF)"
mimicsql_data
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, ni...
how many flights arrive at MKE
SELECT COUNT(DISTINCT flight.flight_id) FROM airport, flight WHERE airport.airport_code = 'MKE' AND flight.to_airport = airport.airport_code
atis
CREATE TABLE qtb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
患者04195159就诊科室名称不包含视光的所有医疗就诊记录都是哪几条在医院6678482中?
SELECT * FROM qtb WHERE qtb.PERSON_ID = '04195159' AND qtb.MED_SER_ORG_NO = '6678482' AND NOT qtb.MED_ORG_DEPT_NM LIKE '%视光%' UNION SELECT * FROM gyb WHERE gyb.PERSON_ID = '04195159' AND gyb.MED_SER_ORG_NO = '6678482' AND NOT gyb.MED_ORG_DEPT_NM LIKE '%视光%' UNION SELECT * FROM zyb WHERE zyb.PERSON_ID = '04195159' AND z...
css
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
tell me the name of the test that patient 013-33898 last received since 02/2104?
SELECT lab.labname FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-33898')) AND STRFTIME('%y-%m', lab.labresulttime) >= '2104-02' ORDER BY lab.labresult...
eicu
CREATE TABLE table_13689 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
What is the date when the result was l 37-3?
SELECT "Date" FROM table_13689 WHERE "Result" = 'l 37-3'
wikisql
CREATE TABLE table_5491 ( "Date" text, "Tournament" text, "Winning score" text, "To par" text, "Margin of victory" text )
Which Tournament has a Margin of victory of 1 stroke, and a Date of oct 7, 1990?
SELECT "Tournament" FROM table_5491 WHERE "Margin of victory" = '1 stroke' AND "Date" = 'oct 7, 1990'
wikisql
CREATE TABLE table_74191 ( "Tour" text, "Mens singles" text, "Womens singles" text, "Mens doubles" text, "Womens doubles" text, "Mixed doubles" text )
Who were the womens doubles when the mixed doubles were zhang nan zhao yunlei on the tour all england super series?
SELECT "Womens doubles" FROM table_74191 WHERE "Mixed doubles" = 'Zhang Nan Zhao Yunlei' AND "Tour" = 'All England Super Series'
wikisql
CREATE TABLE table_name_78 ( date_to VARCHAR, name VARCHAR )
When was james chester loaned out until ?
SELECT date_to FROM table_name_78 WHERE name = "james chester"
sql_create_context
CREATE TABLE table_203_239 ( id number, "year" number, "title" text, "chinese title" text, "role" text, "notes" text )
what is the total number of films athena chu has acted in ?
SELECT COUNT("title") FROM table_203_239
squall
CREATE TABLE table_8027 ( "Season" text, "Skip" text, "Third" text, "Second" text, "Lead" text )
what is the season when the lead is john shuster and third is shawn rojeski?
SELECT "Season" FROM table_8027 WHERE "Lead" = 'john shuster' AND "Third" = 'shawn rojeski'
wikisql
CREATE TABLE table_37911 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
Loss of francis (4 9) has what highest attendance figure?
SELECT MAX("Attendance") FROM table_37911 WHERE "Loss" = 'francis (4–9)'
wikisql
CREATE TABLE table_16509 ( "Hand" text, "1 credit" real, "2 credits" real, "3 credits" real, "4 credits" real, "5 credits" text )
How many 3 credits are there with 5 credits of 5?
SELECT COUNT("3 credits") FROM table_16509 WHERE "5 credits" = '5'
wikisql
CREATE TABLE table_22656187_9 ( result VARCHAR, partnering VARCHAR )
What was the result for a partnering of Frederica Piedade?
SELECT result FROM table_22656187_9 WHERE partnering = "Frederica Piedade"
sql_create_context
CREATE TABLE gwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
从2010年10月25日开始到2020年2月24日结束医疗机构3692210对于公务员的医疗就诊记录数量总共有多少?
SELECT COUNT(*) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '3692210' AND gwyjzb.IN_HOSP_DATE BETWEEN '2010-10-25' AND '2020-02-24'
css
CREATE TABLE table_10356 ( "Name" text, "Team" text, "Qual 1" text, "Qual 2" text, "Best" text )
What is the team name for the racer who had a first qualification time of 1:22.655?
SELECT "Team" FROM table_10356 WHERE "Qual 1" = '1:22.655'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number...
how many of the current patients are 20s?
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.hospitaldischargetime IS NULL AND patient.age BETWEEN 20 AND 29
eicu
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 decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID ...
For all employees in the Finance department, compare the total number of different job id using a bar chart, and sort in descending by the y-axis please.
SELECT JOB_ID, COUNT(JOB_ID) FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID WHERE T2.DEPARTMENT_NAME = 'Finance' GROUP BY JOB_ID ORDER BY COUNT(JOB_ID) DESC
nvbench
CREATE TABLE table_name_31 ( date VARCHAR, away_team VARCHAR )
When did Geelong play as the away team?
SELECT date FROM table_name_31 WHERE away_team = "geelong"
sql_create_context
CREATE TABLE table_66866 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time/Retired" text, "Grid" real )
Which rider had fewer than 10 laps for the Aprilia manufacturer, finishing in retirement?
SELECT "Rider" FROM table_66866 WHERE "Laps" < '10' AND "Manufacturer" = 'aprilia' AND "Time/Retired" = 'retirement'
wikisql
CREATE TABLE guests ( guest_id number, gender_code text, guest_first_name text, guest_last_name text, date_of_birth time ) CREATE TABLE apartments ( apt_id number, building_id number, apt_type_code text, apt_number text, bathroom_count number, bedroom_count number, room_...
Sort the apartment numbers in ascending order of room count.
SELECT apt_number FROM apartments ORDER BY room_count
spider
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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 te...
有沙眼在门诊诊断出的患者他们籍贯代码、名称以及相应人数分别是多少?
SELECT person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) FROM person_info JOIN hz_info JOIN mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE mzjzjlb.JZZDSM = '沙眼' GROUP BY person_info.JGDM
css
CREATE TABLE table_57293 ( "Rank" real, "Rider" text, "Team" text, "Speed" text, "Time" text )
What is the time for tony myres?
SELECT "Time" FROM table_57293 WHERE "Rider" = 'tony myres'
wikisql
CREATE TABLE table_name_8 ( score_in_the_final VARCHAR, surface VARCHAR )
What is the score in the final of the tournament with a hard surface?
SELECT score_in_the_final FROM table_name_8 WHERE surface = "hard"
sql_create_context
CREATE TABLE table_name_34 ( team_2 VARCHAR, team_1 VARCHAR )
What is the Team 2 with a Team 1 that is milli piyango sk?
SELECT team_2 FROM table_name_34 WHERE team_1 = "milli piyango sk"
sql_create_context
CREATE TABLE torrents ( groupname text, totalsnatched number, artist text, groupyear number, releasetype text, groupid number, id number ) CREATE TABLE tags ( index number, id number, tag text )
What is the torrent download statistics for each release year?
SELECT SUM(totalsnatched), groupyear FROM torrents GROUP BY groupyear
whatcdhiphop
CREATE TABLE table_1965650_7 ( college_junior_club_team VARCHAR, player VARCHAR )
Who did Dan Follet play for before the draft?
SELECT college_junior_club_team FROM table_1965650_7 WHERE player = "Dan Follet"
sql_create_context
CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, ...
Is it Friday when Prof. Joshua Wall 's classes always meet ?
SELECT COUNT(*) = 0 FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE course_offering.friday = ...
advising
CREATE TABLE table_40220 ( "Team 1" text, "Agg." text, "Team 2" text, "1st leg" text, "2nd leg" text )
What is Team 1 when Team 2 is Jac Port-Gentil?
SELECT "Team 1" FROM table_40220 WHERE "Team 2" = 'jac port-gentil'
wikisql
CREATE TABLE county ( County_Id int, County_name text, Population real, Zip_code text ) CREATE TABLE election ( Election_ID int, Counties_Represented text, District int, Delegate text, Party int, First_Elected real, Committee text ) CREATE TABLE party ( Party_ID int, ...
Show the county name and population of all counties with a bar chart, could you display by the y axis in asc?
SELECT County_name, Population FROM county ORDER BY Population
nvbench
CREATE TABLE city ( Status VARCHAR )
List the most common type of Status across cities.
SELECT Status FROM city GROUP BY Status ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
CREATE TABLE table_8378 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
Name the Record of Visitor of toronto st. pats with a Score of 5 4 and a Home of ottawa senators? Question 5
SELECT "Record" FROM table_8378 WHERE "Visitor" = 'toronto st. pats' AND "Score" = '5–4' AND "Home" = 'ottawa senators'
wikisql
CREATE TABLE journalist ( journalist_id number, name text, nationality text, age text, years_working number ) CREATE TABLE event ( event_id number, date text, venue text, name text, event_attendance number ) CREATE TABLE news_report ( journalist_id number, event_id numb...
Show the names of journalists and the number of events they reported.
SELECT T3.name, COUNT(*) FROM news_report AS T1 JOIN event AS T2 ON T1.event_id = T2.event_id JOIN journalist AS T3 ON T1.journalist_id = T3.journalist_id GROUP BY T3.name
spider
CREATE TABLE table_54763 ( "Draw" real, "Artist" text, "Song" text, "Points" real, "Place" text )
What song has draw number less than 2?
SELECT "Song" FROM table_54763 WHERE "Draw" < '2'
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...
这个号码是95841621的病人在医院3219418的门诊诊断名称不含有煤的门诊就诊记录是哪几条?
SELECT * FROM hz_info JOIN zzmzjzjlb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE hz_info.RYBH = '95841621' AND hz_info.YLJGDM = '3219418' AND NOT zzmzjzjlb.JZZDSM LIKE '%煤%' UNION SELECT * FROM hz_info JOIN fzzmzjzjlb ON hz_info.YLJGDM = fzzmzjzjlb.YLJGDM AND...
css
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description...
Reputation of users with 1 question.
WITH singlePostUsers AS (SELECT OwnerUserId FROM Posts AS p GROUP BY OwnerUserId HAVING COUNT(Id) = 1) SELECT AVG(Reputation) AS average_rep, SUM(CASE WHEN Reputation < 15 THEN 1 ELSE 0 END) AS Under15, SUM(CASE WHEN Reputation < 15 THEN 0 ELSE 1 END) AS Over15 FROM singlePostUsers AS spu INNER JOIN Posts AS p ON spu.O...
sede
CREATE TABLE table_name_75 ( away_team VARCHAR, venue VARCHAR )
What away team played at Western Oval?
SELECT away_team FROM table_name_75 WHERE venue = "western oval"
sql_create_context
CREATE TABLE table_name_7 ( population__2006_ VARCHAR, vehicle_registration_code VARCHAR, population_density VARCHAR )
What is the 2006 population of the area with vehicle registration code of G and population density of 1,432.0?
SELECT population__2006_ FROM table_name_7 WHERE vehicle_registration_code = "g" AND population_density = "1,432.0"
sql_create_context
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE chartevents...
what was last lab test time during this month for patient 4401?
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 4401) AND DATETIME(labevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') ORDER BY labevents.charttime DESC LIMIT 1
mimic_iii
CREATE TABLE table_name_30 ( tonnage__grt_ INTEGER, time VARCHAR, casualties VARCHAR )
What is the sum of tonnage with a time at 00:10 and less than 42 casualties?
SELECT SUM(tonnage__grt_) FROM table_name_30 WHERE time = "00:10" AND casualties < 42
sql_create_context
CREATE TABLE table_name_55 ( province VARCHAR, election INTEGER )
What province has an election after 2009?
SELECT province FROM table_name_55 WHERE election > 2009
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 procedures ( ...
what is the total number of patients who had atrial fibrillation and received tp therapy?
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 = "Atrial fibrillation" AND prescriptions.route = "TP"
mimicsql_data
CREATE TABLE table_64086 ( "Game" real, "Date" text, "Opponents" text, "Venue" text, "Result" text, "Score F\u2013A" text, "Attendance" real )
What is the Attendance of Game 24?
SELECT SUM("Attendance") FROM table_64086 WHERE "Game" = '24'
wikisql
CREATE TABLE teaches ( id text, course_id text, sec_id text, semester text, year number ) CREATE TABLE classroom ( building text, room_number text, capacity number ) CREATE TABLE prereq ( course_id text, prereq_id text ) CREATE TABLE instructor ( id text, name text, ...
What are the names of all instructors who have taught a course, as well as the corresponding course id?
SELECT name, course_id FROM instructor AS T1 JOIN teaches AS T2 ON T1.id = T2.id
spider
CREATE TABLE table_name_55 ( age_1 VARCHAR, hometown VARCHAR )
What is the age of the contestant from Reno, NV?
SELECT age_1 FROM table_name_55 WHERE hometown = "reno, nv"
sql_create_context
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE flight_stop ( flight_id in...
i'd like a flight from BURBANK to TACOMA WASHINGTON
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight, state WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BURBANK' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = ...
atis
CREATE TABLE table_name_55 ( conventional_plans VARCHAR, pos_plans VARCHAR )
Which conventional plan has a POS of 13%?
SELECT conventional_plans FROM table_name_55 WHERE pos_plans = "13%"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
give me the number of patients whose gender is f and lab test name is pt?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = "F" AND lab.label = "PT"
mimicsql_data
CREATE TABLE table_204_659 ( id number, "seat" text, "state" text, "majority" number, "member" text, "party" text )
was fran bailey from vic or wa ?
SELECT "state" FROM table_204_659 WHERE "member" = 'fran bailey'
squall
CREATE TABLE table_3288 ( "Pick #" real, "MLS Team" text, "Player" text, "Position" text, "Affiliation" text )
What is the position of pick # 63?
SELECT "Position" FROM table_3288 WHERE "Pick #" = '63'
wikisql
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, chartt...
count how many times patient 26757 came to the icu until 3 years ago.
SELECT COUNT(DISTINCT icustays.icustay_id) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26757) AND DATETIME(icustays.intime) <= DATETIME(CURRENT_TIME(), '-3 year')
mimic_iii
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 diagnoses ( ...
what is the number of patients whose diagnoses icd9 code is 1532 and lab test fluid is blood?
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.icd9_code = "1532" AND lab.fluid = "Blood"
mimicsql_data
CREATE TABLE table_name_26 ( gdp__ppp__$m_usd VARCHAR, area__km²_ VARCHAR )
How much is the GDP for an area of 116?
SELECT gdp__ppp__$m_usd FROM table_name_26 WHERE area__km²_ = "116"
sql_create_context
CREATE TABLE table_42750 ( "Inf. Stem" text, "Sing. Pres." text, "Plur. Pres." text, "Sing. Pret." text, "Plur. Pret." text, "Subj. Pres." text, "Subj. Pret." text, "Past Part." text )
What is the infinitive stem that is associated with a subjunctive present of a and a plural preterite of uo?
SELECT "Inf. Stem" FROM table_42750 WHERE "Subj. Pres." = 'a' AND "Plur. Pret." = 'uo'
wikisql
CREATE TABLE table_name_73 ( draws INTEGER, losses VARCHAR, wins VARCHAR )
What is the draw when the losses were more than 8 and less than 2 wins?
SELECT MAX(draws) FROM table_name_73 WHERE losses > 8 AND wins < 2
sql_create_context
CREATE TABLE table_28402 ( "Institution" text, "Location" text, "Nickname" text, "Founded" real, "Type" text, "Enrollment" real, "Joined" text )
What is the nickname of Linfield College?
SELECT "Nickname" FROM table_28402 WHERE "Institution" = 'Linfield College'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
what is the cost of hypothermia diagnostic?
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'diagnosis' AND cost.eventid IN (SELECT diagnosis.diagnosisid FROM diagnosis WHERE diagnosis.diagnosisname = 'hypothermia')
eicu
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 the number of patients born before 2120 who had urine lab tests?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2120" AND lab.fluid = "Urine"
mimicsql_data
CREATE TABLE table_71186 ( "Season" text, "Games" real, "Lost" real, "Tied" text, "Points" real, "Goals for" real, "Goals against" real, "Standing" text )
How many points did the team with more than 68 games, 4 ties, and more than 272 goals against have?
SELECT SUM("Points") FROM table_71186 WHERE "Games" > '68' AND "Tied" = '4' AND "Goals against" > '272'
wikisql
CREATE TABLE table_69064 ( "Heat" real, "Lane" real, "Name" text, "Nationality" text, "Time" text )
what heat number had a time of 58.44?
SELECT COUNT("Heat") FROM table_69064 WHERE "Time" = '58.44'
wikisql
CREATE TABLE table_23982 ( "Round" real, "Choice" real, "Player name" text, "Position" text, "Height" text, "Weight" real, "College" text )
What is the height if de is the position?
SELECT COUNT("Height") FROM table_23982 WHERE "Position" = 'DE'
wikisql
CREATE TABLE table_203_517 ( id number, "#" number, "date" text, "visitor" text, "score" text, "home" text, "record" text, "pts" number )
what was the number of points scored in the december 26th game by the toronto arenas ?
SELECT "score" FROM table_203_517 WHERE "date" = 'december 26'
squall
CREATE TABLE table_name_47 ( height_in_ft VARCHAR, years_for_rockets VARCHAR )
Tell me the height in ft for 1999-2004
SELECT height_in_ft FROM table_name_47 WHERE years_for_rockets = "1999-2004"
sql_create_context
CREATE TABLE table_name_38 ( driver VARCHAR, grid VARCHAR, time_retired VARCHAR )
Which driver has a grid bigger than 3 and a time of +62.6 secs?
SELECT driver FROM table_name_38 WHERE grid > 3 AND time_retired = "+62.6 secs"
sql_create_context
CREATE TABLE table_name_17 ( to_par VARCHAR, player VARCHAR )
What is Rocco Mediate's par?
SELECT to_par FROM table_name_17 WHERE player = "rocco mediate"
sql_create_context
CREATE TABLE table_35685 ( "Name" text, "Town/City" text, "Region" text, "On Dinosaur Trail?" text, "Education programs/ Guided tours?" text, "Associated Field Digs?" text )
What is the region that the Blaine County Museum is located in?
SELECT "Region" FROM table_35685 WHERE "Name" = 'blaine county museum'
wikisql
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), Document_Type_Description VARCHAR(255) ) CREATE TABLE Documents ( Document_ID INTEGER, Document_Type_Code CHAR(15), Project_ID INTEGER, Document_Date DATETIME, Document_Name VARCHAR(255), ...
Show the number of documents in each day for all documents on project with details 'Graph Database project' and bin document date by weekday and group by document name with a stacked bar chart, could you show from high to low by the Y?
SELECT Document_Date, COUNT(Document_Date) FROM Documents AS T1 JOIN Projects AS T2 ON T1.Project_ID = T2.Project_ID WHERE T2.Project_Details = 'Graph Database project' GROUP BY Document_Name ORDER BY COUNT(Document_Date) DESC
nvbench
CREATE TABLE table_39718 ( "Round" real, "Pick #" text, "Player" text, "Position" text, "College" text, "Tenure w/ Steelers" text )
What round pick was pick number 101 who plays defensive back?
SELECT "Round" FROM table_39718 WHERE "Position" = 'defensive back' AND "Pick #" = '101'
wikisql
CREATE TABLE table_name_32 ( to_par VARCHAR, finish VARCHAR )
What is the To Par of the player with a t8 Finish?
SELECT to_par FROM table_name_32 WHERE finish = "t8"
sql_create_context
CREATE TABLE table_52402 ( "Entrant" text, "Constructor" text, "Chassis" text, "Engine" text, "Tyre" text, "Driver" text, "Rounds" text )
Which chassis did Aguri Suzuki drive with an entrant of Larrousse F1?
SELECT "Chassis" FROM table_52402 WHERE "Entrant" = 'larrousse f1' AND "Driver" = 'aguri suzuki'
wikisql
CREATE TABLE table_name_32 ( record VARCHAR, game VARCHAR, date VARCHAR )
What is the record of the game with a game number greater than 24 on December 19?
SELECT record FROM table_name_32 WHERE game > 24 AND date = "december 19"
sql_create_context
CREATE TABLE table_204_89 ( id number, "team" text, "truck(s)" text, "#" number, "driver(s)" text, "primary sponsor(s)" text, "listed owner(s)" text, "crew chief" text )
what is the difference in tom power 's number and jon wood 's number ?
SELECT ABS((SELECT "#" FROM table_204_89 WHERE "driver(s)" = 'tom powers') - (SELECT "#" FROM table_204_89 WHERE "driver(s)" = 'jon wood'))
squall
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 gsi ( course_offering_id int, student_id int ) CREATE TABLE semester ( ...
When is the next time EECS 502 will be offered ?
SELECT DISTINCT semester.semester, semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 502 AND course_offering.semester = semester.semester_id AND semester.semester_id > (SELECT SEMESTERalias1.semester_id FROM semeste...
advising
CREATE TABLE table_3300 ( "Season" real, "Series" text, "Team" text, "Races" real, "Wins" real, "Poles" real, "F/Laps" real, "Podiums" real, "Points" text, "Position" text )
List the team with 12 points.
SELECT "Team" FROM table_3300 WHERE "Points" = '12'
wikisql
CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters ...
The hardest class is what ?
SELECT DISTINCT course.name, course.number, program_course.workload FROM course, program_course WHERE course.department = 'EECS' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MAX(PROGRAM_COURSEalias1.workload) FROM course AS COURSEalias1, program_course AS PROGRAM_COURSEalias1 WH...
advising
CREATE TABLE table_name_24 ( figures INTEGER, free VARCHAR )
What is the lowest figure score when the free is 556?
SELECT MIN(figures) FROM table_name_24 WHERE free = 556
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
how many patients are discharged to snf and have undergone other diagnostic procedures on skin and subcutaneous tissue?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "SNF" AND procedures.long_title = "Other diagnostic procedures on skin and subcutaneous tissue"
mimicsql_data
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 prescriptions...
which type of drug is iso-osmotic sodium chloride?
SELECT prescriptions.drug_type FROM prescriptions WHERE prescriptions.drug = "Iso-Osmotic Sodium Chloride"
mimicsql_data
CREATE TABLE table_name_83 ( points VARCHAR, assists VARCHAR, rebounds VARCHAR )
How many points were there when there were less than 16 rebounds and 5 assists?
SELECT COUNT(points) FROM table_name_83 WHERE assists = 5 AND rebounds < 16
sql_create_context
CREATE TABLE table_name_34 ( week VARCHAR, attendance VARCHAR )
What week was the game that had an attendance of 24,242?
SELECT week FROM table_name_34 WHERE attendance = "24,242"
sql_create_context
CREATE TABLE table_51702 ( "Date" text, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score" text )
Name th score for may 11, 2003
SELECT "Score" FROM table_51702 WHERE "Date" = 'may 11, 2003'
wikisql
CREATE TABLE table_22920 ( "Self-identification" text, "Moldovan census" real, "% Core Moldova" text, "Transnistrian census" real, "% Transnistria + Bender" text, "Total" real, "%" text )
Name the % for core moldova being 4.36%
SELECT "%" FROM table_22920 WHERE "% Core Moldova" = '4.36%'
wikisql