context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_51523 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What did Geelong score as the away team?
SELECT "Away team score" FROM table_51523 WHERE "Away team" = 'geelong'
wikisql
CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE paperfield ( fieldid int, paperid int...
datasets for KNN
SELECT DISTINCT dataset.datasetid FROM dataset, keyphrase, paperdataset, paperkeyphrase WHERE keyphrase.keyphrasename = 'KNN' AND paperdataset.datasetid = dataset.datasetid AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paperkeyphrase.paperid = paperdataset.paperid
scholar
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, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( ...
what is admission location of subject name michael witt?
SELECT demographic.admission_location FROM demographic WHERE demographic.name = "Michael Witt"
mimicsql_data
CREATE TABLE table_23414 ( "No. overall" text, "No. in series" real, "Family/families" text, "Location(s)" text, "Original air date" text )
Name the air date for uk17
SELECT "Original air date" FROM table_23414 WHERE "No. overall" = 'UK17'
wikisql
CREATE TABLE table_name_36 ( away_team VARCHAR, home_team VARCHAR )
Name the away team score for home team of university
SELECT away_team AS score FROM table_name_36 WHERE home_team = "university"
sql_create_context
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number,...
how many times does patient 006-245995 come in to the icu in 2104?
SELECT COUNT(DISTINCT patient.patientunitstayid) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-245995') AND STRFTIME('%y', patient.unitadmittime) = '2104'
eicu
CREATE TABLE table_name_82 ( tyre VARCHAR, fastest_lap VARCHAR, circuit VARCHAR )
What is the tyre for the circuit of Prince George, which had Jim Clark as the fastest lap?
SELECT tyre FROM table_name_82 WHERE fastest_lap = "jim clark" AND circuit = "prince george"
sql_create_context
CREATE TABLE device ( Device_ID int, Device text, Carrier text, Package_Version text, Applications text, Software_Platform text ) CREATE TABLE stock ( Shop_ID int, Device_ID int, Quantity int ) CREATE TABLE shop ( Shop_ID int, Shop_Name text, Location text, Open_Dat...
what are the different software platforms for devices, and how many devices have each?
SELECT Software_Platform, COUNT(*) FROM device GROUP BY Software_Platform
nvbench
CREATE TABLE table_4372 ( "Character" text, "1954 Broadway" text, "1955 broadcast" text, "1960 broadcast" text, "1979 Broadway" text, "1990 Broadway" text, "1991 Broadway" text, "1998 Broadway" text, "1999 Broadway" text )
Tell me the 1998 Broadway with barry cavanagh
SELECT "1998 Broadway" FROM table_4372 WHERE "1999 Broadway" = 'barry cavanagh'
wikisql
CREATE TABLE table_203_633 ( id number, "title" text, "year" number, "platform" text, "developer" text, "publisher" text )
what is the total number of games in the swat series ?
SELECT COUNT("title") FROM table_203_633
squall
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
what is the number of patients categorized under chemistry lab test who had open reduction of femur fracture with internal fixation?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "Open reduction of fracture with internal fixation, femur" AND lab."CATEGORY" = "Chemistry"
mimicsql_data
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospita...
how much does patient 006-216991 pay for their hospital stay until 4 years ago?
SELECT SUM(cost.cost) FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-216991') AND DATETIME(cost.chargetime) <= DATETIME(CURRENT_TIME(), '-4 year')
eicu
CREATE TABLE table_name_17 ( capacity__mw_ VARCHAR, notes VARCHAR )
What is the total capacity (MW) of the farm that is noted as being under construction?
SELECT COUNT(capacity__mw_) FROM table_name_17 WHERE notes = "under construction"
sql_create_context
CREATE TABLE table_19905 ( "Series Ep." text, "Episode" real, "Netflix" text, "Segment A" text, "Segment B" text, "Segment C" text, "Segment D" text )
What is Segment A where Segment C is Sushi (part 1)?
SELECT "Segment A" FROM table_19905 WHERE "Segment C" = 'Sushi (Part 1)'
wikisql
CREATE TABLE table_20143 ( "Ecozone" text, "Area (km\u00b2)" real, "Percentage of total area" text, "Percentage of land area" text, "Percentage protected" text )
What is the percentage of total area in the ecozone that the area is 1782252 km2?
SELECT "Percentage of total area" FROM table_20143 WHERE "Area (km\u00b2)" = '1782252'
wikisql
CREATE TABLE Customers ( customer_id INTEGER, customer_address_id INTEGER, customer_status_code VARCHAR(15), date_became_customer DATETIME, date_of_birth DATETIME, first_name VARCHAR(80), last_name VARCHAR(80), amount_outstanding DOUBLE, email_address VARCHAR(250), phone_number V...
For each payment method, how many payments were made Show bar chart, could you display in descending by the bar?
SELECT payment_method_code, COUNT(*) FROM Customer_Payments GROUP BY payment_method_code ORDER BY payment_method_code DESC
nvbench
CREATE TABLE table_10088101_1 ( original_air_date VARCHAR, production_code VARCHAR )
The episode with production code 9abx02 was originally aired on what date?
SELECT original_air_date FROM table_10088101_1 WHERE production_code = "9ABX02"
sql_create_context
CREATE TABLE table_name_79 ( home_team VARCHAR, crowd INTEGER )
What was the home team's score at the game that had a crowd larger than 24,000?
SELECT home_team AS score FROM table_name_79 WHERE crowd > 24 OFFSET 000
sql_create_context
CREATE TABLE table_30535 ( "Season" text, "Sport" text, "Tournament Structure" text, "# of Divisions" real, "1st Tournament" real, "2012-2013 State Tournament Location" text )
How many divisions in bowling ?
SELECT "# of Divisions" FROM table_30535 WHERE "Sport" = 'Bowling'
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 ...
how many of the patients admitted on transfer from hosp/extram had icd9 code 99591?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND diagnoses.icd9_code = "99591"
mimicsql_data
CREATE TABLE table_203_420 ( id number, "#" number, "stadium" text, "capacity" number, "city" text, "home team" text )
how many total people can fit in windsor park ?
SELECT "capacity" FROM table_203_420 WHERE "stadium" = 'windsor park'
squall
CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREA...
give me the one way flights from PITTSBURGH to BOSTON
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, fare, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND fare.round_trip_required = 'NO' AND flight_fare.fare_id = ...
atis
CREATE TABLE table_67229 ( "Outcome" text, "Date" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text )
Name the date for zi yan jie zheng opponent
SELECT "Date" FROM table_67229 WHERE "Opponents" = 'zi yan jie zheng'
wikisql
CREATE TABLE table_name_13 ( to_par VARCHAR, score VARCHAR )
How many strokes to par when the score is 1 up?
SELECT to_par FROM table_name_13 WHERE score = "1 up"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
what is the number of patients whose year of death is less than or equal to 2155 and procedure icd9 code is 45?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2155.0" AND procedures.icd9_code = "45"
mimicsql_data
CREATE TABLE table_51836 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Attendance" real, "Record" text )
How many attended the game on 12/17 with stephen jackson as the leading scorer?
SELECT SUM("Attendance") FROM table_51836 WHERE "Leading scorer" = 'stephen jackson' AND "Date" = '12/17'
wikisql
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
患者41170186435在门诊就诊期间的身高、体重、体温、收缩压、心率、舒张压、呼吸频率、脉率都是什么数据?
SELECT txmzjzjlb.SG, txmzjzjlb.TZ, txmzjzjlb.TW, txmzjzjlb.SSY, txmzjzjlb.SZY, txmzjzjlb.XL, txmzjzjlb.HXPLC, txmzjzjlb.ML FROM txmzjzjlb WHERE txmzjzjlb.JZLSH = '41170186435' UNION SELECT ftxmzjzjlb.SG, ftxmzjzjlb.TZ, ftxmzjzjlb.TW, ftxmzjzjlb.SSY, ftxmzjzjlb.SZY, ftxmzjzjlb.XL, ftxmzjzjlb.HXPLC, ftxmzjzjlb.ML FROM ft...
css
CREATE TABLE table_53403 ( "Date" text, "Venue" text, "Result" text, "Goals" real, "Competition" text )
Which Goals have a Date of 7 february 2010?
SELECT MAX("Goals") FROM table_53403 WHERE "Date" = '7 february 2010'
wikisql
CREATE TABLE table_62509 ( "Date" text, "Venue" text, "Opponent" text, "Score" text, "Result" text )
For the match against Arema Malang that ended in a draw, what was the final score?
SELECT "Score" FROM table_62509 WHERE "Result" = 'draw' AND "Opponent" = 'arema malang'
wikisql
CREATE TABLE Student ( StuID VARCHAR, age INTEGER ) CREATE TABLE Participates_in ( StuID VARCHAR, age INTEGER )
Show the ids for all the students who participate in an activity and are under 20.
SELECT StuID FROM Participates_in INTERSECT SELECT StuID FROM Student WHERE age < 20
sql_create_context
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
2594151这个医院涉及医疗费总额不少于4929.26元的科室有多少?时间范围是2004-10-21到2007-11-27
SELECT COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '2594151' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2004-10-21' AND '2007-11-27' GROUP BY t_kc21.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) >= 4929.26) AS T
css
CREATE TABLE table_72267 ( "State" text, "Preliminaries" text, "Interview" text, "Swimsuit" text, "Evening Gown" text, "Average" text )
what's the evening gown where state is south dakota
SELECT "Evening Gown" FROM table_72267 WHERE "State" = 'South Dakota'
wikisql
CREATE TABLE table_18877 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Who scored the most points in the game where the Raptors became 13-49?
SELECT "High points" FROM table_18877 WHERE "Record" = '13-49'
wikisql
CREATE TABLE table_66477 ( "City of license" text, "Identifier" text, "Frequency" text, "Power" text, "Class" text, "RECNet" text )
What identifier has 100000 watts as the power?
SELECT "Identifier" FROM table_66477 WHERE "Power" = '100000 watts'
wikisql
CREATE TABLE table_59989 ( "Speed" text, "Craft" text, "Pilot" text, "Location" text, "Date" text )
What is the Craft used at Coniston Water?
SELECT "Craft" FROM table_59989 WHERE "Location" = 'coniston water'
wikisql
CREATE TABLE table_77964 ( "Rank" real, "Rmax Rpeak ( Pflops )" text, "Name" text, "Vendor" text, "Operating system" text )
What is the name of Rank 5?
SELECT "Name" FROM table_77964 WHERE "Rank" = '5'
wikisql
CREATE TABLE table_203_634 ( id number, "date" text, "venue" text, "score" text, "victor" text, "comments" text, "match reports" text )
were there any rugby union matches between new zealand and wales in which new zealand scored no points ?
SELECT (SELECT COUNT(*) FROM table_203_634 WHERE "score" = 0) > 0
squall
CREATE TABLE table_name_8 ( league VARCHAR, play_offs VARCHAR, name VARCHAR )
What's the total number of League Cup with a Play-off larger than 2, and a Name of Mitch Cook Category:Articles with hCards?
SELECT COUNT(league) AS Cup FROM table_name_8 WHERE play_offs > 2 AND name = "mitch cook category:articles with hcards"
sql_create_context
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...
医院7149327就诊的所有的记录里依科室不同的编码和入院诊断的不同编码算一算大病支付的支出和总的医疗花费相比,比值的最小值
SELECT qtb.MED_ORG_DEPT_CD, qtb.IN_DIAG_DIS_CD, MIN(t_kc24.ILL_PAY) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '7149327' GROUP BY qtb.MED_ORG_DEPT_CD, qtb.IN_DIAG_DIS_CD UNION SELECT gyb.MED_ORG_DEPT_CD, gyb.IN_DIAG_DIS_CD, MIN(t_kc24.ILL_PAY) FROM gyb JOIN t_kc24 ON gyb...
css
CREATE TABLE table_62245 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
What is Tie no, when Date is '18 Nov 1989', and when Home Team is 'Doncaster Rovers'?
SELECT "Tie no" FROM table_62245 WHERE "Date" = '18 nov 1989' AND "Home team" = 'doncaster rovers'
wikisql
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE p...
After 17:00 P.M. , what section is offered of HISTART 517 ?
SELECT DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.start_time > '17:00' AND course.course_id = course_offering.course_id AND course.department = 'HISTART' AND course.number = 517 AND semester.semester = 'WN' A...
advising
CREATE TABLE table_127511_1 ( pacbio VARCHAR )
What is 454 gs flx when pacbio is 100-500 mb?
SELECT 454 AS _gs_flx FROM table_127511_1 WHERE pacbio = "100-500 Mb"
sql_create_context
CREATE TABLE table_73173 ( "Conventional" text, "Sarikoli (in IPA )" text, "Uyghur ( K\u0322ona Yezik\u0322 )" text, "Uyghur ( Yen\u0261i Yezik\u0322 )" text, "Chinese" text, "Pinyin" text )
Name the uyghur for
SELECT "Uyghur ( K\u0322ona Yezik\u0322 )" FROM table_73173 WHERE "Chinese" = '瓦恰'
wikisql
CREATE TABLE table_name_47 ( game VARCHAR, road_team VARCHAR, result VARCHAR )
What is Game, when Road Team is 'Syracuse', and when Result is '96-89'?
SELECT game FROM table_name_47 WHERE road_team = "syracuse" AND result = "96-89"
sql_create_context
CREATE TABLE table_48065 ( "Name" text, "Country" text, "Type" text, "Moving from" text, "Transfer window" text, "Ends" text, "Transfer fee" text )
What type of move was Elding from ENG?
SELECT "Type" FROM table_48065 WHERE "Country" = 'eng' AND "Name" = 'elding'
wikisql
CREATE TABLE table_46604 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" text, "Location" text )
In which location did the Meca World Vale Tudo 6 event happen?
SELECT "Location" FROM table_46604 WHERE "Event" = 'meca world vale tudo 6'
wikisql
CREATE TABLE table_22098274_1 ( rank_number VARCHAR, winning_pitcher VARCHAR )
What is the rank # of kelli miller the winning pitcher?
SELECT rank_number FROM table_22098274_1 WHERE winning_pitcher = "Kelli Miller"
sql_create_context
CREATE TABLE table_12094609_1 ( evening_gown VARCHAR, state VARCHAR )
what's the evening gown where state is south dakota
SELECT evening_gown FROM table_12094609_1 WHERE state = "South Dakota"
sql_create_context
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, ...
on 11 23 what flights are available between BOSTON and DENVER on AA
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 ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND date_day.day_number = 23 AND date_day.month_number = 11 AND ...
atis
CREATE TABLE table_203_455 ( id number, "round" number, "#" number, "player" text, "nationality" text, "college/junior/club team (league)" text )
which nationality has the least players ?
SELECT "nationality" FROM table_203_455 GROUP BY "nationality" ORDER BY COUNT("player") LIMIT 1
squall
CREATE TABLE table_name_17 ( year INTEGER, film VARCHAR )
Which year did The Adventures of Tintin come out?
SELECT SUM(year) FROM table_name_17 WHERE film = "the adventures of tintin"
sql_create_context
CREATE TABLE table_name_70 ( career_sr VARCHAR )
With a 1986 of NH and a career SR of 0 / 5 what is the results in 1985?
SELECT 1985 FROM table_name_70 WHERE career_sr = "0 / 5" AND 1986 = "nh"
sql_create_context
CREATE TABLE table_16388439_2 ( away_team VARCHAR, crowd VARCHAR )
When the crowd was 8642 what was the away team's score?
SELECT away_team AS score FROM table_16388439_2 WHERE crowd = 8642
sql_create_context
CREATE TABLE table_46751 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text )
What is Mike Smith's To par?
SELECT "To par" FROM table_46751 WHERE "Player" = 'mike smith'
wikisql
CREATE TABLE table_42011 ( "Name" text, "Date of Birth" text, "Height" real, "Weight" real, "Spike" real, "Block" real )
Weighing less than 85, with less than 340 Spikes, what is Gilberto Godoy Filho's Height
SELECT COUNT("Height") FROM table_42011 WHERE "Spike" < '340' AND "Name" = 'gilberto godoy filho' AND "Weight" < '85'
wikisql
CREATE TABLE table_38817 ( "Game" text, "Date" text, "Result" text, "Site" text, "Series" text )
Name the series for game 5
SELECT "Series" FROM table_38817 WHERE "Game" = 'game 5'
wikisql
CREATE TABLE table_name_3 ( total INTEGER, fa_cup INTEGER )
What is the sum of totals for FA Cup values of 0?
SELECT SUM(total) FROM table_name_3 WHERE fa_cup < 0
sql_create_context
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
在两千零四年一月十八日至两千一八年九月十四日期间医院9763546的科室8589涉及的医疗费总额有多少?
SELECT SUM(MED_AMOUT) FROM t_kc24 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE MED_SER_ORG_NO = '9763546' AND MED_ORG_DEPT_CD = '8589') AND CLINIC_SLT_DATE BETWEEN '2004-01-18' AND '2018-09-14'
css
CREATE TABLE table_3357 ( "Total" real, "#" real, "Title" text, "Directed by" text, "Written by" text, "Canadian air date" text, "UK air date" text, "Canadian Viewers (millions)" text )
What is the episode title for episode number 12?
SELECT "Title" FROM table_3357 WHERE "#" = '12'
wikisql
CREATE TABLE table_name_3 ( Id VARCHAR )
What 2009 has a 0 in 2008 & 2010?
SELECT 2009 FROM table_name_3 WHERE 2010 = "0" AND 2008 = "0"
sql_create_context
CREATE TABLE table_name_51 ( score__l__ VARCHAR, _score_in_legs VARCHAR, __s__ VARCHAR, _score_in_sets VARCHAR, year INTEGER )
Tell me the score for score in legs and year less than 2012
SELECT score__l__ = _score_in_legs, __s__ = _score_in_sets FROM table_name_51 WHERE year < 2012
sql_create_context
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number,...
sao2 for patient 030-53717 second measured on the last intensive care unit visit is less than the value first measured on the last intensive care unit visit?
SELECT (SELECT vitalperiodic.sao2 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-53717') AND NOT patient.unitdischargetime IS NULL ...
eicu
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...
Return a bar chart about the distribution of ACC_Road and School_ID , and group by attribute All_Home, order by the Y from high to low.
SELECT ACC_Road, School_ID FROM basketball_match GROUP BY All_Home, ACC_Road ORDER BY School_ID DESC
nvbench
CREATE TABLE table_5668 ( "Draw" real, "Artist" text, "Song" text, "Jury" real, "Televoting" real, "Points" real, "Place" real )
Televoting smaller than 2 had what highest draw?
SELECT MAX("Draw") FROM table_5668 WHERE "Televoting" < '2'
wikisql
CREATE TABLE table_56577 ( "Particle" text, "Symbol" text, "Makeup" text, "Rest mass MeV / c 2" text, "Isospin I" text, "Spin ( Parity ) J P" text, "Commonly decays to" text )
Which Particle has a Rest mass MeV/c 2 of 1383.7 1.0?
SELECT "Particle" FROM table_56577 WHERE "Rest mass MeV / c 2" = '1383.7±1.0'
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
count the number of patients whose diagnoses long title is human immunodeficiency virus [hiv] disease and drug route is nu?
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 = "Human immunodeficiency virus [HIV] disease" AND prescriptions.route = "NU"
mimicsql_data
CREATE TABLE table_21231 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What is the score of game 46
SELECT "Score" FROM table_21231 WHERE "Game" = '46'
wikisql
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 ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE...
For those employees who was hired before 2002-06-21, a bar chart shows the distribution of job_id and the average of employee_id , and group by attribute job_id, and rank by the X in asc.
SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID
nvbench
CREATE TABLE status ( id VARCHAR, station_id VARCHAR, city VARCHAR, bikes_available INTEGER ) CREATE TABLE station ( id VARCHAR, station_id VARCHAR, city VARCHAR, bikes_available INTEGER )
What are the ids of stations that are located in San Francisco and have average bike availability above 10.
SELECT id FROM station WHERE city = "San Francisco" INTERSECT SELECT station_id FROM status GROUP BY station_id HAVING AVG(bikes_available) > 10
sql_create_context
CREATE TABLE table_60438 ( "Symbol" text, "Prefix" text, "SI Meaning" text, "Binary meaning" text, "Size difference" text )
What is the size difference for the binary meaning of 2 70 = 1024 7?
SELECT "Size difference" FROM table_60438 WHERE "Binary meaning" = '2 70 = 1024 7'
wikisql
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE Tags ( Id number, TagName text, Cou...
newest user who has hit 10000 reputation.
SELECT Id, DisplayName FROM Users WHERE Reputation >= 10000 ORDER BY CreationDate DESC LIMIT 1
sede
CREATE TABLE table_name_8 ( country VARCHAR, player VARCHAR )
What is Country, when Player is 'Dutch Harrison'?
SELECT country FROM table_name_8 WHERE player = "dutch harrison"
sql_create_context
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propul...
what flights leaving PITTSBURGH arrive in DENVER and leave after say 1800 o'clock at night
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 = 'DENVER' AND flight.departure_time > 1800 AND flight.to_airport = AIRPORT_SERVICE_1.airpor...
atis
CREATE TABLE Accounts ( account_name VARCHAR, account_id VARCHAR ) CREATE TABLE Financial_transactions ( account_id VARCHAR )
Show the account id and name with at least 4 transactions.
SELECT T1.account_id, T2.account_name FROM Financial_transactions AS T1 JOIN Accounts AS T2 ON T1.account_id = T2.account_id GROUP BY T1.account_id HAVING COUNT(*) >= 4
sql_create_context
CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_season int, Title text, Directed_by text, Original_air_date text, Production_code text ) CREATE TABLE schedule ( Cinema_ID int, Film_ID int, Date text, Show_times_per_day int, Price float ) CREATE TABLE cine...
Show me the average of capacity by openning year in a histogram, and I want to rank bar from low to high order.
SELECT Openning_year, AVG(Capacity) FROM cinema GROUP BY Openning_year ORDER BY Openning_year
nvbench
CREATE TABLE table_11970261_2 ( preliminaries VARCHAR, average VARCHAR )
what's the preliminaries with average being 9.135
SELECT preliminaries FROM table_11970261_2 WHERE average = "9.135"
sql_create_context
CREATE TABLE table_13528 ( "Frequency" text, "Call sign" text, "Branding" text, "Format" text, "Owner" text, "Language/Rebroadcast" text )
who is the owner of fm 94.5?
SELECT "Owner" FROM table_13528 WHERE "Frequency" = 'fm 94.5'
wikisql
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_...
how much has patient 739 changed in the arterial bp [diastolic] second measured on the current intensive care unit visit compared to the first value measured on the current intensive care unit visit?
SELECT (SELECT chartevents.valuenum 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 = 739) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_ite...
mimic_iii
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE countries ( COUNTRY_ID...
For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the correlation between commission_pct and manager_id in a scatter chart.
SELECT COMMISSION_PCT, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flig...
what kind of aircraft does DL use before 800 on 8 2 from BOSTON to DENVER
SELECT DISTINCT aircraft.aircraft_code FROM aircraft, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, equipment_sequence, flight WHERE (((date_day.day_number = 2 AND date_day.month_number = 8 AND date_day.year = 1991 AND days.day_name = date_da...
atis
CREATE TABLE salary ( player_id VARCHAR, team_id VARCHAR, year VARCHAR ) CREATE TABLE player ( name_first VARCHAR, name_last VARCHAR, player_id VARCHAR ) CREATE TABLE team ( team_id_br VARCHAR, name VARCHAR )
List players' first name and last name who received salary from team Washington Nationals in both 2005 and 2007.
SELECT T2.name_first, T2.name_last FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id JOIN team AS T3 ON T3.team_id_br = T1.team_id WHERE T1.year = 2005 AND T3.name = 'Washington Nationals' INTERSECT SELECT T2.name_first, T2.name_last FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id JO...
sql_create_context
CREATE TABLE bdmzjzjlb ( 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...
58152656这个病人在2017年4月13日往后有哪些门诊就诊的检验报告单?查一下这些门诊就诊的流水号
SELECT wdmzjzjlb.JZLSH FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '58152656' AND NOT wdmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2017-04-13') UNION SELECT bdmzjzjlb.JZLSH FROM hz_info JOIN...
css
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...
韦俊贤这个病人在医院3431551中就诊记录中,共有多少在科室名称中不包含病理科的医疗就诊记录
SELECT * FROM qtb WHERE qtb.PERSON_NM = '韦俊贤' AND qtb.MED_SER_ORG_NO = '3431551' AND NOT qtb.MED_ORG_DEPT_NM LIKE '%病理科%' UNION SELECT * FROM gyb WHERE gyb.PERSON_NM = '韦俊贤' AND gyb.MED_SER_ORG_NO = '3431551' AND NOT gyb.MED_ORG_DEPT_NM LIKE '%病理科%' UNION SELECT * FROM zyb WHERE zyb.PERSON_NM = '韦俊贤' AND zyb.MED_SER_OR...
css
CREATE TABLE table_35895 ( "Order" real, "Episode" text, "Air Date" text, "U.S. Timeslot (EST)" text, "18-49" real, "Viewers" real )
What is the sum of numbers listed in 18-49 for the episode that aired on June 25, 2009 with an order larger than 29?
SELECT SUM("18-49") FROM table_35895 WHERE "Air Date" = 'june 25, 2009' AND "Order" > '29'
wikisql
CREATE TABLE table_2417340_3 ( vacator VARCHAR, date_of_successors_formal_installation VARCHAR )
List the number of vacators when successors were formally installed on June 22, 1868.
SELECT COUNT(vacator) FROM table_2417340_3 WHERE date_of_successors_formal_installation = "June 22, 1868"
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...
show me the number of elective hospital admission patients who have atorvastatin prescription.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND prescriptions.drug = "Atorvastatin"
mimicsql_data
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, d...
what is the percentile value of creatinine 0.3 among patients of the same age as patient 88401 on the first hospital visit?
SELECT DISTINCT t1.c1 FROM (SELECT labevents.valuenum, PERCENT_RANK() OVER (ORDER BY labevents.valuenum) AS c1 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'creatinine') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.ag...
mimic_iii
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE medication ( medicationid n...
how much weight has change of patient 013-28507 last measured on the current hospital visit compared to the first value measured on the current hospital visit?
SELECT (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-28507' AND patient.hospitaldischargetime IS NULL) AND NOT patient.admissionweight IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1) - (S...
eicu
CREATE TABLE table_name_55 ( winning_driver VARCHAR, name VARCHAR )
What Winning driver has a Name of mugello circuit?
SELECT winning_driver FROM table_name_55 WHERE name = "mugello circuit"
sql_create_context
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) 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...
Tell me the Summer or Spring courses that are offered which also meet the ULCS requirement .
SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id...
advising
CREATE TABLE table_38715 ( "Task No." real, "Date given" text, "Head of Household" text, "Hand Grenade User" text, "Hand Grenade Recipient" text )
What is the task number on January 22, 2010 (day 111)?
SELECT MAX("Task No.") FROM table_38715 WHERE "Date given" = 'january 22, 2010 (day 111)'
wikisql
CREATE TABLE table_name_35 ( innings INTEGER, runs_scored VARCHAR, balls_faced VARCHAR, average VARCHAR, sr VARCHAR )
How many total innings have an average under 6.33, strike rate under 71.43, balls faced over 36, and smaller than 19 runs scored?
SELECT SUM(innings) FROM table_name_35 WHERE average < 6.33 AND sr < 71.43 AND balls_faced > 36 AND runs_scored < 19
sql_create_context
CREATE TABLE zyjzjlb_jybgb ( YLJGDM_ZYJZJLB text, BGDH number, YLJGDM number ) 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...
90835300患者被门诊诊断为急性精神分裂症样精神病性障碍,查看检测中三碘甲状腺原氨酸的结果定量及其单位
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW 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 = jy...
css
CREATE TABLE table_23856 ( "No. in series" real, "No. in season" real, "Title" text, "Directedby" text, "Writtenby" text, "Originalairdate" text, "Production code" text, "U.S.viewers (million)" text )
Who were the writers for 'Balm'?
SELECT "Writtenby" FROM table_23856 WHERE "Title" = 'Balm'
wikisql
CREATE TABLE station_company ( Station_ID int, Company_ID int, Rank_of_the_Year int ) CREATE TABLE gas_station ( Station_ID int, Open_Year int, Location text, Manager_Name text, Vice_Manager_Name text, Representative_Name text ) CREATE TABLE company ( Company_ID int, Rank i...
A bar chart about what are the main indstries and total market value for each industry?, rank in ascending by the names please.
SELECT Main_Industry, SUM(Market_Value) FROM company GROUP BY Main_Industry ORDER BY Main_Industry
nvbench
CREATE TABLE table_49226 ( "Class" text, "Part 1" text, "Part 2" text, "Part 3" text, "Part 4" text, "Verb meaning" text )
Which part one is class 7d?
SELECT "Part 1" FROM table_49226 WHERE "Class" = '7d'
wikisql
CREATE TABLE table_27932399_1 ( release_title VARCHAR, artist VARCHAR )
What was the name of the album released by Heavy Winged?
SELECT release_title FROM table_27932399_1 WHERE artist = "Heavy Winged"
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...
在张秀媛的患者的检查过程中有哪些检验报告单对应的检验结果指标是都不正常的?具体的检验报告单号是啥?
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 NOT ...
css
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartr...
this year, what were the four most frequent drugs prescribed within the same month to the patients with age 30s after they had been diagnosed with acute respiratory failure.
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'acute respiratory failure' AND DATETIME(diagnosis....
eicu
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
give me the number of married patients who have been diagnosed with unspecified constipation.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "MARRIED" AND diagnoses.short_title = "Constipation NOS"
mimicsql_data