context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_11 ( date VARCHAR, home_team VARCHAR )
When was millwall the home team?
SELECT date FROM table_name_11 WHERE home_team = "millwall"
sql_create_context
CREATE TABLE table_27389024_2 ( original_air_date VARCHAR, written_by VARCHAR )
What is the original air date of the episode that was written by Rama Stagner?
SELECT original_air_date FROM table_27389024_2 WHERE written_by = "Rama Stagner"
sql_create_context
CREATE TABLE table_203_254 ( id number, "position" number, "team" text, "points" number, "played" number, "won" number, "drawn" number, "lost" number, "for" number, "against" number, "difference" number )
which team had the fewest lost games ?
SELECT "team" FROM table_203_254 ORDER BY "lost" LIMIT 1
squall
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, departure_flight_number int, stop_time int ) CREATE TABLE flight_fare ...
does AA fly from ATLANTA to PHILADELPHIA
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, flight WHERE ((flight.airline_code = 'AA') AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' AND flight.to_airport = AIRPO...
atis
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
provide the number of patients whose age is less than 71 and lab test name is asparate aminotransferase (ast)?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "71" AND lab.label = "Asparate Aminotransferase (AST)"
mimicsql_data
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetake...
whats the first height of patient 027-140654 since 12/2105?
SELECT patient.admissionheight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-140654') AND NOT patient.admissionheight IS NULL AND STRFTIME('%y-%m', patient.unitadmittime) >= '2105-12' ORDER BY patient.unitadmittime LIMIT 1
eicu
CREATE TABLE Activity ( actid INTEGER, activity_name varchar(25) ) CREATE TABLE Faculty_Participates_in ( FacID INTEGER, actid INTEGER ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, ...
Show me a bar chart for how many faculty members does each building have? List the result with the name of the building, and order total number from low to high order.
SELECT Building, COUNT(*) FROM Faculty GROUP BY Building ORDER BY COUNT(*)
nvbench
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConce...
NewSQL database trends (# of Questions per Month).
SELECT DATEADD(mm, (YEAR(Posts.CreationDate) - 1900) * 12 + MONTH(Posts.CreationDate) - 1, 0) AS Month, Tags.TagName, COUNT(*) AS Questions FROM Tags LEFT JOIN PostTags ON PostTags.TagId = Tags.Id LEFT JOIN Posts ON Posts.Id = PostTags.PostId LEFT JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId WHERE Tags.TagName IN ...
sede
CREATE TABLE Courses ( course_id INTEGER, author_id INTEGER, subject_id INTEGER, course_name VARCHAR(120), course_description VARCHAR(255) ) CREATE TABLE Students ( student_id INTEGER, date_of_registration DATETIME, date_of_latest_logon DATETIME, login_name VARCHAR(40), password...
Find the dates of the tests taken with result 'Pass', and count them by a bar chart, and show total number from high to low order.
SELECT date_test_taken, COUNT(date_test_taken) FROM Student_Tests_Taken WHERE test_result = "Pass" GROUP BY date_test_taken ORDER BY COUNT(date_test_taken) DESC
nvbench
CREATE TABLE table_32347 ( "Name" text, "Took office" text, "Left office" text, "Party" text, "Governor" text )
What is the party of the politician who left office on January 12, 1857
SELECT "Party" FROM table_32347 WHERE "Left office" = 'january 12, 1857'
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, ...
when was the first measurement of patient 035-17122's systemicdiastolic on the first icu visit?
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-17122') AND NOT patient.unitdischargetime IS NU...
eicu
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE ground_service ( ...
show flights FIRST class on AA from DALLAS FORT WORTH to SFO
SELECT DISTINCT flight.flight_id FROM airport, 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 ((airport.airport_code = 'SFO' AND fare_basis.class_type = 'FIRST' AND fare.fare_basis_code = fare_basis.fare_basis_code ...
atis
CREATE TABLE table_66023 ( "Peak" text, "Country" text, "Elevation (m)" real, "Prominence (m)" real, "Col (m)" real )
Which Col (m) has a Prominence (m) larger than 1,519, and a Peak of jiehkkev rri, and an Elevation (m) larger than 1,834?
SELECT MIN("Col (m)") FROM table_66023 WHERE "Prominence (m)" > '1,519' AND "Peak" = 'jiehkkevárri' AND "Elevation (m)" > '1,834'
wikisql
CREATE TABLE jobs ( job_id text, job_title text, min_salary number, max_salary number ) CREATE TABLE countries ( country_id text, country_name text, region_id number ) CREATE TABLE departments ( department_id number, department_name text, manager_id number, location_id numb...
What are the ids, full names, and salaries for employees making more than average and who work in a department with employees who have the letter J in their first name?
SELECT employee_id, first_name, last_name, salary FROM employees WHERE salary > (SELECT AVG(salary) FROM employees) AND department_id IN (SELECT department_id FROM employees WHERE first_name LIKE '%J%')
spider
CREATE TABLE table_name_34 ( unfavorable INTEGER, no_opinion VARCHAR, favorable VARCHAR, date VARCHAR )
What is the most unfavorable that is favorable of 34 during 1953 August and has a no opinion score larger than 24?
SELECT MAX(unfavorable) FROM table_name_34 WHERE favorable = 34 AND date = "1953 august" AND no_opinion > 24
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 demographic ...
what is admission type and discharge time of subject id 42820?
SELECT demographic.admission_type, demographic.dischtime FROM demographic WHERE demographic.subject_id = "42820"
mimicsql_data
CREATE TABLE party ( Party_ID int, Year real, Party text, Governor text, Lieutenant_Governor text, Comptroller text, Attorney_General text, US_Senate text ) CREATE TABLE election ( Election_ID int, Counties_Represented text, District int, Delegate text, Party int, ...
Return all the committees that have delegates from Democratic party, and count them by a bar chart
SELECT Committee, COUNT(Committee) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T2.Party = "Democratic" GROUP BY Committee
nvbench
CREATE TABLE table_name_98 ( iucn VARCHAR, est VARCHAR, reserve VARCHAR )
What is the IUCN for the Cockscomb Basin reserve when the Est. is less than 1998?
SELECT iucn FROM table_name_98 WHERE est < 1998 AND reserve = "cockscomb basin"
sql_create_context
CREATE TABLE table_24132083_1 ( no_in_series INTEGER, written_by VARCHAR )
What in the series number of the episode written by Lauren Gussis?
SELECT MIN(no_in_series) FROM table_24132083_1 WHERE written_by = "Lauren Gussis"
sql_create_context
CREATE TABLE table_16399 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text )
What schools did lenard semajuste play for?
SELECT "College" FROM table_16399 WHERE "Player" = 'Lenard Semajuste'
wikisql
CREATE TABLE table_name_66 ( tournament VARCHAR )
What tournament has q2 as the 2004?
SELECT tournament FROM table_name_66 WHERE 2004 = "q2"
sql_create_context
CREATE TABLE table_25639 ( "No." real, "Place & date" text, "Target" text, "Area damaged" text, "Cause of damage" text, "Intercepted by Patriot" text )
What number missile led to damage to the Islamic University campus?
SELECT MIN("No.") FROM table_25639 WHERE "Area damaged" = 'Islamic University campus'
wikisql
CREATE TABLE table_12550 ( "Position" real, "Played" real, "Points" real, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real )
What is the average Position, when Goal Difference is '17', and when Wins is greater than 13?
SELECT AVG("Position") FROM table_12550 WHERE "Goal Difference" = '17' AND "Wins" > '13'
wikisql
CREATE TABLE table_name_80 ( games INTEGER, points VARCHAR, lost VARCHAR )
What is the average number of games associated with 6 points and under 2 losses?
SELECT AVG(games) FROM table_name_80 WHERE points = 6 AND lost < 2
sql_create_context
CREATE TABLE table_27713030_12 ( date VARCHAR, team VARCHAR )
What was the date when Boston was the team?
SELECT date FROM table_27713030_12 WHERE team = "Boston"
sql_create_context
CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE writes ( paperid int, a...
How many papers were written on question answering in the past 5 years ?
SELECT DISTINCT COUNT(paper.paperid) FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'question answering' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year >= YEAR(CURDATE()) - 5
scholar
CREATE TABLE table_204_575 ( id number, "place" number, "position" text, "number" number, "name" text, "league one" number, "fa cup" number, "league cup" number, "football league trophy" number, "total" number )
who had the most number of total assists ?
SELECT "name" FROM table_204_575 ORDER BY "total" DESC LIMIT 1
squall
CREATE TABLE gyb ( 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...
请提供编号81459201这位团伙成员最喜欢开的药品排序
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '81459201' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.ME...
css
CREATE TABLE table_name_71 ( spouse VARCHAR, name VARCHAR )
Who was Margaret of Brabant's spouse?
SELECT spouse FROM table_name_71 WHERE name = "margaret of brabant"
sql_create_context
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 name by a bar chart.
SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name
nvbench
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, draw a bar chart about the distribution of name and the sum of code , and group by attribute name, and order by the Name in ascending.
SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name
nvbench
CREATE TABLE table_203_411 ( id number, "year" number, "venue" text, "individual" number, "sprint" number, "pursuit" number, "mass start" number, "relay" number )
which had the highest individual number ?
SELECT "venue" FROM table_203_411 ORDER BY "individual" DESC LIMIT 1
squall
CREATE TABLE Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER...
What is the last name of each student who is not allergic to any type of food? Count them with a bar chart, sort total number in asc order.
SELECT LName, COUNT(LName) FROM Student WHERE NOT StuID IN (SELECT T1.StuID FROM Has_Allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.AllergyType = "food") GROUP BY LName ORDER BY COUNT(LName)
nvbench
CREATE TABLE table_train_56 ( "id" int, "organ_transplantation" bool, "severe_sepsis" bool, "immune_suppression" bool, "autoimmune_disease" bool, "hematopoietic" bool, "chronic_infectious" bool, "steroid_therapy" bool, "sepsis" bool, "systemic_inflammatory_response" bool, "or...
patients with any type of chronic infectious, inflammatory or autoimmune diseases
SELECT * FROM table_train_56 WHERE chronic_infectious = 1 OR systemic_inflammatory_response = 1 OR autoimmune_disease = 1
criteria2sql
CREATE TABLE table_61519 ( "Score" text, "Pos." real, "Inn." real, "Venue" text, "H/A/N" text )
Which venue has a neutral H/A/N, lower than position 3 and a score of 141?
SELECT "Venue" FROM table_61519 WHERE "H/A/N" = 'neutral' AND "Pos." < '3' AND "Score" = '141'
wikisql
CREATE TABLE table_name_25 ( profits__billion_ INTEGER, rank VARCHAR )
What is the lowest profits (billion $) for the rank 6?
SELECT MIN(profits__billion_) AS $_ FROM table_name_25 WHERE rank = 6
sql_create_context
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE PendingFlags ( Id number, F...
Time to first answer in specified period.
WITH p AS (SELECT q.Id, q.CreationDate AS qDate, MIN(a.CreationDate) AS aDate FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id WHERE q.CreationDate BETWEEN '##fromDate:string##' AND '##tillDate:string##' AND a.CreationDate >= q.CreationDate GROUP BY q.Id, q.CreationDate) SELECT CAST((JULIANDAY(aDate) - JULIAN...
sede
CREATE TABLE table_name_70 ( score VARCHAR, tournament VARCHAR )
What was the Score of the Spain F32, Gran Canaria Tournament?
SELECT score FROM table_name_70 WHERE tournament = "spain f32, gran canaria"
sql_create_context
CREATE TABLE table_23793770_1 ( production_code INTEGER, directed_by VARCHAR )
What was the production code for the episode directed by Michael Morris?
SELECT MIN(production_code) FROM table_23793770_1 WHERE directed_by = "Michael Morris"
sql_create_context
CREATE TABLE table_203_277 ( id number, "entered" number, "wrestler" text, "place" text, "eliminated by" text, "time" text )
how many lasted less than 5 minutes ?
SELECT COUNT(*) FROM table_203_277 WHERE "time" < 5
squall
CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city v...
What would be timeframe wherein they have offered AUTO 590 ?
SELECT DISTINCT semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'AUTO' AND course.number = 590 AND semester.semester_id = course_offering.semester ORDER BY semester.year LIMIT 1
advising
CREATE TABLE table_74811 ( "Rank" real, "Mountain Pass" text, "Elevation" text, "Surface" text, "Route" real )
What is the Surface of the Route less than 7?
SELECT "Surface" FROM table_74811 WHERE "Route" < '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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
what is the number of patients whose death status is 1 and drug name is pneumococcal vac polyvalent?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.expire_flag = "1" AND prescriptions.drug = "PNEUMOcoccal Vac Polyvalent"
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 prescriptions...
what is minimum age of patients whose admission type is emergency and admission year is greater than or equal to 2175?
SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.admityear >= "2175"
mimicsql_data
CREATE TABLE table_30777 ( "No." real, "Name" text, "Country" text, "Original channel" text, "No. of episodes" real, "Running time" text, "Launched" text, "Date" text, "IRST" text )
What is the original channel of the show with 88 episodes?
SELECT "Original channel" FROM table_30777 WHERE "No. of episodes" = '88'
wikisql
CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH text, MZJZLSH text, KH text, KLX number, HZXM text, WDBZ number, RYDJSJ time, RYTJDM number, RYTJMC text, JZKSDM text, JZKSMC text, RZBQDM text, RZBQMC text, RYCWH text, CYKSDM text, CYKSMC text, CYBQDM tex...
患者03485032的检验报告单中有多少检验结果指标均异常?查询检验报告的单号
(SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '03485032' AND NOT jybgb.BGDH IN (SELECT BGDH FROM jyjgzbb WHERE JCZ...
css
CREATE TABLE table_65147 ( "School" text, "Location" text, "Mascot" text, "Enrollment" real, "IHSAA Class" text, "County" text )
Which Mascot has IHSAA Class of aa, and a Enrollment larger than 369?
SELECT "Mascot" FROM table_65147 WHERE "IHSAA Class" = 'aa' AND "Enrollment" > '369'
wikisql
CREATE TABLE table_15639 ( "Rank" real, "Team" text, "Country" text, "Value ($M)" real, "% change on year" real, "Revenue ($M)" real )
Which country has more than 5% change in a year with a rank of 10?
SELECT "Country" FROM table_15639 WHERE "% change on year" > '5' AND "Rank" = '10'
wikisql
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...
count the number of times patient 010-17950 has had the enteral tube feed in 09/2103.
SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-17950')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.ce...
eicu
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 whose insurance is private and procedure icd9 code is 8968?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.icd9_code = "8968"
mimicsql_data
CREATE TABLE table_26217 ( "Song 1 title" text, "Artist 1" text, "Song 2 title" text, "Artist 2" text, "Mix artist" text, "Guitar part?" text, "Level" text )
Which level has grandmaster flash as artist 1?
SELECT "Level" FROM table_26217 WHERE "Artist 1" = 'Grandmaster Flash'
wikisql
CREATE TABLE table_71619 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text )
What is the lowest Pick # of Saint Vincent College?
SELECT MIN("Pick #") FROM table_71619 WHERE "College" = 'saint vincent college'
wikisql
CREATE TABLE table_49448 ( "Round" real, "Pick" real, "Player" text, "Nationality" text, "School/Club Team" text )
What is the total pick with Bill Duffy?
SELECT SUM("Pick") FROM table_49448 WHERE "Player" = 'bill duffy'
wikisql
CREATE TABLE table_name_81 ( fielding_team VARCHAR, wicket VARCHAR )
Who fielded against the 8th wicket?
SELECT fielding_team FROM table_name_81 WHERE wicket = "8th"
sql_create_context
CREATE TABLE table_name_63 ( score VARCHAR, competition VARCHAR, date VARCHAR )
What was the score in the Continental Qualifier on February 23, 2003?
SELECT score FROM table_name_63 WHERE competition = "continental qualifier" AND date = "february 23, 2003"
sql_create_context
CREATE TABLE table_48955 ( "Date" text, "Venue" text, "Opponents" text, "Score" text, "Round" text, "Djurg\u00e5rden scorers" text, "Attendance" text )
What is the Date that has a Round of semifinal?
SELECT "Date" FROM table_48955 WHERE "Round" = 'semifinal'
wikisql
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_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) ...
in the first hospital visit patient 59941 has been diagnosed with aortocoronary bypass?
SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'aortocoronary bypass') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 59941 AND NOT admissions.dischti...
mimic_iii
CREATE TABLE table_66694 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the number of Gold medals for the Nation with a Total of 5 and Rank larger than 1?
SELECT MIN("Gold") FROM table_66694 WHERE "Total" = '5' AND "Rank" > '1'
wikisql
CREATE TABLE table_6642 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text )
What is the Losing bonus with an extra try bonus?
SELECT "Losing bonus" FROM table_6642 WHERE "Try bonus" = 'try bonus'
wikisql
CREATE TABLE table_name_57 ( away_team VARCHAR, tie_no VARCHAR )
What is the away team with a 4 tie no.?
SELECT away_team FROM table_name_57 WHERE tie_no = "4"
sql_create_context
CREATE TABLE table_62524 ( "Date" text, "Name" text, "Local Name" text, "2012 Date" text, "2013 Date" text )
What is the date with the local name, , dan dr avnosti srbije, and what is February 15, 2012?
SELECT "Date" FROM table_62524 WHERE "Local Name" = 'дан државности србије, dan državnosti srbije' AND "2012 Date" = 'february 15'
wikisql
CREATE TABLE table_name_89 ( draws INTEGER, goals_against VARCHAR, wins VARCHAR )
Name the most draws when goals against is more than 56 and wins is more than 14
SELECT MAX(draws) FROM table_name_89 WHERE goals_against > 56 AND wins > 14
sql_create_context
CREATE TABLE table_name_95 ( december INTEGER, july VARCHAR, february VARCHAR )
What is the sum for December that has 0.36 in July, and lager than 0.35000000000000003 in February?
SELECT SUM(december) FROM table_name_95 WHERE july = 0.36 AND february > 0.35000000000000003
sql_create_context
CREATE TABLE table_58344 ( "NGC number" real, "Object type" text, "Constellation" text, "Right ascension ( J2000 )" text, "Declination ( J2000 )" text )
Which NGC number has an Object type of open cluster, and a Right ascension (J2000) of 06h01m06s?
SELECT MAX("NGC number") FROM table_58344 WHERE "Object type" = 'open cluster' AND "Right ascension ( J2000 )" = '06h01m06s'
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
what is the number of patients whose days of hospital stay is greater than 7 and procedure short title is hemodialysis?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "7" AND procedures.short_title = "Hemodialysis"
mimicsql_data
CREATE TABLE table_23144 ( "County" text, "Starky #" real, "Starky %" text, "Hancock #" real, "Hancock %" text, "McCain #" real, "McCain %" text, "Total" real )
what is the least total in gila
SELECT MIN("Total") FROM table_23144 WHERE "County" = 'Gila'
wikisql
CREATE TABLE table_name_14 ( crowd VARCHAR, away_team VARCHAR )
Who watches North Melbourne when they are away?
SELECT crowd FROM table_name_14 WHERE away_team = "north melbourne"
sql_create_context
CREATE TABLE table_name_83 ( match_report VARCHAR, date VARCHAR )
Which Match Report has a Date of october 26, 2008?
SELECT match_report FROM table_name_83 WHERE date = "october 26, 2008"
sql_create_context
CREATE TABLE table_25971 ( "Rank" real, "Runs" real, "Player" text, "Matches" real, "Innings" real, "Not Out" real, "Average" text )
If the innings is 68, what is the average?
SELECT "Average" FROM table_25971 WHERE "Innings" = '68'
wikisql
CREATE TABLE table_77038 ( "Athlete" text, "Event" text, "100 m" real, "400 m" real, "110H" real, "1500 m" text, "Final" real )
What was the 400m that had a 110H greater than 14.21, a final of more than 7838, and having result in events?
SELECT COUNT("400 m") FROM table_77038 WHERE "Event" = 'result' AND "110H" > '14.21' AND "Final" > '7838'
wikisql
CREATE TABLE table_name_78 ( result VARCHAR, date VARCHAR )
What was the result of the match on December 9, 1962?
SELECT result FROM table_name_78 WHERE date = "december 9, 1962"
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE diagnosis ( diagnosisid number, ...
when did patient 013-9305 receive the cystoscopy for the last time in the previous year?
SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-9305')) AND treatment.treatmentname = 'cystoscopy' AND DATETI...
eicu
CREATE TABLE table_name_71 ( tournament VARCHAR, margin_of_victory VARCHAR, winning_score VARCHAR )
What Tournament had a Victory of 1 Stroke with a Winning score of 16 (67-66-70-69=272)?
SELECT tournament FROM table_name_71 WHERE margin_of_victory = "1 stroke" AND winning_score = –16(67 - 66 - 70 - 69 = 272)
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...
How many of the patients aged below 30 had other electric countershock of the heart?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "30" AND procedures.long_title = "Other electric countershock of heart"
mimicsql_data
CREATE TABLE table_203_185 ( id number, "season" text, "a\ntechnical" text, "b\nscientific" text, "c\nfine arts" text, "d\nimprovisational" text, "e\nstructural" text, "rising stars!\u00ae" text, "po\nprojectoutreach\u00ae" text, "university level" text )
which is the only year to feature a university level challenge ?
SELECT "season" FROM table_203_185 WHERE NOT "university level" IS NULL
squall
CREATE TABLE table_name_22 ( event VARCHAR, record VARCHAR )
What event has a Record of 4 2?
SELECT event FROM table_name_22 WHERE record = "4–2"
sql_create_context
CREATE TABLE shop ( shop_id number, shop_name text, location text, open_date text, open_year number ) CREATE TABLE device ( device_id number, device text, carrier text, package_version text, applications text, software_platform text ) CREATE TABLE stock ( shop_id number...
What are the carriers of devices that are in stock in more than a single shop?
SELECT T2.carrier FROM stock AS T1 JOIN device AS T2 ON T1.device_id = T2.device_id GROUP BY T1.device_id HAVING COUNT(*) > 1
spider
CREATE TABLE table_41911 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What is the average Week, when Result is l 37 34?
SELECT AVG("Week") FROM table_41911 WHERE "Result" = 'l 37–34'
wikisql
CREATE TABLE table_5349 ( "Year" real, "Men's singles" text, "Women's singles" text, "Men's doubles" text, "Women's doubles" text, "Mixed doubles" text )
Who won women's doubles in 1998?
SELECT "Women's doubles" FROM table_5349 WHERE "Year" = '1998'
wikisql
CREATE TABLE table_65398 ( "Tournament" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text )
What is the tournament when 2010 is not held?
SELECT "Tournament" FROM table_65398 WHERE "2010" = 'not held'
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 ...
tell me the birthdate of patient 61527?
SELECT patients.dob FROM patients WHERE patients.subject_id = 61527
mimic_iii
CREATE TABLE table_13464416_4 ( high_rebounds VARCHAR, team VARCHAR )
Who had the high rebound total against golden state?
SELECT high_rebounds FROM table_13464416_4 WHERE team = "Golden State"
sql_create_context
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, r...
i need a nonstop flight from SAN DIEGO to PHOENIX
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_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SAN DIEGO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHO...
atis
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost numbe...
count the number of patients who were prescribed morphine inj within the same hospital visit after receiving a influenza vaccine procedure since 2104.
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'influenza vaccine' AND STRFTIME('%y', treatment.treatmenttime) >= '2104')...
eicu
CREATE TABLE table_53643 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Where was the game played where the away team scored 12.15 (87)?
SELECT "Venue" FROM table_53643 WHERE "Away team score" = '12.15 (87)'
wikisql
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_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, ...
在医院6234584中,以出院诊断疾病名称为依据,查出不同疾病的患者平均年龄是多少
SELECT t_kc21.OUT_DIAG_DIS_NM, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '6234584' GROUP BY t_kc21.OUT_DIAG_DIS_NM
css
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
what are the five most frequent drugs prescribed to the patients with the age of 20s during the same hospital encounter after they were diagnosed with acute respiratory failure since 1 year ago?
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'acute respirato...
eicu
CREATE TABLE table_15106 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real )
What was the score of the game for April 16?
SELECT "Loss" FROM table_15106 WHERE "Date" = 'april 16'
wikisql
CREATE TABLE table_39075 ( "Denomination" text, "Metal" text, "Weight" text, "Shape" text, "Size" text )
What is the weight with the shape of scalloped, and that is a size of 20mm (across scallops)?
SELECT "Weight" FROM table_39075 WHERE "Shape" = 'scalloped' AND "Size" = '20mm (across scallops)'
wikisql
CREATE TABLE table_76904 ( "Class" text, "Wheel arrangement" text, "Fleet number(s)" text, "Year made" text, "Quantity made" text, "Quantity preserved" text )
What is the fleet number with a 4-6-0 wheel arrangement made in 1890?
SELECT "Fleet number(s)" FROM table_76904 WHERE "Wheel arrangement" = '4-6-0' AND "Year made" = '1890'
wikisql
CREATE TABLE table_60433 ( "Date" text, "Venue" text, "Score" text, "Competition" text, "Report" text )
What is the Venue of the Competition with a Score of 2 0?
SELECT "Venue" FROM table_60433 WHERE "Score" = '2–0'
wikisql
CREATE TABLE table_74656 ( "Party" text, "Seats" text, "Net gain/loss" text, "% of seats" text, "% of votes" text )
Which party has a net gain/loss of -2?
SELECT "Party" FROM table_74656 WHERE "Net gain/loss" = '-2'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) 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, ...
列出在2001-03-25到2020-05-29内患者马欣怿被开出的所有检验报告单的检验报告单号是什么?
(SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE person_info.XM = '马欣怿' AND jyb...
css
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
编号02885209981的医疗就诊中,稳心颗粒开出的医疗发票,项目类别这一栏填的是什么
SELECT MED_INV_ITEM_TYPE FROM t_kc22 WHERE MED_CLINIC_ID = '02885209981' AND SOC_SRT_DIRE_NM = '稳心颗粒'
css
CREATE TABLE table_24108 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Black Knights points" real, "Opponents" real, "Record" text )
Name the result for 19 black knights points
SELECT "Result" FROM table_24108 WHERE "Black Knights points" = '19'
wikisql
CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text,...
what flights go from PITTSBURGH to BALTIMORE after 800 o'clock next wednesday
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, date_day, days, flight WHERE ((date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time...
atis
CREATE TABLE table_name_77 ( result VARCHAR, location VARCHAR, week VARCHAR )
What was the result of the game at the Riverfront Stadium after week 8?
SELECT result FROM table_name_77 WHERE location = "riverfront stadium" AND week = "8"
sql_create_context
CREATE TABLE table_204_554 ( id number, "rank" number, "name" text, "nation" text, "time" text, "speed" number, "note" text )
who is the first finisher from russia ?
SELECT "name" FROM table_204_554 WHERE "nation" = 'russia' ORDER BY "rank" LIMIT 1
squall
CREATE TABLE table_39341 ( "Season" real, "Winner" text, "Score" text, "Runner-up" text, "Venue" text )
Which Seasonhas a Score of 3 3 aet , 4 3 pen?
SELECT MAX("Season") FROM table_39341 WHERE "Score" = '3 – 3 aet , 4–3 pen'
wikisql
CREATE TABLE table_name_81 ( home_team VARCHAR, crowd INTEGER )
What was the home team's score at the game attended by more than 24,637?
SELECT home_team AS score FROM table_name_81 WHERE crowd > 24 OFFSET 637
sql_create_context