context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
what is maximum age of patients whose admission location is clinic referral/premature and primary disease is sternal wound infection?
SELECT MAX(demographic.age) FROM demographic WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.diagnosis = "STERNAL WOUND INFECTION"
mimicsql_data
CREATE TABLE Student_Tests_Taken ( registration_id INTEGER, date_test_taken DATETIME, test_result VARCHAR(255) ) CREATE TABLE Courses ( course_id INTEGER, author_id INTEGER, subject_id INTEGER, course_name VARCHAR(120), course_description VARCHAR(255) ) CREATE TABLE Course_Authors_and_...
What are the enrollment dates of all the tests that have result 'Pass', and count them by a bar chart, sort in descending by the y-axis.
SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Pass" ORDER BY COUNT(date_of_enrolment) DESC
nvbench
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE P...
SELECT * FROM Comments WHERE Score = 6.
SELECT Text, LENGTH(Text) - LENGTH(REPLACE(Text, ' ', '')) + 1 FROM Comments WHERE Score = 6 AND Text LIKE '%?%' AND LENGTH(Text) - LENGTH(REPLACE(Text, ' ', '')) + 1 > 20
sede
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE bdmzjzjlb ( HXPLC number, HZX...
患者的身高、体重、体温、心率、收缩压、舒张压、呼吸频率、脉率在门诊就诊28831691932中各是多少?
SELECT wdmzjzjlb.SG, wdmzjzjlb.TZ, wdmzjzjlb.TW, wdmzjzjlb.SSY, wdmzjzjlb.SZY, wdmzjzjlb.XL, wdmzjzjlb.HXPLC, wdmzjzjlb.ML FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '28831691932' UNION SELECT bdmzjzjlb.SG, bdmzjzjlb.TZ, bdmzjzjlb.TW, bdmzjzjlb.SSY, bdmzjzjlb.SZY, bdmzjzjlb.XL, bdmzjzjlb.HXPLC, bdmzjzjlb.ML FROM bdmzjzjlb ...
css
CREATE TABLE table_42515 ( "Year" text, "Title" text, "Genre" text, "Label" text, "Result" text )
Which result's genre was jazz when its label was columbia and its title was requiem?
SELECT "Result" FROM table_42515 WHERE "Genre" = 'jazz' AND "Label" = 'columbia' AND "Title" = 'requiem'
wikisql
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...
患者奚嘉珍的游离前列腺特异性抗原在09年6月17日到17年5月2日的这段时间情况咋样啊?
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM...
css
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAc...
Cassandra question count by week.
SELECT MONTH(DATE(Posts.CreationDate)), YEAR(DATE(Posts.CreationDate)), COUNT(Posts.Id) FROM Tags, PostTags, Posts WHERE Tags.TagName = 'cassandra' AND Tags.Id = PostTags.TagId AND PostTags.PostId = Posts.Id AND Posts.CreationDate > '2013-10-01' AND Posts.CreationDate < '2017-01-01' GROUP BY MONTH(DATE(Posts.CreationDa...
sede
CREATE TABLE table_16836 ( "Player" text, "No." real, "Nationality" text, "Position" text, "Years for Jazz" text, "School/Club Team" text )
Which country is Jim Les from?
SELECT "Nationality" FROM table_16836 WHERE "Player" = 'Jim Les'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions...
find the insurance of subject id 6983.
SELECT demographic.insurance FROM demographic WHERE demographic.subject_id = "6983"
mimicsql_data
CREATE TABLE election ( Election_ID int, Representative_ID int, Date text, Votes real, Vote_Percent real, Seats real, Place real ) CREATE TABLE representative ( Representative_ID int, Name text, State text, Party text, Lifespan text )
A bar chart showing how many representatives in each party, and I want to display Y-axis from low to high order.
SELECT Party, COUNT(Party) FROM representative GROUP BY Party ORDER BY COUNT(Party)
nvbench
CREATE TABLE table_10068 ( "Team" text, "Location" text, "Venue" text, "Capacity" real, "Position in 2006" text )
What was Team Dnepr's position in 2006?
SELECT "Position in 2006" FROM table_10068 WHERE "Team" = 'dnepr'
wikisql
CREATE TABLE table_43367 ( "Ballarat FL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real )
For the teams that had fewer than 1 Byes, what was the lowest number of Draws?
SELECT MIN("Draws") FROM table_43367 WHERE "Byes" < '1'
wikisql
CREATE TABLE table_57742 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High assists" text, "Location Attendance" text, "Record" text )
What is the location attendance when the team is Golden State?
SELECT "Location Attendance" FROM table_57742 WHERE "Team" = 'golden state'
wikisql
CREATE TABLE table_62123 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text )
What's the to par for england when the score is less than 71?
SELECT "To par" FROM table_62123 WHERE "Country" = 'england' AND "Score" < '71'
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...
tell me the number of black/haitian patients who had open and other right hemicolectomy.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "BLACK/HAITIAN" AND procedures.short_title = "Opn rt hemicolectomy NEC"
mimicsql_data
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( ...
How many patients with morbid obesity/sda primary disease died in or before the year 2183?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "MORBID OBESITY/SDA" AND demographic.dod_year <= "2183.0"
mimicsql_data
CREATE TABLE table_1463332_2 ( most_recent_final VARCHAR, years__won_in_bold_ VARCHAR )
What is the most recent final result for the years (won in bold) 1979?
SELECT most_recent_final FROM table_1463332_2 WHERE years__won_in_bold_ = "1979"
sql_create_context
CREATE TABLE classroom ( building VARCHAR, room_number VARCHAR, capacity INTEGER )
Find the room number of the rooms which can sit 50 to 100 students and their buildings.
SELECT building, room_number FROM classroom WHERE capacity BETWEEN 50 AND 100
sql_create_context
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 procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, ...
since 1 year ago, what were the top three most frequent procedures that patients were given within 2 months after the diagnosis of hpt c w/o hepat coma nos.
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.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, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissi...
mimic_iii
CREATE TABLE table_52143 ( "Year" real, "Single" text, "U.S. Country" text, "U.S." text, "U.S. AC" text, "Album" text )
What was the best album in 1965?
SELECT "U.S. AC" FROM table_52143 WHERE "Album" = 'the best' AND "Year" = '1965'
wikisql
CREATE TABLE table_name_72 ( to_par VARCHAR, total VARCHAR, player VARCHAR, country VARCHAR, year_won VARCHAR )
What is the to par for Paul Azinger from the United States after 1986 for a total bigger than 145?
SELECT COUNT(to_par) FROM table_name_72 WHERE country = "united states" AND year_won > 1986 AND player = "paul azinger" AND total > 145
sql_create_context
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose...
has patient 81461 been diagnosed with anything in 2105.
SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 81461) AND STRFTIME('%y', diagnoses_icd.charttime) = '2105'
mimic_iii
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, ...
Top Users from New Delhi.
SELECT Id, DisplayName, Reputation, WebsiteUrl, Location FROM Users WHERE Location LIKE '%New Delhi%' ORDER BY Reputation DESC LIMIT 100
sede
CREATE TABLE table_name_30 ( regional_county_municipality VARCHAR, area__km_2__ VARCHAR, population VARCHAR )
What municipality has 719 people and is larger than 108.46 km2?
SELECT regional_county_municipality FROM table_name_30 WHERE area__km_2__ > 108.46 AND population = 719
sql_create_context
CREATE TABLE table_4723 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the home team score when the score for the away team was 7.9 (51)?
SELECT "Home team score" FROM table_4723 WHERE "Away team score" = '7.9 (51)'
wikisql
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 treatment ( treat...
how many days has it been since patient 012-66291 dext 5%-nacl 0.9% 1000 ml lvp was last prescribed on this hospital encounter?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', medication.drugstarttime)) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-662...
eicu
CREATE TABLE table_55013 ( "Date" text, "Score" text, "Set 1" text, "Set 2" text, "Set 3" text, "Total" text )
What is the score for set 2 when set 3 was 15 6?
SELECT "Set 2" FROM table_55013 WHERE "Set 3" = '15–6'
wikisql
CREATE TABLE table_41116 ( "Round" real, "Race name" text, "Circuit" text, "City/State" text, "Date" text, "Winner(s)" text, "Team" text )
Which circuit had a round larger than 5?
SELECT "Circuit" FROM table_41116 WHERE "Round" > '5'
wikisql
CREATE TABLE table_name_79 ( abbreviation VARCHAR, inception VARCHAR, assets_us$billion VARCHAR )
What's the abbreviation for the country with an inception of 1999 and US$Billion assets of 7.1?
SELECT abbreviation FROM table_name_79 WHERE inception = "1999" AND assets_us$billion = "7.1"
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...
give me the number of patients whose admission type is emergency and ethnicity is white?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.ethnicity = "WHITE"
mimicsql_data
CREATE TABLE table_name_46 ( type VARCHAR, name VARCHAR )
What type of bridge is Colton's Crossing Bridge?
SELECT type FROM table_name_46 WHERE name = "colton's crossing bridge"
sql_create_context
CREATE TABLE table_11231 ( "Season" real, "Season Premiere" text, "Season Finale" text, "TV Season" text, "Rank" text, "Viewers (in millions)" real )
What was the rank of the 2009-2010 TV season?
SELECT "Rank" FROM table_11231 WHERE "TV Season" = '2009-2010'
wikisql
CREATE TABLE table_53243 ( "Rank" real, "Rider" text, "Team" text, "Speed" text, "Time" text )
What is the time of the rider with a speed of 102.962mph?
SELECT "Time" FROM table_53243 WHERE "Speed" = '102.962mph'
wikisql
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE cour...
What times is 398 taught during the Winter terms ?
SELECT DISTINCT course_offering.end_time, course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.start_time, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM course, course_offering, semester WHERE course.course_id = course_offe...
advising
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the correlation between employee_id and department_id in a scatter chart.
SELECT EMPLOYEE_ID, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE field ( fieldid int ) CREATE TABLE keyphr...
most cited parsing papers
SELECT DISTINCT cite.citedpaperid, COUNT(cite.citedpaperid) FROM cite, keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = cite.citedpaperid AND paper.paperid = paperkeyphrase.paperid GROUP BY cite.citedpaperid ORDER BY CO...
scholar
CREATE TABLE table_18224 ( "District" text, "Incumbent" text, "Party" text, "Elected" text, "Status" text, "Opponent" text )
How many incumbents represent district California 34?
SELECT COUNT("Incumbent") FROM table_18224 WHERE "District" = 'California 34'
wikisql
CREATE TABLE table_25353861_5 ( steals INTEGER )
What is the fewest steals any player had?
SELECT MIN(steals) FROM table_25353861_5
sql_create_context
CREATE TABLE table_65678 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
What is the result for the game before week 7 against BYE?
SELECT "Result" FROM table_65678 WHERE "Week" < '7' AND "Opponent" = 'bye'
wikisql
CREATE TABLE mzb ( 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...
2020年5月1日到2020年11月26日,编号为3006208的医院的小儿肛肠外科科室涉及到多少医疗费
SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.MED_SER_ORG_NO = '3006208' AND qtb.MED_ORG_DEPT_NM = '小儿肛肠外科' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.MED_SER_ORG_NO = '3006208' AND gyb.MED_ORG_DEPT_NM = '小儿肛肠外科' UNION SELECT zyb.MED_CLINIC_ID...
css
CREATE TABLE table_55037 ( "Outcome" text, "Date" text, "Surface" text, "Opponent" text, "Score" text )
Which surface has a Date of 5 november 2011?
SELECT "Surface" FROM table_55037 WHERE "Date" = '5 november 2011'
wikisql
CREATE TABLE table_name_1 ( year VARCHAR, uk_peak_position VARCHAR )
How many years had a film that peaked at #10 in the UK?
SELECT COUNT(year) FROM table_name_1 WHERE uk_peak_position = "10"
sql_create_context
CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
哪个检验报告单号所对应的是检验结果指标记录02569386743?
SELECT BGDH FROM jyjgzbb WHERE JYZBLSH = '02569386743'
css
CREATE TABLE table_name_82 ( octal INTEGER, hexadecimal VARCHAR, glyph VARCHAR )
What is the lowest octal with a 30 hexadecimal and less than 0 glyphs?
SELECT MIN(octal) FROM table_name_82 WHERE hexadecimal = 30 AND glyph < 0
sql_create_context
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
患者周雪枫的既往病历里共做过多少次检查,时间是从07年9月27日到16年8月29日
SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '周雪枫' AND t_kc22.STA_DATE BETWEEN '2007-09-27' AND '2016-08-29' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fgwyjz...
css
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, ...
provide me with the age and location of discharge for patient with patient id 2560.
SELECT demographic.age, demographic.discharge_location FROM demographic WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE document_drafts ( document_id number, draft_number number, draft_details text ) CREATE TABLE ref_document_status ( document_status_code text, document_status_description text ) CREATE TABLE employees ( employee_id number, role_code text, employee_name text, other_detai...
Which employee has showed up in most circulation history documents. List the employee's name and the number of drafts and copies.
SELECT employees.employee_name, COUNT(*) FROM employees JOIN circulation_history ON circulation_history.employee_id = employees.employee_id GROUP BY circulation_history.document_id, circulation_history.draft_number, circulation_history.copy_number ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_11734041_17 ( school_club_team_country VARCHAR, height_in_ft VARCHAR )
What school did the 7-4 player attend?
SELECT school_club_team_country FROM table_11734041_17 WHERE height_in_ft = "7-4"
sql_create_context
CREATE TABLE Functional_Areas ( functional_area_code VARCHAR(15), parent_functional_area_code VARCHAR(15), functional_area_description VARCHAR(80) ) CREATE TABLE Roles ( role_code VARCHAR(15), role_description VARCHAR(80) ) CREATE TABLE Document_Structures ( document_structure_code VARCHAR(15)...
Find the name and access counts of all documents, in alphabetic order of the document name. Show bar chart.
SELECT document_name, access_count FROM Documents ORDER BY document_name
nvbench
CREATE TABLE table_214479_8 ( y_ VARCHAR, _2009 VARCHAR, expression VARCHAR, month VARCHAR, d VARCHAR, e VARCHAR )
what is the y = 2009 when the expression is month = floor ((d + e + 114) / 31)?
SELECT y_ = _2009 FROM table_214479_8 WHERE expression = month = FLOOR((d + e + 114) / 31)
sql_create_context
CREATE TABLE table_26821 ( "Season" real, "Series" text, "Team" text, "Races" real, "Wins" real, "Poles" real, "FLaps" real, "Podiums" real, "Points" real, "Position" text )
What are the lowest points when poles were 0 and races were 10?
SELECT MIN("Points") FROM table_26821 WHERE "Poles" = '0' AND "Races" = '10'
wikisql
CREATE TABLE table_35438 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Last match" text, "Replaced by" text )
What is the last match with a resigned manner of departure and a round 1 date of vacancy?
SELECT "Last match" FROM table_35438 WHERE "Manner of departure" = 'resigned' AND "Date of vacancy" = 'round 1'
wikisql
CREATE TABLE table_name_40 ( constituency_number VARCHAR, number_of_electorates__2009_ INTEGER )
What is the constituency number with electorates (2009) number larger than 152,958?
SELECT constituency_number FROM table_name_40 WHERE number_of_electorates__2009_ > 152 OFFSET 958
sql_create_context
CREATE TABLE Institution ( Institution_id text, Institution text, Location text, Founded real, Type text, Enrollment int, Team text, Primary_Conference text, building_id text ) CREATE TABLE protein ( common_name text, protein_name text, divergence_from_human_lineage real...
Show institution names along with the number of proteins for each institution in a bar chart.
SELECT Institution, COUNT(*) FROM Institution AS T1 JOIN protein AS T2 ON T1.Institution_id = T2.Institution_id GROUP BY T1.Institution_id
nvbench
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE locations ( LOCAT...
For those employees who did not have any job in the past, draw a bar chart about the distribution of hire_date and the average of manager_id bin hire_date by weekday, sort in desc by the Y.
SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(MANAGER_ID) DESC
nvbench
CREATE TABLE table_name_71 ( catalog VARCHAR, country VARCHAR )
Which Catalog has a Country of Japan?
SELECT catalog FROM table_name_71 WHERE country = "japan"
sql_create_context
CREATE TABLE table_11254821_2 ( points_awarded__platinum_ VARCHAR, points_awarded__gold_ VARCHAR )
How many platinum points were awarded when 9 gold points were awarded?
SELECT points_awarded__platinum_ FROM table_11254821_2 WHERE points_awarded__gold_ = 9
sql_create_context
CREATE TABLE writer ( wid int, gender text, name text, nationality text, birth_city text, birth_year int ) CREATE TABLE written_by ( id int, msid int, wid int ) CREATE TABLE director ( did int, gender text, name text, nationality text, birth_city text, birth...
Find all actors from Austin born after 1980
SELECT name FROM actor WHERE birth_city = 'Austin' AND birth_year > 1980
imdb
CREATE TABLE table_34555 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game Site" text )
Which opponent was played at Forbes Field after week 4?
SELECT "Opponent" FROM table_34555 WHERE "Game Site" = 'forbes field' AND "Week" > '4'
wikisql
CREATE TABLE table_11236195_5 ( season VARCHAR, winningteam VARCHAR )
How many seasons did the canterbury bulldogs (8) win?
SELECT COUNT(season) FROM table_11236195_5 WHERE winningteam = "Canterbury Bulldogs (8)"
sql_create_context
CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, ...
I need to take ORTHO 568 - will it be offered in the Spring-Summer ?
SELECT COUNT(*) > 0 FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias0 WHERE COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id AND NOT COURSEalias0.course_id IN...
advising
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of name and the average of manufacturer , and group by attribute name, and order y-axis in descending order.
SELECT T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Manufacturer DESC
nvbench
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_items ( row_id number, itemid ...
has patient 5310 taken a d10w drug in a month before?
SELECT COUNT(*) > 0 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 = 5310)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'd10w' AND...
mimic_iii
CREATE TABLE table_name_86 ( title VARCHAR, release_date VARCHAR, production_num VARCHAR )
what is the title when the release date is 1938-12-17 and the production number is 8610?
SELECT title FROM table_name_86 WHERE release_date = "1938-12-17" AND production_num = "8610"
sql_create_context
CREATE TABLE table_58190 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
What is the time of retirement with Laps smaller than 66, a grid less than 10, and a Driver of heinz-harald frentzen?
SELECT "Time/Retired" FROM table_58190 WHERE "Laps" < '66' AND "Grid" < '10' AND "Driver" = 'heinz-harald frentzen'
wikisql
CREATE TABLE table_63958 ( "Name" text, "Nationality" text, "Races won" real, "Races ridden" real, "Win average" real )
How many races did the German racer that won less than 10 races ride?
SELECT COUNT("Races ridden") FROM table_63958 WHERE "Nationality" = 'german' AND "Races won" < '10'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wa...
what was the yearly average dose of volume (ml) norepinephrine that patient 028-56914 was taking until 8 months ago?
SELECT AVG(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-56914')) AND intakeoutput.celllabel = 'volum...
eicu
CREATE TABLE table_80001 ( "Name" text, "GP-GS" text, "Effic" real, "Att-Cmp-Int" text, "Avg/G" real )
Avg/G of 2.7 is what effic?
SELECT "Effic" FROM table_80001 WHERE "Avg/G" = '2.7'
wikisql
CREATE TABLE table_7545 ( "Name" text, "Date of Birth" text, "Height" real, "Weight" real, "Spike" real, "Block" real )
What is the smallest Weight, when Spike is less than 330, when Block is 315, and when Height is greater than 187?
SELECT MIN("Weight") FROM table_7545 WHERE "Spike" < '330' AND "Block" = '315' AND "Height" > '187'
wikisql
CREATE TABLE Financial_Transactions ( transaction_id INTEGER, account_id INTEGER, invoice_number INTEGER, transaction_type VARCHAR(15), transaction_date DATETIME, transaction_amount DECIMAL(19,4), transaction_comment VARCHAR(255), other_transaction_details VARCHAR(255) ) CREATE TABLE Or...
Show the transaction types and the total amount of transactions with a bar chart.
SELECT transaction_type, SUM(transaction_amount) FROM Financial_Transactions GROUP BY transaction_type
nvbench
CREATE TABLE table_name_92 ( name VARCHAR, time VARCHAR )
What is the Name, when the Time is 8:10.1?
SELECT name FROM table_name_92 WHERE time = "8:10.1"
sql_create_context
CREATE TABLE table_40001 ( "Round" real, "Overall" real, "Player" text, "Position" text, "College" text )
What is the Player from appalachian state?
SELECT "Player" FROM table_40001 WHERE "College" = 'appalachian state'
wikisql
CREATE TABLE table_name_70 ( Id VARCHAR )
What 2007 has 236 for 2006?
SELECT 2007 FROM table_name_70 WHERE 2006 = "236"
sql_create_context
CREATE TABLE player ( Player_ID int, name text, Position text, Club_ID int, Apps real, Tries real, Goals text, Points real ) CREATE TABLE club ( Club_ID int, name text, Region text, Start_year text ) CREATE TABLE competition_result ( Competition_ID int, Club_ID_...
What are the types of competition and number of competitions for that type Show bar chart, I want to display by the X-axis in descending.
SELECT Competition_type, COUNT(*) FROM competition GROUP BY Competition_type ORDER BY Competition_type DESC
nvbench
CREATE TABLE table_name_29 ( score VARCHAR, surface VARCHAR, opponent_in_the_final VARCHAR )
When playing against Yi Jingqian in the final on a hard surface what was the score?
SELECT score FROM table_name_29 WHERE surface = "hard" AND opponent_in_the_final = "yi jingqian"
sql_create_context
CREATE TABLE table_65354 ( "Draw" real, "Language" text, "Artist" text, "Place" real, "Points" real )
what is the highest draw when points is less than 11 and language is norwegian?
SELECT MAX("Draw") FROM table_65354 WHERE "Points" < '11' AND "Language" = 'norwegian'
wikisql
CREATE TABLE table_64755 ( "Rank" real, "Heat" real, "Lane" real, "Name" text, "Nationality" text, "Time" real )
What lane had a heat after 12, a rank of 38 and a time larger than 22.67?
SELECT AVG("Lane") FROM table_64755 WHERE "Heat" > '12' AND "Rank" = '38' AND "Time" > '22.67'
wikisql
CREATE TABLE table_name_49 ( played VARCHAR, drawn VARCHAR, points VARCHAR )
What is the number of matches played for the team with 0 draws and 33 points?
SELECT played FROM table_name_49 WHERE drawn = "0" AND points = "33"
sql_create_context
CREATE TABLE table_name_11 ( score VARCHAR, tie_no INTEGER )
What was the score when the Tie no less than 2?
SELECT score FROM table_name_11 WHERE tie_no < 2
sql_create_context
CREATE TABLE table_56811 ( "Race Name" text, "Circuit" text, "Date" text, "Winning driver" text, "Constructor" text, "Report" text )
Tell me the race name for ferrari on 25 april
SELECT "Race Name" FROM table_56811 WHERE "Constructor" = 'ferrari' AND "Date" = '25 april'
wikisql
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) 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, H...
施和畅这个病人在4094247这家医院的就诊记录中,查询在一零年九月二十五日到一三年二月八日期间开出的所有药品和编号
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc21_t_kc22.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '施和畅' AND t_kc21.MED_SER_ORG_NO = '4094247' AND t_kc21.IN_HOSP_DATE BETWEEN '2010-09-25' AND '2013-02-08')
css
CREATE TABLE table_73802 ( "City / Municipality" text, "No. of s Barangay" real, "District" real, "Area (km\u00b2)" text, "Population (2010)" real, "Income class (2007)" text, "ZIP code" real, "Mayor" text )
What is the total quantity of populace (2010) where location (km ) is 134.51
SELECT COUNT("Population (2010)") FROM table_73802 WHERE "Area (km\u00b2)" = '134.51'
wikisql
CREATE TABLE table_name_65 ( Id VARCHAR )
Name the 1997 for atp masters series 1992
SELECT 1997 FROM table_name_65 WHERE 1992 = "atp masters series"
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
what is the total number of patients who had combined right and left heart angiocardiography on elective admission?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.long_title = "Combined right and left heart angiocardiography"
mimicsql_data
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, ...
Most popular StackOverflow tags in Jan 2015.
SELECT num.TagName AS Tag, ROW_NUMBER() OVER (ORDER BY rate.Rate DESC) AS JanRank, ROW_NUMBER() OVER (ORDER BY num.Num DESC) AS TotalRank, rate.Rate AS QuestionsInJan, num.Num AS QuestionsTotal FROM (SELECT COUNT(PostId) AS Rate, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId AN...
sede
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
For those records from the products and each product's manufacturer, give me the comparison about the average of code over the name , and group by attribute name, could you list bar in descending order?
SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name DESC
nvbench
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 whose primary disease is stemi and admission year is less than 2155?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "STEMI" AND demographic.admityear < "2155"
mimicsql_data
CREATE TABLE table_name_1 ( played VARCHAR, lost VARCHAR )
What play has a loss of 2?
SELECT played FROM table_name_1 WHERE lost = "2"
sql_create_context
CREATE TABLE table_27548 ( "Authority" text, "Rate or precept" text, "Budget limit (\u00a3m)" text, "Budget plans (\u00a3m)" text, "Rate limit (p)" text, "Rate change (%)" text, "Desired rate (p)" text, "Desired rate change (%)" text )
What is the authority who set the budget limit ( m) at 900?
SELECT "Authority" FROM table_27548 WHERE "Budget limit (\u00a3m)" = '900'
wikisql
CREATE TABLE table_name_76 ( played VARCHAR, try_bonus VARCHAR, drawn VARCHAR )
Name the played with try bonus of 6 and drawn of 0
SELECT played FROM table_name_76 WHERE try_bonus = "6" AND drawn = "0"
sql_create_context
CREATE TABLE table_name_92 ( score VARCHAR, date VARCHAR )
What is the score of the game on 8 Sep 1990?
SELECT score FROM table_name_92 WHERE date = "8 sep 1990"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text...
从06年7月29日至14年1月26日之间患者陈怡宁所有检验结果指标记录中的仪器名称都叫什么?编号都是什么?
(SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jyb...
css
CREATE TABLE table_37223 ( "Disaster" text, "Type" text, "Location" text, "Deaths" text, "Date" text )
Where was the disaster located that took place on 1916?
SELECT "Location" FROM table_37223 WHERE "Date" = '1916'
wikisql
CREATE TABLE table_name_62 ( hexadecimal INTEGER, glyph VARCHAR, decimal VARCHAR, octal VARCHAR )
What is the average hexadecimal with a decimal less than 53, an octal less than 61, and a glyph greater than 0?
SELECT AVG(hexadecimal) FROM table_name_62 WHERE decimal < 53 AND octal < 61 AND glyph > 0
sql_create_context
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE employees ( EMPLOYEE_I...
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about salary over the first_name .
SELECT FIRST_NAME, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) 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 re...
Show me about the distribution of Date_of_Birth and Weight in a bar chart, and could you rank by the y axis from low to high?
SELECT Date_of_Birth, Weight FROM people ORDER BY Weight
nvbench
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE fare ( fare...
what airlines have BUSINESS class service between BOSTON and SAN FRANCISCO
SELECT DISTINCT airline.airline_code FROM airline, 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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND fare_basis.class_type = 'B...
atis
CREATE TABLE table_204_396 ( id number, "country" text, "masters" number, "u.s. open" number, "the open" number, "pga" number, "total" number )
what are the number of pga winning golfers that zimbabwe has ?
SELECT "pga" FROM table_204_396 WHERE "country" = 'zimbabwe'
squall
CREATE TABLE table_34428 ( "Player" text, "Hometown" text, "Occupation" text, "Education" text, "Game Status" text )
When the occupation was utility worker on-air talent, what was the game status?
SELECT "Game Status" FROM table_34428 WHERE "Occupation" = 'utility worker on-air talent'
wikisql
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, econom...
what is the cost of LIMOUSINE service at BOSTON airport
SELECT DISTINCT ground_service.ground_fare 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 = 'BOSTON' AND ground_service.airport_code = airport.airport_code AND ground_service.transport_type =...
atis