instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_8 ( bronze INTEGER, nation VARCHAR, silver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the bronze for Kyrgyzstan nation with a silver record of greater than 0?
SELECT AVG(bronze) FROM table_name_8 WHERE nation = "kyrgyzstan" AND silver > 0
sql_create_context
CREATE TABLE affected_region ( region_name VARCHAR, region_id VARCHAR ) CREATE TABLE region ( region_name VARCHAR, region_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the name for regions not affected.
SELECT region_name FROM region WHERE NOT region_id IN (SELECT region_id FROM affected_region)
sql_create_context
CREATE TABLE table_name_87 ( result_f___a VARCHAR, league_position VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the Result F A that has a League position of 1st on 4 january 1994?
SELECT result_f___a FROM table_name_87 WHERE league_position = "1st" AND date = "4 january 1994"
sql_create_context
CREATE TABLE club ( clubid number, clubname text, clubdesc text, clublocation text ) CREATE TABLE member_of_club ( stuid number, clubid number, position text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advis...
SELECT COUNT(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = "Linda" AND t3.lname = "Smith"
spider
CREATE TABLE table_48212 ( "Winner" text, "Country" text, "Winter Olympics" real, "FIS Nordic World Ski Championships" text, "Holmenkollen" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the winter olympics when the country is soviet union a...
SELECT SUM("Winter Olympics") FROM table_48212 WHERE "Country" = 'soviet union' AND "Holmenkollen" = '1970, 1979'
wikisql
CREATE TABLE table_33217 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Whom is the away team when the Away team score i...
SELECT "Away team" FROM table_33217 WHERE "Away team score" = '23.14 (152)'
wikisql
CREATE TABLE workshop ( workshop_id number, date text, venue text, name text ) CREATE TABLE submission ( submission_id number, scores number, author text, college text ) CREATE TABLE acceptance ( submission_id number, workshop_id number, result text ) -- Using valid SQLit...
SELECT T2.author FROM acceptance AS T1 JOIN submission AS T2 ON T1.submission_id = T2.submission_id GROUP BY T2.author HAVING COUNT(DISTINCT T1.workshop_id) > 1
spider
CREATE TABLE table_78003 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the time/retired for thierry boutsen?
SELECT "Time/Retired" FROM table_78003 WHERE "Driver" = 'thierry boutsen'
wikisql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, ...
SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-133605') AND patient.unitdischargetime IS NULL) AND intakeoutput.c...
eicu
CREATE TABLE table_47139 ( "Rank" text, "Team" text, "Run 1" text, "Run 2" text, "Run 3" text, "Run 4" text, "Final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the run 3 for the team with a run 1 of 1:17.6?
SELECT "Run 3" FROM table_47139 WHERE "Run 1" = '1:17.6'
wikisql
CREATE TABLE table_15780049_8 ( high_rebounds VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the high rebounds for march 17
SELECT high_rebounds FROM table_15780049_8 WHERE date = "March 17"
sql_create_context
CREATE TABLE table_55848 ( "Presidency" real, "President" text, "Date of Birth" text, "Took office" real, "Left office" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest Presidency that Took Office after 1974 and Left Office in 1998...
SELECT MAX("Presidency") FROM table_55848 WHERE "Left office" = '1998' AND "Took office" > '1974'
wikisql
CREATE TABLE table_5841 ( "Race" text, "Length" text, "Class" text, "Circuit" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the length for GT class at Portland International Raceway?
SELECT "Length" FROM table_5841 WHERE "Class" = 'gt' AND "Circuit" = 'portland international raceway'
wikisql
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number ...
SELECT DISTINCT instructor.name 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 INNER JOIN offering_instructor ON offering_instr...
advising
CREATE TABLE table_name_41 ( deputy VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the deputy in 1992 93?
SELECT deputy FROM table_name_41 WHERE year = "1992–93"
sql_create_context
CREATE TABLE table_54105 ( "End of Fiscal Year" real, "Gross Debt in $Billions undeflated Treas." real, "as % of GDP Low-High" text, "Debt Held By Public ($Billions)" real, "as % of GDP (Treas/MW, OMB or OMB/MW)" real, "GDP $Billions OMB/BEA est.=MW.com" text ) -- Using valid SQLite, answer th...
SELECT AVG("Gross Debt in $Billions undeflated Treas.") FROM table_54105 WHERE "End of Fiscal Year" > '1980' AND "as % of GDP Low-High" = '83.4-84.4' AND "Debt Held By Public ($Billions)" < '7,552'
wikisql
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...
SELECT LName, COUNT(LName) FROM Student WHERE Sex = 'F' GROUP BY LName
nvbench
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate...
SELECT MAX(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 = 'ntprobnp')) GROUP BY cost.hadm_id) AS t1
mimic_iii
CREATE TABLE table_train_131 ( "id" int, "thyroid_disease" bool, "pulmonary_disease" bool, "right_bundle_branch_block" bool, "allergy_to_piperidine_derivatives" bool, "obstructive_pulmonary_disease" bool, "inflammatory_bowel_disease" bool, "renal_disease" bool, "hepatic_disease" bool...
SELECT * FROM table_train_131 WHERE absorption = 1 OR distribution = 1 OR metabolism = 1 OR (inflammatory_bowel_disease = 1 OR gastric = 1 OR duodenal_ulcers = 1 OR lactose_intolerance = 1)
criteria2sql
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, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2111.0" AND lab.fluid = "Urine"
mimicsql_data
CREATE TABLE table_57537 ( "Race" text, "Circuit" text, "Date" text, "Pole position" text, "Fastest lap" text, "Winning driver" text, "Constructor" text, "Tyre" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In the Can...
SELECT "Tyre" FROM table_57537 WHERE "Pole position" = 'jacky ickx' AND "Race" = 'canadian grand prix'
wikisql
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...
SELECT ACC_Regular_Season, Team_ID FROM basketball_match ORDER BY Team_ID DESC
nvbench
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,...
SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_CD, MIN(t_kc24.ILL_PAY / t_kc24.MED_AMOUT) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '9424563' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_CD
css
CREATE TABLE table_name_29 ( season INTEGER, game VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Season has a Game of fcs midwest region, and a Score of 40-33?
SELECT MAX(season) FROM table_name_29 WHERE game = "fcs midwest region" AND score = "40-33"
sql_create_context
CREATE TABLE table_name_63 ( win_percentage INTEGER, games_behind VARCHAR, wins VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest percentage of wins for 6 games and more than 77 total wins?
SELECT MIN(win_percentage) FROM table_name_63 WHERE games_behind = "6½" AND wins > 77
sql_create_context
CREATE TABLE Member_of ( FacID INTEGER, DNO INTEGER, Appt_Type VARCHAR(15) ) CREATE TABLE Faculty ( FacID INTEGER, Lname VARCHAR(15), Fname VARCHAR(15), Rank VARCHAR(15), Sex VARCHAR(1), Phone INTEGER, Room VARCHAR(5), Building VARCHAR(13) ) CREATE TABLE Student ( StuID...
SELECT Credits, Instructor FROM Course ORDER BY Credits
nvbench
CREATE TABLE table_40340 ( "Venue" text, "Location" text, "Capacity" text, "Owner" text, "Environment" text, "Year Built" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What type of environment is the venue that was built in 2003?
SELECT "Environment" FROM table_40340 WHERE "Year Built" = '2003'
wikisql
CREATE TABLE table_name_25 ( cuts_made INTEGER, tournament VARCHAR, wins VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Cuts made has a Tournament of totals, and Wins smaller than 11?
SELECT AVG(cuts_made) FROM table_name_25 WHERE tournament = "totals" AND wins < 11
sql_create_context
CREATE TABLE table_name_99 ( year INTEGER, rank VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the lowest Year that has the Rank smaller the 132, and the Name of biodiversity richness?
SELECT MIN(year) FROM table_name_99 WHERE rank < 132 AND name = "biodiversity richness"
sql_create_context
CREATE TABLE field ( fieldid int ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE cite ( ...
SELECT DISTINCT COUNT(cite.citedpaperid) FROM author, cite, paper, writes WHERE author.authorname = 'linda shapiro' AND paper.paperid = cite.citedpaperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
scholar
CREATE TABLE table_204_717 ( id number, "season" text, "level" number, "division" text, "place" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- the two level 6 seasons were 2012/13 and what other season ?
SELECT "season" FROM table_204_717 WHERE "season" <> '2012/13' AND "level" = 6
squall
CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_p...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.credits = 1 AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Fall' AND seme...
advising
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 zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyj...
css
CREATE TABLE table_name_28 ( gene VARCHAR, subject_number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which gene has the subject number 21?
SELECT gene FROM table_name_28 WHERE subject_number = "21"
sql_create_context
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost numb...
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 = 26350)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.lab...
mimic_iii
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE chartevents ...
SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5828 AND admissions.dischtime IS NULL) ORDER BY microbiologyevents.charttime LIMIT 1
mimic_iii
CREATE TABLE table_40179 ( "Name" text, "Pos." text, "Height" text, "Weight" real, "Year" text, "Hometown (Previous school)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Weight of the person who is 6'9'?
SELECT AVG("Weight") FROM table_40179 WHERE "Height" = '6''9'
wikisql
CREATE TABLE table_42204 ( "Name" text, "Innings" real, "Runs Scored" real, "Balls Faced" real, "Average" real, "S.R." real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many total innings have an average under 6.33, strike rate under 71.43, bal...
SELECT SUM("Innings") FROM table_42204 WHERE "Average" < '6.33' AND "S.R." < '71.43' AND "Balls Faced" > '36' AND "Runs Scored" < '19'
wikisql
CREATE TABLE table_204_72 ( id number, "election year" number, "# of\nconstituency votes" number, "# of\nparty list votes" number, "% of\nparty list votes" number, "# of\noverall seats won" text, "+/-" number ) -- Using valid SQLite, answer the following questions for the tables provided a...
SELECT "# of\noverall seats won" FROM table_204_72 WHERE "election year" = 1994
squall
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), CO...
SELECT EMAIL, SALARY 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 actor ( Duration VARCHAR, Age VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the duration of the oldest actor?
SELECT Duration FROM actor ORDER BY Age DESC LIMIT 1
sql_create_context
CREATE TABLE table_69725 ( "Race name" text, "Dist (miles)" text, "Course" text, "Prize" text, "Jockey" text, "Odds" text, "Runners" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the distance for the unnamed race with 3 runners at N...
SELECT "Dist (miles)" FROM table_69725 WHERE "Race name" = 'unnamed race' AND "Runners" = '3' AND "Course" = 'newcastle'
wikisql
CREATE TABLE table_68834 ( "City" text, "Country" text, "IATA" text, "ICAO" text, "Airport" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which country has an IATA of JFK?
SELECT "Country" FROM table_68834 WHERE "IATA" = 'jfk'
wikisql
CREATE TABLE table_66424 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many weeks have an attendance greater than 55,121, and l 27-7 as the result?
SELECT SUM("Week") FROM table_66424 WHERE "Attendance" > '55,121' AND "Result" = 'l 27-7'
wikisql
CREATE TABLE table_1341586_19 ( candidates VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many candidates with result being retired to run for u. s. senate republican hold
SELECT COUNT(candidates) FROM table_1341586_19 WHERE result = "Retired to run for U. S. Senate Republican hold"
sql_create_context
CREATE TABLE table_204_334 ( id number, "opposition" text, "matches" number, "won" number, "drawn" number, "lost" number, "for" number, "against" number, "win%" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who wins the most ?
SELECT "opposition" FROM table_204_334 WHERE "won" = (SELECT MAX("won") FROM table_204_334)
squall
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE lab ( labid number, patientuni...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', lab.labresulttime)) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-88691' AND patient.hospi...
eicu
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) ...
SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'diabetes mellitus' AND STRFTIME('%y', diagnosis.diagnosistime) = '2104') AS t1) - (SELECT COUNT(DIST...
eicu
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 jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_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 = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.J...
css
CREATE TABLE table_name_17 ( location_attendance VARCHAR, high_assists VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Location Attendance has a High assists of raymond felton (5), and a Record of 35 44?
SELECT location_attendance FROM table_name_17 WHERE high_assists = "raymond felton (5)" AND record = "35–44"
sql_create_context
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TAB...
SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE STRFTIME('%y', diagnosis.diagnosistime) >= '2101' GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 4
eicu
CREATE TABLE table_38047 ( "Year" real, "Men's singles" text, "Women's singles" text, "Men's doubles" text, "Women's doubles" text, "Mixed doubles" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Women's singles of akvil stapu aityt , and a Year ...
SELECT "Mixed doubles" FROM table_38047 WHERE "Women's singles" = 'akvilė stapušaitytė' AND "Year" = '2010'
wikisql
CREATE TABLE table_74149 ( "Institution" text, "Team" text, "City" text, "Province" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Endowment" text, "Football stadium" text, "Capacity" real ) -- Using valid SQLite, answer the following questions for the tables pro...
SELECT "Capacity" FROM table_74149 WHERE "Institution" = 'University of Alberta'
wikisql
CREATE TABLE table_name_18 ( date VARCHAR, high_assists VARCHAR, high_rebounds VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date were the high assists rondo (5) and the high rebounds rondo (10)?
SELECT date FROM table_name_18 WHERE high_assists = "rondo (5)" AND high_rebounds = "rondo (10)"
sql_create_context
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction 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...
SELECT DISTINCT course_offering.friday FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'ENGR' AND course.number = 996 AND semester.semester = 'WN' AND semester.year = 2016
advising
CREATE TABLE table_44614 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Nuggets points" real, "Opponents" real, "Record" text, "Streak" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Opponents have a Result of win,...
SELECT SUM("Opponents") FROM table_44614 WHERE "Result" = 'win' AND "Nuggets points" < '115' AND "Opponent" = 'washington'
wikisql
CREATE TABLE table_name_45 ( record VARCHAR, time__seconds_ INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the record for a time in seconds smaller than 5.22.
SELECT record FROM table_name_45 WHERE time__seconds_ < 5.22
sql_create_context
CREATE TABLE table_66229 ( "!Event" real, "Round" text, "Surface" text, "Winner" text, "Opponent" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Surface has an Opponent of rafael nadal, and an Event of 2?
SELECT "Surface" FROM table_66229 WHERE "Opponent" = 'rafael nadal' AND "!Event" = '2'
wikisql
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, ...
SELECT t_kc21.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_NM = '严秀逸' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 3743.87)
css
CREATE TABLE table_name_10 ( years_at_club VARCHAR, player VARCHAR, games VARCHAR, goals VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Years at club have Games smaller than 7, and Goals larger than 2, and a Player of john frazer?
SELECT years_at_club FROM table_name_10 WHERE games < 7 AND goals > 2 AND player = "john frazer"
sql_create_context
CREATE TABLE table_29483890_1 ( position VARCHAR, goals VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the position of the player with 57 goals?
SELECT position FROM table_29483890_1 WHERE goals = 57
sql_create_context
CREATE TABLE table_name_14 ( highest_position VARCHAR, issue_date VARCHAR, album_title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest position the album Where we belong, which had an issue date higher than 9, had?
SELECT COUNT(highest_position) FROM table_name_14 WHERE issue_date < 9 AND album_title = "where we belong"
sql_create_context
CREATE TABLE table_name_46 ( college VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What college did Matt Freeman go to?
SELECT college FROM table_name_46 WHERE player = "matt freeman"
sql_create_context
CREATE TABLE table_46573 ( "Game" real, "Date" text, "Location" text, "Time" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the sum of attendance for games with a time of 3:23?
SELECT SUM("Attendance") FROM table_46573 WHERE "Time" = '3:23'
wikisql
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE tra...
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14671) AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month')
mimic_iii
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, ...
SELECT (SELECT t_kc24.OVE_PAY FROM t_kc24 JOIN t_kc21_t_kc24 JOIN t_kc21 ON t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID AND t_kc21_t_kc24.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '58061396005') / (SELECT t_kc24.MED_AMOUT FROM t_kc24 WHERE t_kc21_t_kc24.MED_CLINIC_ID = '58061396005')
css
CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE equipment_sequence ( aircr...
SELECT DISTINCT flight.departure_time, flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DALLAS FORT ...
atis
CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE dataset ( datasetid int,...
SELECT DISTINCT writes.paperid FROM author, writes WHERE author.authorname = 'Yoav Artzi' AND writes.authorid = author.authorid
scholar
CREATE TABLE table_12340907_1 ( total_costs__2005_ VARCHAR, municipality VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the value of total costs (2005) in the Coldstream municipality?
SELECT total_costs__2005_ FROM table_12340907_1 WHERE municipality = "Coldstream"
sql_create_context
CREATE TABLE table_1341604_39 ( candidates VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many candidates won the election in the district whose incumbent is Bud Shuster?
SELECT COUNT(candidates) FROM table_1341604_39 WHERE incumbent = "Bud Shuster"
sql_create_context
CREATE TABLE Reviewer ( rID int, name text ) CREATE TABLE Movie ( mID int, title text, year int, director text ) CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What ...
SELECT title, AVG(stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY title
nvbench
CREATE TABLE table_1989 ( "Match no." real, "Match Type" text, "Team Europe" text, "Score" text, "Team USA" text, "Progressive Total" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When paul moor is on the europe team who is on the usa team?
SELECT "Team USA" FROM table_1989 WHERE "Team Europe" = 'Paul Moor'
wikisql
CREATE TABLE table_name_12 ( season VARCHAR, viewer_rank___number_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did the season premiere that had a viewer rank of #6?
SELECT season AS premiere FROM table_name_12 WHERE viewer_rank___number_ = "#6"
sql_create_context
CREATE TABLE authorship ( authid number, instid number, paperid number, authorder number ) CREATE TABLE inst ( instid number, name text, country text ) CREATE TABLE papers ( paperid number, title text ) CREATE TABLE authors ( authid number, lname text, fname text ) -...
SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = "Jeremy" AND t1.lname = "Gibbons"
spider
CREATE TABLE table_name_57 ( mintage INTEGER, theme VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the most mintage with common eider as the theme, and the year less than 2008?
SELECT MAX(mintage) FROM table_name_57 WHERE theme = "common eider" AND year < 2008
sql_create_context
CREATE TABLE table_10168 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the home team score when the away team scored 9.11 (65)?
SELECT "Home team score" FROM table_10168 WHERE "Away team score" = '9.11 (65)'
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...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "DIVORCED" AND procedures.long_title = "Circumcision"
mimicsql_data
CREATE TABLE Ship ( Ship_ID int, Name text, Type text, Built_Year real, Class text, Flag text ) CREATE TABLE captain ( Captain_ID int, Name text, Ship_ID int, age text, Class text, Rank text ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT Class, AVG(age) FROM captain GROUP BY Class ORDER BY Class DESC
nvbench
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...
SELECT MAX(demographic.age) FROM demographic WHERE demographic.ethnicity = "ASIAN" AND demographic.days_stay = "23"
mimicsql_data
CREATE TABLE airport ( id int, City text, Country text, IATA text, ICAO text, name text ) CREATE TABLE flight ( id int, Vehicle_Flight_number text, Date text, Pilot text, Velocity real, Altitude real, airport_id int, company_id int ) CREATE TABLE operate_company...
SELECT Pilot, COUNT(Pilot) FROM flight GROUP BY Pilot
nvbench
CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total...
SELECT DISTINCT num_enrolled FROM course WHERE department = 'EECS' AND number = 494
advising
CREATE TABLE table_16442 ( "Series #" real, "Episode #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who directed Episode 8?
SELECT "Directed by" FROM table_16442 WHERE "Episode #" = '8'
wikisql
CREATE TABLE table_53993 ( "Mid Gippsland FL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the low draw total for yarragon teams with over 3 wins, and under 966 aga...
SELECT MIN("Draws") FROM table_53993 WHERE "Wins" > '3' AND "Mid Gippsland FL" = 'yarragon' AND "Against" < '966'
wikisql
CREATE TABLE table_203_305 ( id number, "round" number, "#" number, "player" text, "nationality" text, "college/junior/club team (league)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the name of the last player on this chart ?
SELECT "player" FROM table_203_305 ORDER BY id DESC LIMIT 1
squall
CREATE TABLE table_11134 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What week was September 24, 2000 on?
SELECT SUM("Week") FROM table_11134 WHERE "Date" = 'september 24, 2000'
wikisql
CREATE TABLE table_40384 ( "Date" text, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what surface was the match played with a score of 4 6, 6 3, 6 1?
SELECT "Surface" FROM table_40384 WHERE "Score" = '4–6, 6–3, 6–1'
wikisql
CREATE TABLE table_204_81 ( id number, "rank" number, "bib" number, "name" text, "country" text, "time" text, "deficit" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what country had the most top 10 finishers in the men 's 15 kilometre clas...
SELECT "country" FROM table_204_81 WHERE id <= 10 GROUP BY "country" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE table_73028 ( "Japanese Title" text, "Romaji Title" text, "TV Station" text, "Time Frame" text, "Starring Actors" text, "Theme Song(s)" text, "Episodes" real, "Average Ratings" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- ...
SELECT "Average Ratings" FROM table_73028 WHERE "TV Station" = 'TV Asahi'
wikisql
CREATE TABLE table_24435 ( "Team name" text, "Races" real, "Won" real, "RR1 Pts." real, "RR2 Pts." real, "RR3 Pts." real, "Total Pts." real, "Ranking" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the rank when RR2 has 4 points?...
SELECT "Ranking" FROM table_24435 WHERE "RR2 Pts." = '4'
wikisql
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT Team_Name, ACC_Percent FROM basketball_match ORDER BY Team_Name
nvbench
CREATE TABLE table_36024 ( "Round" real, "Pick" real, "Player" text, "Position" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which position does bert coan play?
SELECT "Position" FROM table_36024 WHERE "Player" = 'bert coan'
wikisql
CREATE TABLE table_name_28 ( agg VARCHAR, team__number2 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When Estudiantes was team #2, what was their agg. value?
SELECT agg FROM table_name_28 WHERE team__number2 = "estudiantes"
sql_create_context
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_...
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 = 'TAMPA' AND date_day.day_number = 25 AND date_day.month_number = 6 AND dat...
atis
CREATE TABLE table_62311 ( "Year" real, "Award Ceremony" text, "Category" text, "Nominee" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many times is the award ceremony laurence olivier award, result is won and the nominee is ime...
SELECT COUNT("Year") FROM table_62311 WHERE "Award Ceremony" = 'laurence olivier award' AND "Result" = 'won' AND "Nominee" = 'imelda staunton'
wikisql
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
SELECT c.CreationDate, c.Text, c.Id AS "comment_link", c.PostId AS "post_link" FROM Comments AS c WHERE Text LIKE '%##keyword1##%' AND Text LIKE '%##keyword2##%' LIMIT 100
sede
CREATE TABLE table_1341897_45 ( incumbent VARCHAR, first_elected VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which incumbent was first elected in 1936?
SELECT incumbent FROM table_1341897_45 WHERE first_elected = 1936
sql_create_context
CREATE TABLE table_2583036_1 ( exposures VARCHAR, total_exposure_time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many exposures where there when the total exposure time is 105,000s?
SELECT exposures FROM table_2583036_1 WHERE total_exposure_time = "105,000s"
sql_create_context
CREATE TABLE table_name_69 ( points INTEGER, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Points have a Name of denis kornilov?
SELECT AVG(points) FROM table_name_69 WHERE name = "denis kornilov"
sql_create_context
CREATE TABLE table_204_402 ( id number, "rank" number, "player" text, "from" text, "to" text, "transfer fee\n(\u20ac million)" number, "year" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- where is dar o cvitanich from before transferring ...
SELECT "from" FROM table_204_402 WHERE "player" = 'dario cvitanich' AND "to" = 'ajax'
squall
CREATE TABLE table_14032 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Venue has Notes of 58.48 m?
SELECT "Venue" FROM table_14032 WHERE "Notes" = '58.48 m'
wikisql