context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_53596 ( "Competition" text, "Current position / round" text, "Final position / round" text, "First match" text, "Last match" text )
Which competition had a final position/round of 2?
SELECT "Competition" FROM table_53596 WHERE "Final position / round" = '2'
wikisql
CREATE TABLE table_name_13 ( tournament VARCHAR, date VARCHAR )
What is the tournament on Apr 6?
SELECT tournament FROM table_name_13 WHERE date = "apr 6"
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescription...
what is the date of birth and admission time of patient name fernando wontor?
SELECT demographic.dob, demographic.admittime FROM demographic WHERE demographic.name = "Fernando Wontor"
mimicsql_data
CREATE TABLE table_51508 ( "Squad No." real, "Name" text, "Position" text, "League Apps" text, "League Goals" real, "FA Cup Apps" text, "FA Cup Goals" real, "League Cup Apps" text, "League Cup Goals" real, "FLT Apps" text, "FLT Goals" real, "Total Apps" text, "Total G...
Tell me the highest league goals with total goals less than 1 and FA cups more than 0
SELECT MAX("League Goals") FROM table_51508 WHERE "Total Goals" < '1' AND "FA Cup Goals" > '0'
wikisql
CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_...
what 's the lowest round trip fare from DENVER to PITTSBURGH
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_...
atis
CREATE TABLE table_77073 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text )
What is the sum of Overall, when Pick is greater than 5, when Round is less than 11, and when Name is 'Tom Barrington'?
SELECT SUM("Overall") FROM table_77073 WHERE "Pick" > '5' AND "Round" < '11' AND "Name" = 'tom barrington'
wikisql
CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE field ( fieldid int ) CREA...
Who has coauthored with Luke S Zettlemoyer ?
SELECT DISTINCT AUTHOR_1.authorid FROM author AS AUTHOR_0, author AS AUTHOR_1, writes AS WRITES_0, writes AS WRITES_1 WHERE AUTHOR_0.authorname = 'Luke S Zettlemoyer' AND WRITES_0.authorid = AUTHOR_0.authorid AND WRITES_1.authorid = AUTHOR_1.authorid AND WRITES_1.paperid = WRITES_0.paperid
scholar
CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE paperfield ( fieldid...
What is Kyunghyun Cho 's latest paper ?
SELECT DISTINCT writes.paperid FROM author, paper, writes WHERE author.authorname = 'Kyunghyun Cho' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid ORDER BY paper.year DESC
scholar
CREATE TABLE table_6378 ( "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
What was the surface for Adrian Ungur as an opponent?
SELECT "Surface" FROM table_6378 WHERE "Opponent" = 'adrian ungur'
wikisql
CREATE TABLE table_name_1 ( floor VARCHAR, pommel_horse VARCHAR, position VARCHAR, total VARCHAR )
What is the score of the floor when the position is less than 21, and less than 81.2 total, and the pommel horse score is 13.925?
SELECT floor FROM table_name_1 WHERE position < 21 AND total < 81.2 AND pommel_horse = "13.925"
sql_create_context
CREATE TABLE track ( Track_ID int, Name text, Location text, Seating real, Year_Opened real ) CREATE TABLE race ( Race_ID int, Name text, Class text, Date text, Track_ID text )
Display a pie chart for what are the different classes of races, and how many races correspond to each?
SELECT Class, COUNT(*) FROM race GROUP BY Class
nvbench
CREATE TABLE table_name_67 ( location VARCHAR, result VARCHAR )
Which Location has a result of L 31-52?
SELECT location FROM table_name_67 WHERE result = "l 31-52"
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE proced...
was there a urea nitrogen lab test performed on patient 15945 in 12/2105?
SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'urea nitrogen') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15945) AND STRFTIME('%y-%m', labevents.charttime) = '2105-12'
mimic_iii
CREATE TABLE table_3548 ( "Rank" real, "Couple" text, "Judges" real, "Public" real, "Total" real, "Vote percentage" text, "Result" text )
What was the vote % of Heather and Matt?
SELECT "Vote percentage" FROM table_3548 WHERE "Couple" = 'Heather and Matt'
wikisql
CREATE TABLE table_20805 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text )
What was the original air date of the episode titled 'Beaver's Pigeons
SELECT "Original air date" FROM table_20805 WHERE "Title" = 'Beaver''s Pigeons'
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...
how many patients whose insurance is government and diagnoses long title is alzheimer's disease?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Government" AND diagnoses.long_title = "Alzheimer's disease"
mimicsql_data
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 discharge location and primary disease of subject id 26285?
SELECT demographic.discharge_location, demographic.diagnosis FROM demographic WHERE demographic.subject_id = "26285"
mimicsql_data
CREATE TABLE journal_committee ( journal_ID VARCHAR, work_type VARCHAR ) CREATE TABLE journal ( sales INTEGER, journal_ID VARCHAR )
What is the average sales of the journals that have an editor whose work type is 'Photo'?
SELECT AVG(T1.sales) FROM journal AS T1 JOIN journal_committee AS T2 ON T1.journal_ID = T2.journal_ID WHERE T2.work_type = 'Photo'
sql_create_context
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varcha...
For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a bar chart about the distribution of hire_date and the average of department_id bin hire_date by time.
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE manufacturer ( Manufacturer_ID int, Open_Year real, Name text, Num_of_Factories int, Num_of_Shops int ) CREATE TABLE furniture ( Furniture_ID int, Name text, Num_of_Component int, Market_Rate real ) CREATE TABLE furniture_manufacte ( Manufacturer_ID int, Furnit...
Visualize the name and their component amounts with a bar chart for all furnitures that have more than 10 components, sort from high to low by the total number please.
SELECT Name, Num_of_Component FROM furniture WHERE Num_of_Component > 10 ORDER BY Num_of_Component DESC
nvbench
CREATE TABLE table_name_50 ( fuel VARCHAR, output VARCHAR )
Which Fuel has an Output of ps (kw; hp) @6000 rpm?
SELECT fuel FROM table_name_50 WHERE output = "ps (kw; hp) @6000 rpm"
sql_create_context
CREATE TABLE table_name_21 ( year VARCHAR )
Name the average 2008 for beijing and 2005 more than 2
SELECT AVG(2008) FROM table_name_21 WHERE year = "beijing" AND 2005 > 2
sql_create_context
CREATE TABLE table_name_28 ( time VARCHAR, away_team VARCHAR )
What was the time for the match with away team Mutual Team B?
SELECT time FROM table_name_28 WHERE away_team = "mutual team b"
sql_create_context
CREATE TABLE table_79595 ( "Game" text, "Date" text, "Opponent" text, "Score" text, "Location Attendance" text, "Record" text )
Who was their opponent in game 4?
SELECT "Opponent" FROM table_79595 WHERE "Game" = '4'
wikisql
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
Find All_Road and School_ID , and visualize them by a bar chart.
SELECT All_Road, School_ID FROM basketball_match
nvbench
CREATE TABLE table_16883 ( "Year" real, "Location" text, "1st Place" text, "2nd Place" text, "3rd Place" text, "4th Place" text, "5th Place" text )
What school placed 4th when Oklahoma State University (black) took 3rd place?
SELECT "4th Place" FROM table_16883 WHERE "3rd Place" = 'Oklahoma State University (Black)'
wikisql
CREATE TABLE table_name_30 ( notes VARCHAR, language VARCHAR, title VARCHAR )
What is the note section for the role with a language of hindi and a title of miley naa miley hum?
SELECT notes FROM table_name_30 WHERE language = "hindi" AND title = "miley naa miley hum"
sql_create_context
CREATE TABLE table_20403667_2 ( district VARCHAR, crop_damaged__in_lakh_inr__ VARCHAR )
How many districts had crib damage of 1,164.50?
SELECT COUNT(district) FROM table_20403667_2 WHERE crop_damaged__in_lakh_inr__ = "1,164.50"
sql_create_context
CREATE TABLE table_35462 ( "Series" text, "Date" text, "Entrants" real, "Winner" text, "First Prize" text )
What was the first prize for the FTOPS XIII series with more than 5,291 entrants?
SELECT "First Prize" FROM table_35462 WHERE "Entrants" > '5,291' AND "Series" = 'ftops xiii'
wikisql
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
For those records from the products and each product's manufacturer, return a bar chart about the distribution of headquarter and the average of code , and group by attribute headquarter, sort x-axis from low to high order.
SELECT T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T2.Headquarter
nvbench
CREATE TABLE climber ( Name VARCHAR, Points VARCHAR )
List the names of climbers in descending order of points.
SELECT Name FROM climber ORDER BY Points DESC
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
find out the number of patients who had aortography procedure and are less than 89 years of age.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "89" AND procedures.long_title = "Aortography"
mimicsql_data
CREATE TABLE table_name_46 ( crowd INTEGER, home_team VARCHAR )
I want to know the crowd with a home team of carlton
SELECT SUM(crowd) FROM table_name_46 WHERE home_team = "carlton"
sql_create_context
CREATE TABLE table_5615 ( "Rank" real, "Airline" text, "2012" real, "2011" real, "2010" real, "2009" real )
the sum of 2009 with rank of 5 and 2010 less than 76.5 is what?
SELECT SUM("2009") FROM table_5615 WHERE "Rank" = '5' AND "2010" < '76.5'
wikisql
CREATE TABLE table_3074 ( "Country" text, "Skip" text, "W" real, "L" real, "PF" real, "PA" real, "Ends Won" real, "Ends Lost" real, "Blank Ends" real, "Stolen Ends" real, "Shot %" text )
How many ends won were smaller than 46.0?
SELECT MAX("W") FROM table_3074 WHERE "Ends Won" < '46.0'
wikisql
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, ...
在11年2月3日到19年7月25日内的C反应蛋白在患者21776586身上是什么情况?
SELECT * FROM hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH WHERE hz_inf...
css
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 ta ( campus_job_id int, student_id int, location varchar ) CREATE TAB...
Are there any courses that 'll be beneficial in taking before taking GTBOOKS 993 ?
SELECT DISTINCT advisory_requirement FROM course WHERE department = 'GTBOOKS' AND number = 993
advising
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 jyjgzbb ( BGDH text, BGRQ tim...
在2017-05-28之前,患者24453147有哪些门诊就诊的检验报告单?看一下门诊就诊的流水号
SELECT zzmzjzjlb.JZLSH 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 = '24453147' AND NOT zzmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2017-05-28') UNION SELECT fzzmzjzjlb.JZLSH FROM hz_info JOI...
css
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) 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 admissions ( ...
when was the first measurement of patient 6215's arterial bp mean on the first icu visit?
SELECT chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 6215) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.itemid IN (S...
mimic_iii
CREATE TABLE table_name_5 ( record VARCHAR, opponent VARCHAR, loss VARCHAR )
What was the record where the opponent was @ Orioles and the loss was to Leal (5-4)?
SELECT record FROM table_name_5 WHERE opponent = "@ orioles" AND loss = "leal (5-4)"
sql_create_context
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
Show me about the distribution of ACC_Road and Team_ID , and group by attribute ACC_Home in a bar chart, and show by the x-axis in asc please.
SELECT ACC_Road, Team_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY ACC_Road
nvbench
CREATE TABLE zzmzjzjlb ( 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...
蒋荌荌患者被开出的所有检验报告单在07年5月7日到09年3月24日内的科室编码以及名称都是什么?
SELECT jybgb.KSBM, jybgb.KSMC FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_...
css
CREATE TABLE table_39709 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
What week shows for december 31, 1993?
SELECT COUNT("Week") FROM table_39709 WHERE "Date" = 'december 31, 1993'
wikisql
CREATE TABLE table_45440 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
Who was the opponent in the math that was played in Nice on a clay court?
SELECT "Opponent" FROM table_45440 WHERE "Surface" = 'clay' AND "Tournament" = 'nice'
wikisql
CREATE TABLE table_78042 ( "Full Name" text, "Nickname" text, "Gender" text, "Weight at birth" text, "Meaning" text )
What is the nickname of the baby with the birth weight of 730g (23.5 oz.)?
SELECT "Nickname" FROM table_78042 WHERE "Weight at birth" = '730g (23.5 oz.)'
wikisql
CREATE TABLE diagnoses_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 outputevents...
in 2102, how many times patient 84286 visited hospital?
SELECT COUNT(DISTINCT admissions.hadm_id) FROM admissions WHERE admissions.subject_id = 84286 AND STRFTIME('%y', admissions.admittime) = '2102'
mimic_iii
CREATE TABLE table_68451 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Time" text, "Record" text )
What was the attendance for the game that went 2:42?
SELECT MAX("Attendance") FROM table_68451 WHERE "Time" = '2:42'
wikisql
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE area ( course_id int, area varchar ) CREATE TAB...
Next semester , what upper-level electives are offered that do n't meet on Monday or Friday ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course_offering.friday = 'N' AND course_offering.monday = 'N' AND course.course_id = course_offering.course_id AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course...
advising
CREATE TABLE table_3271 ( "Episode Number" text, "Episode" text, "Original Airdate" text, "Rating" text, "Share" text, "Rating/Share (18\u201349)" text, "Viewers (millions)" text, "Weekly Rank" real )
What is the weekly rank of the episode with a 14 share whose original airdate was April 20, 2010?
SELECT "Weekly Rank" FROM table_3271 WHERE "Share" = '14' AND "Original Airdate" = 'April 20, 2010'
wikisql
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(...
Please show me how many employees working on different countries using a bar chart.
SELECT COUNTRY_NAME, COUNT(COUNTRY_NAME) FROM countries GROUP BY COUNTRY_NAME
nvbench
CREATE TABLE table_39764 ( "Season" real, "Bowl game" text, "Result" text, "Opponent" text, "Stadium" text, "Location" text, "Attendance" text )
What result has texas longhorns as the opponent?
SELECT "Result" FROM table_39764 WHERE "Opponent" = 'texas longhorns'
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...
provide the number of patients categorized under hematology lab test who are diagnosed with chronic combined systolic and diastolic heart failure.
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 = "Chr syst/diastl hrt fail" AND lab."CATEGORY" = "Hematology"
mimicsql_data
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester i...
181 is how big ?
SELECT DISTINCT num_enrolled FROM course WHERE department = 'EECS' AND number = 181
advising
CREATE TABLE table_name_74 ( greek_designation VARCHAR, us_state_district VARCHAR, charter_date VARCHAR )
What's the greek designation of the new york chapter with a charter date of april 23, 2005?
SELECT greek_designation FROM table_name_74 WHERE us_state_district = "new york" AND charter_date = "april 23, 2005"
sql_create_context
CREATE TABLE table_65132 ( "Heat" real, "Lane" real, "Name" text, "Nationality" text, "Time" text )
What's the heat in the lane less than 3 with a time of 14:48.39?
SELECT AVG("Heat") FROM table_65132 WHERE "Lane" < '3' AND "Time" = '14:48.39'
wikisql
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
Old questions with no answers.
SELECT Q.Id AS "post_link", Q.ViewCount AS Views, Q.Score, Q.CreationDate AS "creation_date", Q.AnswerCount AS Answers FROM Posts AS Q WHERE Q.PostTypeId = 1 AND Q.ClosedDate IS NULL AND Q.CommunityOwnedDate IS NULL AND Q.CreationDate < @maxAskTime AND Q.CreationDate > @minAskTime AND Q.AnswerCount = 0 AND Q.Score >= '...
sede
CREATE TABLE table_22124 ( "No. in series" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Prod. code" real, "Viewers (millions)" text )
Who directed 'People who use people'?
SELECT "Directed by" FROM table_22124 WHERE "Title" = 'People Who Use People'
wikisql
CREATE TABLE table_32337 ( "Name" text, "Circuit" text, "Date" text, "Winning driver" text, "Winning constructor" text, "Report" text )
Which Grand Prix did Nello Pagani win?
SELECT "Name" FROM table_32337 WHERE "Winning driver" = 'nello pagani'
wikisql
CREATE TABLE table_47320 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text )
WHAT IS THE OVERALL AVERAGE WITH A 22 PICK, FROM RICE COLLEGE, AND ROUND BIGGER THAN 10?
SELECT AVG("Overall") FROM table_47320 WHERE "Pick" = '22' AND "College" = 'rice' AND "Round" > '10'
wikisql
CREATE TABLE table_2638104_1 ( channel VARCHAR, broadcast_area VARCHAR )
How many channels are there in the Greater Tokyo area?
SELECT COUNT(channel) FROM table_2638104_1 WHERE broadcast_area = "Greater Tokyo"
sql_create_context
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE microlab ( microl...
has patient 027-136480 had in 2105 been diagnosed with diaphragmatic injury?
SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-136480')) AND diagnosis.diagnosisname = 'diaphragmatic injury' AND STRFT...
eicu
CREATE TABLE table_58573 ( "Match" real, "Date" text, "Competition or tour" text, "Ground" text, "Opponent" text, "Score1" text )
Which ground is match 4 held on?
SELECT "Ground" FROM table_58573 WHERE "Match" = '4'
wikisql
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
what were the four most commonly prescribed drugs at the same time , among the patients that were prescribed with bupropion hcl?
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'bupropion hcl') AS t1 JOIN (SELECT admissions.subject_id, prescri...
mimic_iii
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
在门诊被诊断为疾病J42.599的病人的检测指标805062数值的平均值以及最值数据是多少
SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJ...
css
CREATE TABLE All_Documents ( Document_ID INTEGER, Date_Stored DATETIME, Document_Type_Code CHAR(15), Document_Name CHAR(255), Document_Description CHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Roles ( Role_Code CHAR(15), Role_Name VARCHAR(255), Role_Description VARCHAR(255) )...
Stacked bar of date in locaton to and the number of date in locaton to colored by Location_Code, rank in desc by the y axis.
SELECT Date_in_Locaton_To, COUNT(Date_in_Locaton_To) FROM Document_Locations GROUP BY Location_Code ORDER BY COUNT(Date_in_Locaton_To) DESC
nvbench
CREATE TABLE table_35472 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Attendance" real )
before week 12 what was the attendance on 1983-11-21?
SELECT SUM("Attendance") FROM table_35472 WHERE "Date" = '1983-11-21' AND "Week" < '12'
wikisql
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
9823666这个医疗机构目前的总在院人数
SELECT COUNT(*) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '9823666' AND gwyjzb.HOSP_STS > 0 UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '9823666' AND fgwyjzb.HOSP_STS > 0
css
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsysto...
was patient 007-15837 on any volume (ml)-lactated ringers infusion in this hospital encounter?
SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-15837' AND patient.hospitaldischargetime IS NULL)) AND intakeoutpu...
eicu
CREATE TABLE table_35382 ( "Date" text, "Tournament" text, "Surface" text, "Partnering" text, "Opponents" text, "Score" text )
Surface of clay, and a Partnering of j lio silva had what score?
SELECT "Score" FROM table_35382 WHERE "Surface" = 'clay' AND "Partnering" = 'júlio silva'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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 t...
find the number of patients less than 68 years of age whose drug code is adva250ih.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "68" AND prescriptions.formulary_drug_cd = "ADVA250IH"
mimicsql_data
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
give me the number of patients whose diagnoses long title is acute diastolic heart failure and lab test fluid is ascites?
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.long_title = "Acute diastolic heart failure" AND lab.fluid = "Ascites"
mimicsql_data
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...
自2006.10.1起,止2018.12.20止,自付比例低于0.14的药品一共给患者钱嘉慕开出了多少
SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_NM = '钱嘉慕' AND t_kc22.STA_DATE BETWEEN '2006-10-01' AND '2018-12-20' AND t_kc22.SELF_PAY_PRO < 0.14 UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.PERSON_NM = '钱嘉慕' AND t_k...
css
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
give me the number of patients whose primary disease is acute subdural hematoma and year of birth is less than 2053?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ACUTE SUBDURAL HEMATOMA" AND demographic.dob_year < "2053"
mimicsql_data
CREATE TABLE Course_Authors_and_Tutors ( author_id INTEGER, author_tutor_ATB VARCHAR(3), login_name VARCHAR(40), password VARCHAR(40), personal_name VARCHAR(80), middle_name VARCHAR(80), family_name VARCHAR(80), gender_mf VARCHAR(1), address_line_1 VARCHAR(80) ) CREATE TABLE Student...
Find the dates of the tests taken with result 'Pass', and count them by a line chart
SELECT date_test_taken, COUNT(date_test_taken) FROM Student_Tests_Taken WHERE test_result = "Pass"
nvbench
CREATE TABLE Subjects ( subject_id INTEGER, subject_name VARCHAR(120) ) CREATE TABLE Students ( student_id INTEGER, date_of_registration DATETIME, date_of_latest_logon DATETIME, login_name VARCHAR(40), password VARCHAR(10), personal_name VARCHAR(40), middle_name VARCHAR(40), fam...
List each test result and its count in descending order of count by a bar chart.
SELECT test_result, COUNT(*) FROM Student_Tests_Taken GROUP BY test_result ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE submission ( Author VARCHAR, Scores VARCHAR )
What is the author of the submission with the highest score?
SELECT Author FROM submission ORDER BY Scores DESC LIMIT 1
sql_create_context
CREATE TABLE table_46696 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text )
What is the highest Pick, when College is 'Syracuse', and when Overall is less than 18?
SELECT MAX("Pick") FROM table_46696 WHERE "College" = 'syracuse' AND "Overall" < '18'
wikisql
CREATE TABLE table_66729 ( "# Tubes" text, "Converter" text, "Det/Pre-amp" text, "Audio Amp" text, "Rectifier" text )
Name the # tubes with Det/Pre-amp of x and audio amp of x x (push-pull)
SELECT "# Tubes" FROM table_66729 WHERE "Det/Pre-amp" = 'x' AND "Audio Amp" = 'x x (push-pull)'
wikisql
CREATE TABLE fgwyjzb ( 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, ...
查查医疗机构6786102患者做盐酸多奈哌齐胶囊的检查记录
SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '6786102' AND t_kc22.SOC_SRT_DIRE_NM = '盐酸多奈哌齐胶囊' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fgwyjzb.MED_SER_ORG_NO = '6786102' AND t_kc22.SOC_SR...
css
CREATE TABLE table_name_35 ( position VARCHAR, mls_team VARCHAR, pick__number VARCHAR )
What position does the Colorado Rapids pick after 15 play?
SELECT position FROM table_name_35 WHERE mls_team = "colorado rapids" AND pick__number > 15
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( la...
had patient 006-254182 in 01/last year been given a esr lab test?
SELECT COUNT(*) > 0 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-254182')) AND lab.labname = 'esr' AND DATETIME(lab.labresulttime, 'start of year') =...
eicu
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 icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit...
when did patient 23070 visit the hospital last in 2105?
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 23070 AND STRFTIME('%y', admissions.admittime) = '2105' ORDER BY admissions.admittime DESC LIMIT 1
mimic_iii
CREATE TABLE table_name_45 ( Id VARCHAR )
What is the 1999 for an A 1991, and a 1r 1997?
SELECT 1999 FROM table_name_45 WHERE 1991 = "a" AND 1997 = "1r"
sql_create_context
CREATE TABLE table_28483 ( "Week #" text, "Theme" text, "Song choice" text, "Original artist" text, "Order #" text, "Result" text )
What is the theme for the original artist Alicia Keys?
SELECT "Theme" FROM table_28483 WHERE "Original artist" = 'Alicia Keys'
wikisql
CREATE TABLE Order_Items ( order_item_id INTEGER, order_id INTEGER, product_id INTEGER, product_quantity VARCHAR(50), other_order_item_details VARCHAR(255) ) CREATE TABLE Product_Categories ( production_type_code VARCHAR(15), product_type_description VARCHAR(80), vat_rating DECIMAL(19,4...
Show the relationship between account name and the number of transactions for each account in a scatter chart.
SELECT account_name, COUNT(*) FROM Financial_Transactions AS T1 JOIN Accounts AS T2 ON T1.account_id = T2.account_id GROUP BY T1.account_id
nvbench
CREATE TABLE table_59085 ( "German" text, "Low German" text, "Plautdietsch" text, "Dutch" text, "English" text )
Which Plautdietsch has Dutch of maken?
SELECT "Plautdietsch" FROM table_59085 WHERE "Dutch" = 'maken'
wikisql
CREATE TABLE table_36088 ( "Home (1st leg)" text, "Home (2nd leg)" text, "1st Leg" text, "2nd leg" text, "Aggregate" text )
What aggregate has a 0-0 1st leg, and is from Instituto?
SELECT "Aggregate" FROM table_36088 WHERE "1st Leg" = '0-0' AND "Home (2nd leg)" = 'instituto'
wikisql
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 decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE job_history ( EMPLO...
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, draw a bar chart about the distribution of job_id and the average of employee_id , and group by attribute job_id, could you order from low to high by the total number?
SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY AVG(EMPLOYEE_ID)
nvbench
CREATE TABLE table_15887683_3 ( content VARCHAR, package_option VARCHAR )
How many different contents are offered by the Qualsiasi Tranne Sky HD package?
SELECT COUNT(content) FROM table_15887683_3 WHERE package_option = "qualsiasi tranne Sky HD"
sql_create_context
CREATE TABLE table_67067 ( "Season" real, "Series" text, "Wins" text, "Podiums" text, "Position" text )
What is the Series, when the Season is after 2008, when the value for Podiums is 3, and when the Position is 8th?
SELECT "Series" FROM table_67067 WHERE "Season" > '2008' AND "Podiums" = '3' AND "Position" = '8th'
wikisql
CREATE TABLE table_30667 ( "Couple" text, "Style" text, "Music" text, "Trine Dehli Cleve" real, "Tor Fl\u00f8ysvik" real, "Karianne Gulliksen" real, "Christer Tornell" real, "Total" real )
how many for floysvik and christer tornell is 7?
SELECT COUNT("Tor Fl\u00f8ysvik") FROM table_30667 WHERE "Christer Tornell" = '7'
wikisql
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_...
Of all the courses , has John Nanos ever taught CHE 485 ?
SELECT COUNT(*) > 0 FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'CHE' AND course.number = 485 AND instructor.name LIKE '%John Nanos%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offe...
advising
CREATE TABLE table_32086 ( "Original week" real, "Date" text, "Opponent" text, "Result" text, "Venue" text )
Tell me the average original week for soldier field
SELECT AVG("Original week") FROM table_32086 WHERE "Venue" = 'soldier field'
wikisql
CREATE TABLE table_train_211 ( "id" int, "systolic_blood_pressure_sbp" int, "hiv_infection" bool, "hemoglobin_a1c_hba1c" float, "diastolic_blood_pressure_dbp" int, "body_mass_index_bmi" float, "age" float, "NOUSE" float )
history of hiv
SELECT * FROM table_train_211 WHERE hiv_infection = 1
criteria2sql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE wdmzjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH number, KH text, KLX num...
患者98927870为检测指标229548从06年10月2日到2011年7月16日之内的医务人员工号与姓名都是什么?
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM 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....
css
CREATE TABLE table_65050 ( "Driver" text, "Navigator" text, "Vehicle" text, "Class" text, "Capacity" real, "Total Time" text, "Margin" text )
What is the average capacity for the vehicle having a navigator of Macneall?
SELECT AVG("Capacity") FROM table_65050 WHERE "Navigator" = 'macneall'
wikisql
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) 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 varc...
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about employee_id over the job_id .
SELECT JOB_ID, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE table_25235489_2 ( november_3 VARCHAR, january_15_16 VARCHAR )
How many times does November 3rd occur when January 15, 1991 does?
SELECT COUNT(november_3) FROM table_25235489_2 WHERE january_15_16 = "January 15, 1991"
sql_create_context
CREATE TABLE table_2209 ( "ILO code" text, "Field" text, "conclusion date" text, "entry into force" text, "closure for signature" text, "Parties (April 2011)" real, "Denunciations (September 2011)" real, "revising convention(s)" text, "text and ratifications" text )
What was the revising convention of the field 'trimmers and stokers'?
SELECT "revising convention(s)" FROM table_2209 WHERE "Field" = 'trimmers and stokers'
wikisql
CREATE TABLE table_2667 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Replaced by" text, "Date of appointment" text, "Position in table" text )
Name the date of vacancy for manuel pellegrini
SELECT "Date of vacancy" FROM table_2667 WHERE "Outgoing manager" = 'Manuel Pellegrini'
wikisql