context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_74623 ( "Rank" real, "Name" text, "Club" text, "Season" text, "Length" real )
What name is associated with a longer length than 903?
SELECT "Name" FROM table_74623 WHERE "Length" > '903'
wikisql
CREATE TABLE table_name_93 ( money___ INTEGER, country VARCHAR, player VARCHAR )
What is the most money United States player Bob Gilder won?
SELECT MAX(money___) AS $__ FROM table_name_93 WHERE country = "united states" AND player = "bob gilder"
sql_create_context
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) ...
what is the minimum cost of the total hospital to include a drug called neomycin-polymyxin-gramicidin?
SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'neomycin-polymyxin-gramicidin') GROUP BY cost.hadm_id) AS t1
mimic_iii
CREATE TABLE table_name_34 ( bronze INTEGER, rank VARCHAR, total VARCHAR )
With 8 as the rank, and a total of more than 2 medals what is the average bronze medals?
SELECT AVG(bronze) FROM table_name_34 WHERE rank = "8" AND total > 2
sql_create_context
CREATE TABLE table_name_53 ( bronze INTEGER, gold VARCHAR, silver VARCHAR )
What is the total number of bronze when gold is less than 1 and silver is more than 1?
SELECT SUM(bronze) FROM table_name_53 WHERE gold < 1 AND silver > 1
sql_create_context
CREATE TABLE table_27615520_1 ( speed___iops__ VARCHAR, storage_medium VARCHAR )
What is the Input/output operations per second for the emlc flash?
SELECT speed___iops__ FROM table_27615520_1 WHERE storage_medium = "eMLC Flash"
sql_create_context
CREATE TABLE pilot_record ( Record_ID int, Pilot_ID int, Aircraft_ID int, Date text ) CREATE TABLE aircraft ( Aircraft_ID int, Order_Year int, Manufacturer text, Model text, Fleet_Series text, Powertrain text, Fuel_Propulsion text ) CREATE TABLE pilot ( Pilot_ID int, ...
Compute the total the total number across nationality as a pie chart.
SELECT Nationality, COUNT(*) FROM pilot GROUP BY Nationality
nvbench
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_...
i need flight numbers and airlines for flights departing from OAKLAND to SALT LAKE CITY on thursday departing before 800
SELECT DISTINCT airline.airline_code, flight.flight_number FROM airline, flight WHERE (((flight.departure_time < 800 AND flight.flight_days IN (SELECT DAYSalias0.days_code FROM days AS DAYSalias0 WHERE DAYSalias0.day_name IN (SELECT DATE_DAYalias0.day_name FROM date_day AS DATE_DAYalias0 WHERE DATE_DAYalias0.day_number...
atis
CREATE TABLE table_name_74 ( gross VARCHAR, studio VARCHAR, director_s_ VARCHAR )
The 20th Century Fox film directed by Joel Schumacher grossed how much?
SELECT gross FROM table_name_74 WHERE studio = "20th century fox" AND director_s_ = "joel schumacher"
sql_create_context
CREATE TABLE table_27814 ( "Position" real, "Sail number" text, "Yacht" text, "State/country" text, "Yacht type" text, "LOA (Metres)" text, "Skipper" text, "Elapsed time d:hh:mm:ss" text )
What state/country was the yacht that had an elapsed time of 3:04:06:38 from?
SELECT "State/country" FROM table_27814 WHERE "Elapsed time d:hh:mm:ss" = '3:04:06:38'
wikisql
CREATE TABLE table_78619 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What is the place number for the player with a To Par score of 'E'?
SELECT "Place" FROM table_78619 WHERE "To par" = 'e'
wikisql
CREATE TABLE table_name_38 ( area__km_2__ INTEGER, name VARCHAR, population__2011_ VARCHAR )
For Stellenbosch, which has a population larger than 155,733, what is the average area?
SELECT AVG(area__km_2__) FROM table_name_38 WHERE name = "stellenbosch" AND population__2011_ > 155 OFFSET 733
sql_create_context
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Dorm_amenity ( ameni...
Find the number of students who are not in the largest major and group by students' first name in a bar chart, and order in ascending by the Y-axis.
SELECT Fname, COUNT(Fname) FROM Student WHERE Major <> (SELECT Major FROM Student) GROUP BY Fname ORDER BY COUNT(Fname)
nvbench
CREATE TABLE table_57567 ( "Coach" text, "Season" text, "Record" text, "Home" text, "Away" text, "Win %" real, "Average (Total) Home Attendance" text )
What is the away score with a record of 7-4, win% of 0.637, and 2010 season?
SELECT "Away" FROM table_57567 WHERE "Record" = '7-4' AND "Win %" = '0.637' AND "Season" = '2010'
wikisql
CREATE TABLE game ( stadium_id int, id int, Season int, Date text, Home_team text, Away_team text, Score text, Competition text ) CREATE TABLE stadium ( id int, name text, Home_Games int, Average_Attendance real, Total_Attendance real, Capacity_Percentage real ) ...
Show the number of games for each away team in a bar chart, I want to display by the Y-axis in desc.
SELECT Away_team, COUNT(Away_team) FROM game GROUP BY Away_team ORDER BY COUNT(Away_team) DESC
nvbench
CREATE TABLE table_73712 ( "Name" text, "Municipal district" text, "Population (2011)" real, "Population (2006)" real, "Change (%)" text, "Land area (km\u00b2)" text, "Population density (per km 2 )" text )
What is the density per km in Smoky Lake County?
SELECT "Population density (per km 2 )" FROM table_73712 WHERE "Municipal district" = 'Smoky Lake County'
wikisql
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE ...
Tags with most answers for the given user.
SELECT t.TagName, COUNT(a.Id) AS "count", SUM(a.Score) AS "score" FROM Posts AS a INNER JOIN Posts AS q ON a.ParentId = q.Id INNER JOIN PostTags AS pt ON pt.PostId = q.Id INNER JOIN Tags AS t ON t.Id = pt.TagId WHERE (a.OwnerUserId = '##userid?39599##') GROUP BY t.TagName ORDER BY COUNT(a.Id) DESC
sede
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId num...
All user edits that isn't on their post.
SELECT ph.PostId AS "post_link", * FROM PostHistory AS ph JOIN Posts AS p ON ph.PostId = p.Id WHERE p.OwnerUserId != '##UserId##' AND ph.UserId = '##UserId##'
sede
CREATE TABLE table_27985 ( "Rnd" text, "Circuit" text, "Location" text, "Date" text, "Pole position" text, "Fastest lap" text, "Most laps led" text, "Winning driver" text, "Winning team" text, "Supporting" text )
What location(s) did patrick mckenna lead the most laps?
SELECT "Location" FROM table_27985 WHERE "Most laps led" = 'Patrick McKenna'
wikisql
CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE field ( fieldid int ) CREATE TABLE key...
who has the most papers in semantic parsing after 2005 ?
SELECT DISTINCT COUNT(paper.paperid), writes.authorid FROM keyphrase, paper, paperkeyphrase, writes WHERE keyphrase.keyphrasename = 'semantic parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year > 2005 AND writes.paperid = paper.paperid GROUP BY write...
scholar
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, ...
find the number of black/african american patients.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN"
mimicsql_data
CREATE TABLE table_204_204 ( id number, "rank" number, "heat" number, "country" text, "cyclists" text, "result" number, "notes" text )
which team had the fastest time ?
SELECT "country" FROM table_204_204 ORDER BY "result" LIMIT 1
squall
CREATE TABLE table_name_47 ( result VARCHAR, competition VARCHAR, venue VARCHAR )
What is the result of the friendly match in Seoul?
SELECT result FROM table_name_47 WHERE competition = "friendly match" AND venue = "seoul"
sql_create_context
CREATE TABLE table_48862 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What is Player, when Country is United States, and when Score is 70-72-70=212?
SELECT "Player" FROM table_48862 WHERE "Country" = 'united states' AND "Score" = '70-72-70=212'
wikisql
CREATE TABLE table_203_38 ( id number, "#" number, "title" text, "producer(s)" text, "performer(s)" text, "length" text )
who produced the last track of the album ?
SELECT "producer(s)" FROM table_203_38 ORDER BY "#" DESC LIMIT 1
squall
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TAB...
until 04/2102, what was the daily average weight of patient 002-39753?
SELECT AVG(patient.admissionweight) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-39753') AND NOT patient.admissionweight IS NULL AND STRFTIME('%y-%m', patient.unitadmittime) <= '2102-04' GROUP BY STRFTIME('%y-%m-%d', patien...
eicu
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, ...
看看19年12月9号到20年6月11号9038216这个医疗机构特需门诊的就诊记录
SELECT COUNT(*) FROM ftxmzjzjlb WHERE ftxmzjzjlb.ZSEBZ = '9038216' AND ftxmzjzjlb.JZKSRQ BETWEEN '2019-12-09' AND '2020-06-11'
css
CREATE TABLE table_23842 ( "Seed" real, "Player" text, "Marseille (32 draw)" text, "Metz (32)" text, "Lyon (32)" text, "Paris (48 - byes)" text )
In what round was lyon (32) a 5 seed?
SELECT "Lyon (32)" FROM table_23842 WHERE "Seed" = '5'
wikisql
CREATE TABLE table_name_77 ( economic_class VARCHAR, barangay VARCHAR )
Which Economic Class has a Barangay of imelda bliss village?
SELECT economic_class FROM table_name_77 WHERE barangay = "imelda bliss village"
sql_create_context
CREATE TABLE table_name_86 ( ratings VARCHAR, year VARCHAR, lap_by_lap VARCHAR )
When the Year is smaller than 2004, and Mike Joy is the Lap-by-lap, what are the Ratings?
SELECT ratings FROM table_name_86 WHERE year < 2004 AND lap_by_lap = "mike joy"
sql_create_context
CREATE TABLE wdmzjzjlb ( 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...
患者潘德运在09年8月4日到21年6月15日内都做了什么检查把检验报告单号列出来
SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '潘...
css
CREATE TABLE 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 price over the name , and group by attribute founder by a bar chart, display y axis in desc order.
SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Price DESC
nvbench
CREATE TABLE table_1281200_1 ( new_entries_this_round VARCHAR, round VARCHAR )
From the round name of third round; what would the new entries this round that would be found?
SELECT new_entries_this_round FROM table_1281200_1 WHERE round = "Third round"
sql_create_context
CREATE TABLE table_31517 ( "Townland" text, "Area( acres )" real, "Barony" text, "Civil parish" text, "Poor law union" text )
What is the area when the poor law union is skibbereen and the townland is knockmore?
SELECT "Area( acres )" FROM table_31517 WHERE "Poor law union" = 'Skibbereen' AND "Townland" = 'Knockmore'
wikisql
CREATE TABLE table_name_86 ( lecturers INTEGER, department VARCHAR, full_professors VARCHAR )
What is the least amount of lecturers in the accounting department with less than 5 full professors?
SELECT MIN(lecturers) FROM table_name_86 WHERE department = "accounting" AND full_professors < 5
sql_create_context
CREATE TABLE table_name_19 ( outcome VARCHAR, score VARCHAR )
Which Outcome has a Score of 6 4, 6 4, 6 2?
SELECT outcome FROM table_name_19 WHERE score = "6–4, 6–4, 6–2"
sql_create_context
CREATE TABLE table_2847 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
On which datebis arco arena 17361 the location attendance?
SELECT "Date" FROM table_2847 WHERE "Location Attendance" = 'Arco Arena 17361'
wikisql
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 employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), ...
For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of email and manager_id , and list x-axis in ascending order please.
SELECT EMAIL, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMAIL
nvbench
CREATE TABLE table_test_15 ( "id" int, "anemia" bool, "cell_therapy" bool, "hiv_infection" bool, "hemoglobin_a1c_hba1c" float, "body_weight" float, "renal_disease" bool, "creatinine_clearance_cl" float, "active_hepatitis" bool, "chronic_inflammatory_disease" bool, "platelet_c...
hemoglobin < 10 g / dl
SELECT * FROM table_test_15 WHERE hemoglobin_a1c_hba1c < 10
criteria2sql
CREATE TABLE event ( Event_ID int, Date text, Venue text, Name text, Event_Attendance int ) CREATE TABLE journalist ( journalist_ID int, Name text, Nationality text, Age text, Years_working int ) CREATE TABLE news_report ( journalist_ID int, Event_ID int, Work_Type ...
What are the nationalities and their average ages of journalists. Show me a bar chart.
SELECT Nationality, AVG(Age) FROM journalist GROUP BY Nationality
nvbench
CREATE TABLE table_3383 ( "Season" text, "Games started" real, "20 rebounds" real, "10 rebounds" real, "10 offensive rebounds" real, "Double double" real, "Rebounding high" real )
List all rebounds equal to 10 for Dennis Rodman 's 1991 92 season
SELECT "10 rebounds" FROM table_3383 WHERE "Season" = '1991–92'
wikisql
CREATE TABLE table_56934 ( "District" real, "Place of Birth" text, "Delegate" text, "Party" text, "Took Office" real, "Committee" text )
Where was the delegate belonging to the Judiciary committee of district 43 born?
SELECT "Place of Birth" FROM table_56934 WHERE "Committee" = 'judiciary' AND "District" = '43'
wikisql
CREATE TABLE table_24535095_2 ( truck_s_ VARCHAR, crew_chief VARCHAR )
Name the truck for eric phillips
SELECT truck_s_ FROM table_24535095_2 WHERE crew_chief = "Eric Phillips"
sql_create_context
CREATE TABLE table_76712 ( "Week" text, "Theme" text, "Artist" text, "Order sung" text, "Status" text )
What is the status when the artist is Neil Sedaka?
SELECT "Status" FROM table_76712 WHERE "Artist" = 'neil sedaka'
wikisql
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE VoteTypes ( Id number, Name text ) C...
Which of my questions did Jon Skeet answer?.
SELECT Questions.Title AS Question, 'https://stackoverflow.com/a/' + CAST(Answers.Id AS TEXT) AS Url FROM Posts AS Questions JOIN Posts AS Answers ON Answers.PostTypeId = 2 AND Answers.ParentId = Questions.Id WHERE Questions.OwnerUserId = @UserId AND Questions.PostTypeId = 1 AND Answers.OwnerUserId = @jonSkeetUserId
sede
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event...
what was the difference between the total amount of patient 702's input and output?
SELECT (SELECT SUM(inputevents_cv.amount) 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 = 702))) - (SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icus...
mimic_iii
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid n...
what is the minimum total cost of the hospital, which includes the laboratory gentamicin test during a year before?
SELECT MIN(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 = 'gentamicin')) AND DATETIME(cost.chargetime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of yea...
mimic_iii
CREATE TABLE teachers ( LastName TEXT, FirstName TEXT, Classroom INTEGER ) CREATE TABLE list ( LastName TEXT, FirstName TEXT, Grade INTEGER, Classroom INTEGER )
For each grade, show me the relationships between grade and the total number of students in the grade.
SELECT Grade, COUNT(*) FROM list GROUP BY Grade
nvbench
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_DIRE_CD text, MED_DIRE_NM text,...
二零一五年十月二十六日到二零一八年七月九日,9987120医院的科室小儿胃肠外科涉及到多少医疗费用
SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '9987120' AND t_kc21.MED_ORG_DEPT_NM = '小儿胃肠外科') AND t_kc24.CLINIC_SLT_DATE BETWEEN '2015-10-26' AND '2018-07-09'
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, ...
how many patients are diagnosed with unspecified hereditary and idiopathic peripheral neuropathy and suggested the base drug type?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Unspecified hereditary and idiopathic peripheral neuropathy" AND prescriptions.drug_type = ...
mimicsql_data
CREATE TABLE table_name_12 ( away_team VARCHAR, home_team VARCHAR )
What is the score of the away team when the home team is Essendon?
SELECT away_team AS score FROM table_name_12 WHERE home_team = "essendon"
sql_create_context
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 demographic (...
give me the number of patients whose insurance is private and procedure long title is suture of artery?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.long_title = "Suture of artery"
mimicsql_data
CREATE TABLE table_40303 ( "Tournament" text, "1996" text, "1997" text, "1998" text, "1999" text, "2000" text, "2001" text, "2002" text, "2003" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text...
What was in 2007 that is from 2004 0f 2r and 2010 of A?
SELECT "2007" FROM table_40303 WHERE "2004" = '2r' AND "2010" = 'a'
wikisql
CREATE TABLE table_51112 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
COunt the silver that has a Bronze smaller than 1?
SELECT SUM("Silver") FROM table_51112 WHERE "Bronze" < '1'
wikisql
CREATE TABLE table_name_63 ( rank VARCHAR, year VARCHAR )
What is rank of the year 1956?
SELECT rank FROM table_name_63 WHERE year = "1956"
sql_create_context
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
门诊诊断病患为慢性咽炎的相应人数是多少?名称叫什么?籍贯代码是多少?
SELECT person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) FROM person_info JOIN hz_info JOIN wdmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE wdmzjzjlb.JZZDSM = '慢性咽炎' GROUP BY person_info.JGDM UNION SELECT pe...
css
CREATE TABLE table_name_11 ( matches VARCHAR, team VARCHAR )
Name the matches for gold coast
SELECT matches FROM table_name_11 WHERE team = "gold coast"
sql_create_context
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
患者53311855自二零零四年八月二日开始,截止到二零一七年一月二十九日,由哪几位医务人员为其检测二氧化碳的,查查这些医务人员的工号及姓名
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_name_79 ( week VARCHAR, result VARCHAR )
Which week has a Result of w 23 6?
SELECT week FROM table_name_79 WHERE result = "w 23–6"
sql_create_context
CREATE TABLE table_14046 ( "Polling firm" text, "Dates" text, "Prog. Cons." text, "New Democratic" text, "Liberal" text )
According to the August 2007 poll by the Corporate Research Associates that reported 32% Prog. Cons., what percentage aligned with the Liberal party?
SELECT "Liberal" FROM table_14046 WHERE "Polling firm" = 'corporate research associates' AND "Prog. Cons." = '32%' AND "Dates" = 'august 2007'
wikisql
CREATE TABLE table_30732 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What were the supersonics record at game 2?
SELECT "Record" FROM table_30732 WHERE "Game" = '2'
wikisql
CREATE TABLE table_27721131_2 ( team VARCHAR, high_assists VARCHAR, score VARCHAR )
What's the team number with John Wall (9) in high assists and a w 97 83 (ot) score?
SELECT COUNT(team) FROM table_27721131_2 WHERE high_assists = "John Wall (9)" AND score = "W 97–83 (OT)"
sql_create_context
CREATE TABLE table_39007 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents in the final" text, "Score" text )
What was the outcome on 13 may 2007?
SELECT "Outcome" FROM table_39007 WHERE "Date" = '13 may 2007'
wikisql
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, ...
what is the one year survival rate of hypotension / pressor dependent patients who were prescribed ondansetron (zofran) injection 4 mg?
SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 1 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid...
eicu
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TA...
what procedure did patient 006-158338 receive the last time since 6 years ago.
SELECT treatment.treatmentname FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-158338')) AND DATETIME(treatment.treatmenttime) >= DATETIME(C...
eicu
CREATE TABLE wrestler ( wrestler_id number, name text, reign text, days_held text, location text, event text ) CREATE TABLE elimination ( elimination_id text, wrestler_id text, team text, eliminated_by text, elimination_move text, time text )
What are the names of wrestlers and the elimination moves?
SELECT T2.name, T1.elimination_move FROM elimination AS T1 JOIN wrestler AS T2 ON T1.wrestler_id = T2.wrestler_id
spider
CREATE TABLE table_5254 ( "Name" text, "Nationality" text, "Position" text, "Tenure Began" real, "Term Ending" real )
Position of member, and a Tenure Began of 2010, and a Name of xue hanqin has what lowest term ending?
SELECT MIN("Term Ending") FROM table_5254 WHERE "Position" = 'member' AND "Tenure Began" = '2010' AND "Name" = 'xue hanqin'
wikisql
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 demographic ...
what is the number of patients whose gender is m and drug name is eplerenone?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "M" AND prescriptions.drug = "Eplerenone"
mimicsql_data
CREATE TABLE table_51664 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
What is the smallest grid with collision as the Time/Retired for pedro diniz?
SELECT MIN("Grid") FROM table_51664 WHERE "Time/Retired" = 'collision' AND "Driver" = 'pedro diniz'
wikisql
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE...
among patients who have been diagnosed with tobacco use disorder tell me the three year survival rate.
SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.charttime) > 3 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id...
mimic_iii
CREATE TABLE table_14752049_2 ( change__2010_to_2011_ VARCHAR, international_tourist_arrivals__2011_ VARCHAR )
What are the changes (2010 to 2011) where the International Tourist Arrivals is 1.7 million?
SELECT change__2010_to_2011_ FROM table_14752049_2 WHERE international_tourist_arrivals__2011_ = "1.7 million"
sql_create_context
CREATE TABLE table_name_29 ( score VARCHAR, away_team VARCHAR )
what is the score when the away team is tottenham hotspur?
SELECT score FROM table_name_29 WHERE away_team = "tottenham hotspur"
sql_create_context
CREATE TABLE table_60883 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text )
Which player had a total of 295?
SELECT "Player" FROM table_60883 WHERE "Total" = '295'
wikisql
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 lab ( subject_id text, hadm_id text, ...
tell me the primary disease and type of drug prescribed to patient with patient id 2560.
SELECT demographic.diagnosis, prescriptions.drug_type FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
3219625这个医院的最长医疗住院时长少于10天的有多少科室
SELECT COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '3219625' GROUP BY t_kc21.MED_ORG_DEPT_CD HAVING MAX(t_kc21.IN_HOSP_DAYS) < 10) AS T
css
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TA...
when was the last time that patient 003-48563 was diagnosed with pleural effusion - bilateral?
SELECT diagnosis.diagnosistime FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '003-48563')) AND diagnosis.diagnosisname = 'pleural effusion - bi...
eicu
CREATE TABLE table_16729930_18 ( gpu_frequency VARCHAR, tdp VARCHAR, part_number_s_ VARCHAR )
For a processor with part number cy80632007221ab and TDP of 3.6 W, What are the available GPU frequencies?
SELECT gpu_frequency FROM table_16729930_18 WHERE tdp = "3.6 W" AND part_number_s_ = "CY80632007221AB"
sql_create_context
CREATE TABLE table_name_88 ( final VARCHAR, event VARCHAR )
What is the final for middleweight 75 kg?
SELECT final FROM table_name_88 WHERE event = "middleweight –75 kg"
sql_create_context
CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departur...
tell me about flights from TORONTO to SALT LAKE CITY leaving after 1730
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 WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SALT LAKE CITY' AND flight.departure_time > 1730 AND flight.to_airport = AIRPORT_SERVICE_...
atis
CREATE TABLE table_name_29 ( award VARCHAR, nominee VARCHAR )
What was Matthew Warchus' Award?
SELECT award FROM table_name_29 WHERE nominee = "matthew warchus"
sql_create_context
CREATE TABLE table_name_34 ( season VARCHAR, location VARCHAR )
How many seasons took place in aspen, usa?
SELECT COUNT(season) FROM table_name_34 WHERE location = "aspen, usa"
sql_create_context
CREATE TABLE table_5051 ( "Game" text, "Date" text, "Home Team" text, "Result" text, "Road Team" text )
What was the result for Portland at home on June 12?
SELECT "Result" FROM table_5051 WHERE "Home Team" = 'portland' AND "Date" = 'june 12'
wikisql
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 minimum age of patients whose marital status is married and admission location is ** info not available **?
SELECT MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.admission_location = "** INFO NOT AVAILABLE **"
mimicsql_data
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, ...
Number of posts per year.
SELECT YEAR(CreationDate), COUNT(Id) FROM Posts WHERE AnswerCount > 1 GROUP BY YEAR(CreationDate)
sede
CREATE TABLE table_45613 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Replaced by" text, "Date of appointment" text, "Position in table" text )
What team replaced their manager on 9 December 2008?
SELECT "Team" FROM table_45613 WHERE "Date of vacancy" = '9 december 2008'
wikisql
CREATE TABLE table_203_257 ( id number, "week" number, "date" text, "opponent" text, "result" text, "attendance" number )
how many games did the 1981 atlanta falcons win ?
SELECT COUNT(*) FROM table_203_257 WHERE "result" = 'w'
squall
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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...
5862783这个医疗机构从零五年八月四日到一零年十一月六日有过多少在转诊门诊的就诊记录
SELECT COUNT(*) FROM txmzjzjlb WHERE txmzjzjlb.YLJGDM = '5862783' AND txmzjzjlb.JZKSRQ BETWEEN '2005-08-04' AND '2010-11-06' AND txmzjzjlb.ZZBZ > 0 UNION SELECT COUNT(*) FROM ftxmzjzjlb WHERE ftxmzjzjlb.YLJGDM = '5862783' AND ftxmzjzjlb.JZKSRQ BETWEEN '2005-08-04' AND '2010-11-06' AND ftxmzjzjlb.ZZBZ > 0
css
CREATE TABLE table_name_95 ( date_of_official_foundation_of_municipality VARCHAR )
What is the total number in 2006, which has an official foundation of municipality of 1918?
SELECT COUNT(2006) FROM table_name_95 WHERE date_of_official_foundation_of_municipality = 1918
sql_create_context
CREATE TABLE table_46910 ( "Original NER class" text, "1914 NER class" text, "LNER Class" text, "Cylinders" text, "Driving wheels" text )
What is the 1914 NER class with a d17/2 LNER class?
SELECT "1914 NER class" FROM table_46910 WHERE "LNER Class" = 'd17/2'
wikisql
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_tests int, heavy_papers int, cares_for_students int, heavy_assignments ...
What are the classes that Dr. Jonathan Marwil taught in the past ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor WHERE course_offering.semester < (SELECT SEMESTERalias0.semester_id FROM semester AS SEMESTERalias0 WHERE SEMESTERalias0.semester = 'WN' AND SEMESTERalias0.year = 2016) AND course.course_id = cour...
advising
CREATE TABLE table_250230_2 ( power VARCHAR, model VARCHAR )
What is the power of the Type R?
SELECT power FROM table_250230_2 WHERE model = "Type R"
sql_create_context
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 ...
列出患者孔古兰出院科室名称包含病的住院就诊在医院3510402中有什么记录?
SELECT * FROM person_info JOIN hz_info JOIN zyjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_i...
css
CREATE TABLE table_17020 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (millions)" text )
Which episode was directed by steven depaul
SELECT "Title" FROM table_17020 WHERE "Directed by" = 'Steven DePaul'
wikisql
CREATE TABLE table_6030 ( "Year" real, "Group" text, "Award" text, "Film/Series" text, "Result" text )
For which group was Kim nominated in 2010 for Best International Actress?
SELECT "Group" FROM table_6030 WHERE "Year" = '2010' AND "Award" = 'best international actress'
wikisql
CREATE TABLE table_name_42 ( date VARCHAR, away_team VARCHAR )
What date was Newcastle United the away team?
SELECT date FROM table_name_42 WHERE away_team = "newcastle united"
sql_create_context
CREATE TABLE table_204_123 ( id number, "week" number, "date" text, "kickoff" text, "opponent" text, "results\nfinal score" text, "results\nteam record" text, "game site" text, "attendance" number )
they won the game against the dragons on june 8 . what was the previous team they beat before that ?
SELECT "opponent" FROM table_204_123 WHERE "date" < (SELECT "date" FROM table_204_123 WHERE "date" = 'saturday, june 8') AND "results\nfinal score" = 'w' ORDER BY "date" DESC LIMIT 1
squall
CREATE TABLE table_31139 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real )
Who directed 'I am Dick Pentameter!'?
SELECT "Directed by" FROM table_31139 WHERE "Title" = 'I Am Dick Pentameter!'
wikisql
CREATE TABLE table_56591 ( "Season" text, "Winner" text, "Score" text, "Runner-up" text, "Venue" text, "Attendance" text )
How many were in attendance when the score was 4 4 ?
SELECT "Attendance" FROM table_56591 WHERE "Score" = '† 4–4 †'
wikisql
CREATE TABLE table_59566 ( "Opposing Teams" text, "Against" real, "Date" text, "Venue" text, "Status" text )
When has a Status of five nations, and a Against of 7?
SELECT "Date" FROM table_59566 WHERE "Status" = 'five nations' AND "Against" = '7'
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...
For patient Charley Pescatore, specify the admission type and duration of stay in the hospital
SELECT demographic.admission_type, demographic.days_stay FROM demographic WHERE demographic.name = "Charley Pescatore"
mimicsql_data