instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_1206583_2 ( builder VARCHAR, launched VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the builder launched 30 october 1944?
SELECT builder FROM table_1206583_2 WHERE launched = "30 October 1944"
sql_create_context
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "ASIAN" AND prescriptions.drug = "Loperamide"
mimicsql_data
CREATE TABLE table_31245 ( "Episode" real, "Title" text, "Directed by" text, "Written by" text, "UK viewers (million)" text, "Share (%)" text, "Original air date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the director when the sh...
SELECT "Directed by" FROM table_31245 WHERE "Share (%)" = '11.8'
wikisql
CREATE TABLE fgwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '1868481' AND gwyjzb.OUT_DIAG_DIS_CD = 'X20.040' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '1868481' AND fgwyjzb.OUT_D...
css
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 ) -- Using valid SQLite, answer the following questions for the...
SELECT Name, COUNT(Name) FROM Products GROUP BY Name ORDER BY Name DESC
nvbench
CREATE TABLE table_37128 ( "Episode No." text, "Episode Title" text, "UK Broadcast Date" text, "Presenter" text, "Details of Journey" text, "Countries Visited" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which episode title featured a visit t...
SELECT "Episode Title" FROM table_37128 WHERE "Countries Visited" = 'cuba'
wikisql
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...
SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_NM = '张修真' AND t_kc22.STA_DATE BETWEEN '2002-01-10' AND '2014-09-10' AND qtb.MED_SER_ORG_NO = '7718159' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLIN...
css
CREATE TABLE Customer_Address_History ( customer_id INTEGER, address_id INTEGER, date_from DATETIME, date_to DATETIME ) CREATE TABLE Addresses ( address_id INTEGER, line_1_number_building VARCHAR(80), city VARCHAR(50), zip_postcode VARCHAR(20), state_province_county VARCHAR(50), ...
SELECT state_province_county, COUNT(*) FROM Addresses GROUP BY state_province_county ORDER BY COUNT(*)
nvbench
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
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 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...
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '尤飞双' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 7155.47)
css
CREATE TABLE table_32610 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the attendance of week 1
SELECT "Attendance" FROM table_32610 WHERE "Week" = '1'
wikisql
CREATE TABLE table_9735 ( "Season" text, "Winner" text, "Prize" text, "Runner-Up" text, "3rd place" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is 3rd Place, when Runner-Up is 'Simon Ehne', and when Prize is $100,000?
SELECT "3rd place" FROM table_9735 WHERE "Runner-Up" = 'simon ehne' AND "Prize" = '$100,000'
wikisql
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE chartevents ( row_id number, subject_id number, had...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'nystatin oral suspension' AND DATETIME(prescriptions.startdate, '...
mimic_iii
CREATE TABLE table_51575 ( "Nat." text, "Name" text, "Since" text, "Goals" real, "Transfer fee" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which name had 6 goals?
SELECT "Name" FROM table_51575 WHERE "Goals" = '6'
wikisql
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, Profi...
SELECT COUNT(Posts.Id) FROM Posts INNER JOIN Users ON Posts.OwnerUserId = Users.Id WHERE Posts.CreationDate < DATEADD(Day, 2, Users.CreationDate) AND YEAR(Users.CreationDate) = 2019 GROUP BY Users.Id
sede
CREATE TABLE table_18278508_2 ( date_performed VARCHAR, main_contestant VARCHAR, co_contestant__yaar_vs_pyaar_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date did Jatin Shah and Shalini Chandran perform?
SELECT date_performed FROM table_18278508_2 WHERE main_contestant = "Jatin Shah" AND co_contestant__yaar_vs_pyaar_ = "Shalini Chandran"
sql_create_context
CREATE TABLE table_name_23 ( call_sign VARCHAR, erp_w VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Call sign has an ERP W of 75?
SELECT call_sign FROM table_name_23 WHERE erp_w = 75
sql_create_context
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 job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), ...
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY SUM(MANAGER_ID) DESC
nvbench
CREATE TABLE table_204_766 ( id number, "event" text, "meeting gaz de france\nparis" text, "golden gala\nrome" text, "bislett games\noslo" text, "weltklasse zurich" text, "memorial van damme\nbrussels" text, "istaf\nberlin" text ) -- Using valid SQLite, answer the following questions f...
SELECT "event" FROM table_204_766 WHERE id = (SELECT id FROM table_204_766 WHERE "event" = 'pole vault') - 1
squall
CREATE TABLE table_25173505_13 ( english_version VARCHAR, buena_vista_edition VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the english version that is buena vista edition is daisuke gouri?
SELECT english_version FROM table_25173505_13 WHERE buena_vista_edition = "Daisuke Gouri"
sql_create_context
CREATE TABLE table_name_91 ( rapid VARCHAR, distance__km_ VARCHAR, station VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which rapid has a distance in km smaller than 14.2, and a Station of k my ji?
SELECT rapid FROM table_name_91 WHERE distance__km_ < 14.2 AND station = "kōmyōji"
sql_create_context
CREATE TABLE table_name_32 ( team_1 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When Aalborg BK is Team 1, what is the 1st leg?
SELECT 1 AS st_leg FROM table_name_32 WHERE team_1 = "aalborg bk"
sql_create_context
CREATE TABLE table_24115349_4 ( kennedy__percentage VARCHAR, coakley__percentage VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What percentage did kennedy win while coakly won 37.9%
SELECT kennedy__percentage FROM table_24115349_4 WHERE coakley__percentage = "37.9%"
sql_create_context
CREATE TABLE table_2113 ( "Institution" text, "Location" text, "Founded" real, "Type" text, "Enrollment" real, "Nickname" text, "Joined" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is the Eastern Nazarene College located?
SELECT "Location" FROM table_2113 WHERE "Institution" = 'Eastern Nazarene College'
wikisql
CREATE TABLE medicine ( id int, name text, Trade_Name text, FDA_approved text ) CREATE TABLE enzyme ( id int, name text, Location text, Product text, Chromosome text, OMIM int, Porphyria text ) CREATE TABLE medicine_enzyme_interaction ( enzyme_id int, medicine_id in...
SELECT name, id FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id ORDER BY name
nvbench
CREATE TABLE table_36754 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Lost have Points larger than 40, and a...
SELECT SUM("Lost") FROM table_36754 WHERE "Points" > '40' AND "Position" = '11' AND "Played" < '38'
wikisql
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
SELECT Price, Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder
nvbench
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Dorm_amenity ( amenid INTEGER, amenity_name VARCHAR(25) ) CREATE TABLE Has_amenity ( dormid INTEGER, ...
SELECT city_code, COUNT(*) FROM Student GROUP BY city_code ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_name_19 ( laps INTEGER, driver VARCHAR, grid VARCHAR, time_retired VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the highest lap for Luigi Piotti with more than 13 grid and a time/retired engine?
SELECT MAX(laps) FROM table_name_19 WHERE grid > 13 AND time_retired = "engine" AND driver = "luigi piotti"
sql_create_context
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25...
SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE HIRE_DATE < '2002-06-21'
nvbench
CREATE TABLE table_name_47 ( team VARCHAR, last_match VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of team with Palmeiras 4-2 portuguesa as the last match?
SELECT team FROM table_name_47 WHERE last_match = "palmeiras 4-2 portuguesa"
sql_create_context
CREATE TABLE table_26263322_1 ( candidate VARCHAR, background VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many times was the background self-employed - media agency?
SELECT COUNT(candidate) FROM table_26263322_1 WHERE background = "Self-employed - media agency"
sql_create_context
CREATE TABLE table_41061 ( "Date" text, "Title" text, "Director" text, "Production Cost" text, "Singapore Gross" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the film directed by Pen-Ek Ratanaruang released?
SELECT "Date" FROM table_41061 WHERE "Director" = 'pen-ek ratanaruang'
wikisql
CREATE TABLE payment ( payment_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did the first payment happen?
SELECT payment_date FROM payment ORDER BY payment_date LIMIT 1
sql_create_context
CREATE TABLE table_name_99 ( part_1 VARCHAR, part_2 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Part 1, when Part 2 is 'fraus'?
SELECT part_1 FROM table_name_99 WHERE part_2 = "fraus"
sql_create_context
CREATE TABLE Products ( Product_Type_Code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the product type codes that have at least two products.
SELECT Product_Type_Code FROM Products GROUP BY Product_Type_Code HAVING COUNT(*) >= 2
sql_create_context
CREATE TABLE table_213088_1 ( location_chernobyl_1_chernobyl_2_chernobyl_3_chernobyl_4_chernobyl_5_ignalina_1_ignalina_2_ignalina_3_kursk_1_kursk_2_kursk_3_kursk_4_kursk_5_kursk_6_leningrad_1_leningrad_2_leningrad_3_leningrad_4_smolensk_1_smolensk_2_smolensk_3_smolensk_4_directorate_for_construction_of_kostoma_npp_...
SELECT location_chernobyl_1_chernobyl_2_chernobyl_3_chernobyl_4_chernobyl_5_ignalina_1_ignalina_2_ignalina_3_kursk_1_kursk_2_kursk_3_kursk_4_kursk_5_kursk_6_leningrad_1_leningrad_2_leningrad_3_leningrad_4_smolensk_1_smolensk_2_smolensk_3_smolensk_4_directorate_for_construction_of_kostoma_npp__for_kostroma_1_and_2__tabl...
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...
SELECT SUM(t_kc22.AMOUNT) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '6716051' AND t_kc22.STA_DATE BETWEEN '2004-12-11' AND '2008-12-18' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT SUM(t_kc22.AMOUNT) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID ...
css
CREATE TABLE table_name_80 ( game VARCHAR, home_team VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Game has a Home Team of san francisco, and a Date of april 22?
SELECT game FROM table_name_80 WHERE home_team = "san francisco" AND date = "april 22"
sql_create_context
CREATE TABLE artwork ( Name VARCHAR, TYPE VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the name of artworks whose type is not 'Program Talent Show'.
SELECT Name FROM artwork WHERE TYPE <> "Program Talent Show"
sql_create_context
CREATE TABLE table_73772 ( "June 10-11" text, "March 27-29" text, "January 15-16" text, "November 3" text, "August 21-22" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number for march 27-29 whern november 3 is 153?
SELECT "March 27-29" FROM table_73772 WHERE "November 3" = '153'
wikisql
CREATE TABLE table_name_11 ( division INTEGER, reg_season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the lowest division in the 7th season?
SELECT MIN(division) FROM table_name_11 WHERE reg_season = "7th"
sql_create_context
CREATE TABLE table_63962 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the highest top-5 when wins is more than 1?
SELECT MAX("Top-5") FROM table_63962 WHERE "Wins" > '1'
wikisql
CREATE TABLE table_name_40 ( away_team VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was Essendon's opponents away score?
SELECT away_team AS score FROM table_name_40 WHERE home_team = "essendon"
sql_create_context
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE diagnoses_icd ( row_id ...
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 61527) AND prescriptions.drug IN ('docusate sodium', 'potassium chloride', 'spironolactone') AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 's...
mimic_iii
CREATE TABLE table_28138035_33 ( year_location VARCHAR, womens_doubles VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the place and when was the year when the women's doubles womens were Bai yang Niu Jianfeng?
SELECT year_location FROM table_28138035_33 WHERE womens_doubles = "Bai Yang Niu Jianfeng"
sql_create_context
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE cours...
SELECT DISTINCT name, number FROM course WHERE credits = 12 AND department = 'EECS'
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 jyjgzbb.JCFF FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb...
css
CREATE TABLE table_64527 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Replaced by" text, "Date of appointment" text, "Position in table" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is t...
SELECT "Date of vacancy" FROM table_64527 WHERE "Position in table" = '10th' AND "Team" = 'balboa'
wikisql
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...
SELECT COUNT(DISTINCT IN_DIAG_DIS_CD) FROM t_kc21 WHERE PERSON_ID = '28382024' AND IN_HOSP_DATE BETWEEN '2004-09-29' AND '2010-04-29'
css
CREATE TABLE race ( Race_ID int, Name text, Class text, Date text, Track_ID text ) CREATE TABLE track ( Track_ID int, Name text, Location text, Seating real, Year_Opened real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the ra...
SELECT Class, COUNT(*) FROM race GROUP BY Class
nvbench
CREATE TABLE table_204_585 ( id number, "year" text, "player" text, "high school" text, "college" text, "nba/aba draft" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who was the last player who went to indiana to win an award ?
SELECT "player" FROM table_204_585 WHERE "college" = 'indiana' ORDER BY "year" DESC LIMIT 1
squall
CREATE TABLE table_64805 ( "Date" text, "Venue" text, "Opponents" text, "Competition" text, "Match Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the match report from the game played on 25 april 2009?
SELECT "Match Report" FROM table_64805 WHERE "Date" = '25 april 2009'
wikisql
CREATE TABLE table_71857 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score of the game that had a loss of Cerutti (0-1)?
SELECT "Score" FROM table_71857 WHERE "Loss" = 'cerutti (0-1)'
wikisql
CREATE TABLE table_49830 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Time/Retired has a Rider of daijiro kato?
SELECT "Time/Retired" FROM table_49830 WHERE "Rider" = 'daijiro kato'
wikisql
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT t_kc24.t_kc21_IN_DIAG_DIS_CD, t_kc24.t_kc21_IN_DIAG_DIS_NM FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_NM = '奚映寒' AND t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 2623.6)
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, ...
SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'lung abscess')) AND STRFTIME('%y', cost.char...
eicu
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, ...
SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-2 year') GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 3
eicu
CREATE TABLE airports ( name VARCHAR, city VARCHAR, apid VARCHAR ) CREATE TABLE routes ( src_apid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the name and city of the airport which is the source for the most number of flight routes.
SELECT T1.name, T1.city, T2.src_apid FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T2.src_apid ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
CREATE TABLE table_18502 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of the election when Tic Forrester ran as an incumbe...
SELECT "Result" FROM table_18502 WHERE "Incumbent" = 'Tic Forrester'
wikisql
CREATE TABLE table_name_8 ( club VARCHAR, lost VARCHAR, tries_for VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Club, when the value for Lost is 9, and when the value for Tries is 55?
SELECT club FROM table_name_8 WHERE lost = "9" AND tries_for = "55"
sql_create_context
CREATE TABLE table_204_708 ( id number, "victim(s)" text, "age" number, "gender" text, "date" text, "type of attack" text, "location" text, "details" text, "source(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many total non...
SELECT COUNT(*) FROM table_204_708
squall
CREATE TABLE table_1445 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Ground" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where did the team play when the home team score...
SELECT "Ground" FROM table_1445 WHERE "Home team score" = '12.9 (81)'
wikisql
CREATE TABLE table_name_53 ( points INTEGER, assists VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the most Points with an Assist of 46?
SELECT MAX(points) FROM table_name_53 WHERE assists = 46
sql_create_context
CREATE TABLE table_38066 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Opponent" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which championship has Roger Federer as an opponent on a clay surface in a year ...
SELECT "Championship" FROM table_38066 WHERE "Opponent" = 'roger federer' AND "Surface" = 'clay' AND "Year" < '2007'
wikisql
CREATE TABLE table_13218 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Country of the T8 Place Player with a Score of 70-67-71=208?
SELECT "Country" FROM table_13218 WHERE "Place" = 't8' AND "Score" = '70-67-71=208'
wikisql
CREATE TABLE table_60668 ( "State" text, "GR\u00dcNE" text, "FRITZ" text, "RETT\u00d6" text, "LINKE" text, "STARK" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What percent did GR NE get in the state where FRITZ got 1.3%?
SELECT "GR\u00dcNE" FROM table_60668 WHERE "FRITZ" = '1.3%'
wikisql
CREATE TABLE table_name_89 ( time_retired VARCHAR, constructor VARCHAR, grid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Time/Retired for brabham - climax, on Grid of 10?
SELECT time_retired FROM table_name_89 WHERE constructor = "brabham - climax" AND grid = 10
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 diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH" AND procedures.icd9_code = "9465"
mimicsql_data
CREATE TABLE manufacturers ( code number, name text, headquarter text, founder text, revenue number ) CREATE TABLE products ( code number, name text, price number, manufacturer number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Comput...
SELECT AVG(price) FROM products
spider
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABL...
SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 2957 AND admissions.dischtime IS NULL) AND microbiologyevents.spec_type_desc = 'peripheral blood lymphocytes' AND NOT microbiologyevents.org_name IS NULL ORDER BY micr...
mimic_iii
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...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "REHAB/DISTINCT PART HOSP" AND procedures.icd9_code = "3491"
mimicsql_data
CREATE TABLE table_22386 ( "Season" real, "Trophy Winner" text, "Air Force \u2013 Navy score" text, "Air Force \u2013 Army score" text, "Army \u2013 Navy score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Air Force - Navy score in th...
SELECT "Air Force \u2013 Navy score" FROM table_22386 WHERE "Season" = '1983'
wikisql
CREATE TABLE table_name_21 ( ship_types_delivered VARCHAR, total_vessels_built_for_usmc VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the ship types delivered when the total vessels built for usmc is 13 ships for usmc (plus 37 more for usn)?
SELECT ship_types_delivered FROM table_name_21 WHERE total_vessels_built_for_usmc = "13 ships for usmc (plus 37 more for usn)"
sql_create_context
CREATE TABLE table_name_31 ( qual_2 VARCHAR, team VARCHAR, qual_1 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the second qualifying time for the dale coyne racing team with a first qualifying time of 1:00.081?
SELECT qual_2 FROM table_name_31 WHERE team = "dale coyne racing" AND qual_1 = "1:00.081"
sql_create_context
CREATE TABLE table_40138 ( "Office" text, "Republican ticket" text, "Democratic ticket" text, "Socialist Labor ticket" text, "Prohibition ticket" text, "Independent Citizens' ticket" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Prohibiti...
SELECT "Prohibition ticket" FROM table_40138 WHERE "Socialist Labor ticket" = 'joseph smith'
wikisql
CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adults INTEGER, Kids INTEGER ) CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, baseP...
SELECT bedType, AVG(basePrice) FROM Rooms GROUP BY bedType
nvbench
CREATE TABLE table_203_391 ( id number, "season" text, "greek league" text, "greek cup" text, "europe" text, "coach" text, "roster" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- after the 1928-29 championship , how many times was the panell...
SELECT COUNT(*) FROM table_203_391 WHERE "season" > '1928-29' AND "greek league" = 'champion'
squall
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.admityear >= "2190"
mimicsql_data
CREATE TABLE table_2374338_2 ( croats VARCHAR, roma VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is every value for Croats if the value of Roma is 3.1%?
SELECT croats FROM table_2374338_2 WHERE roma = "3.1%"
sql_create_context
CREATE TABLE table_14651 ( "City" text, "Province/Region" text, "Country" text, "IATA" text, "ICAO" text, "Airport" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which airport is in Tokyo and has an ICAO of rjtt?
SELECT "Airport" FROM table_14651 WHERE "City" = 'tokyo' AND "ICAO" = 'rjtt'
wikisql
CREATE TABLE table_41563 ( "Branch" text, "Address" text, "Neighborhood" text, "First branch opened" real, "Current branch opened" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Neighborhood, when Branch is Hollywood Library?
SELECT "Neighborhood" FROM table_41563 WHERE "Branch" = 'hollywood library'
wikisql
CREATE TABLE aircraft ( aid number, name text, distance number ) CREATE TABLE employee ( eid number, name text, salary number ) CREATE TABLE flight ( flno number, origin text, destination text, distance number, departure_date time, arrival_date time, price number, ...
SELECT name FROM employee WHERE salary > (SELECT AVG(salary) FROM employee)
spider
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...
SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.admission_type = "ELECTIVE"
mimicsql_data
CREATE TABLE table_name_60 ( driver VARCHAR, laps VARCHAR, grid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the driver for Laps less than 9 and a grid of 13
SELECT driver FROM table_name_60 WHERE laps < 9 AND grid = 13
sql_create_context
CREATE TABLE climber ( climber_id number, name text, country text, time text, points number, mountain_id number ) CREATE TABLE mountain ( mountain_id number, name text, height number, prominence number, range text, country text ) -- Using valid SQLite, answer the follo...
SELECT T2.height FROM climber AS T1 JOIN mountain AS T2 ON T1.mountain_id = T2.mountain_id ORDER BY T1.points DESC LIMIT 1
spider
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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.ethnicity = "ASIAN"
mimicsql_data
CREATE TABLE table_37357 ( "Date" text, "Time" text, "Opponent" text, "Score" text, "Loss" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what team lost on july 30
SELECT "Loss" FROM table_37357 WHERE "Date" = 'july 30'
wikisql
CREATE TABLE stock ( Device_ID VARCHAR ) CREATE TABLE device ( Carrier VARCHAR, Device_ID VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the carriers of devices in stock at more than one 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
sql_create_context
CREATE TABLE table_52835 ( "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. -- What did the home team score in the game where t...
SELECT "Home team score" FROM table_52835 WHERE "Away team score" = '8.14 (62)'
wikisql
CREATE TABLE festival_detail ( Festival_Name VARCHAR, LOCATION VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the names and locations of festivals?
SELECT Festival_Name, LOCATION FROM festival_detail
sql_create_context
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
SELECT DISTINCT course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_i...
advising
CREATE TABLE Customer_Addresses ( customer_id INTEGER, address_id INTEGER, date_from DATETIME, address_type VARCHAR(10), date_to DATETIME ) CREATE TABLE Delivery_Route_Locations ( location_code VARCHAR(10), route_id INTEGER, location_address_id INTEGER, location_name VARCHAR(50) ) ...
SELECT state_province_county, COUNT(*) FROM Customer_Addresses AS t1 JOIN Addresses AS t2 ON t1.address_id = t2.address_id GROUP BY t2.state_province_county
nvbench
CREATE TABLE procedures ( 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 ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "67" AND prescriptions.drug = "Theophylline SR"
mimicsql_data
CREATE TABLE table_48605 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What place did Jerry Barber of the United States come in at?
SELECT "Place" FROM table_48605 WHERE "Country" = 'united states' AND "Player" = 'jerry barber'
wikisql
CREATE TABLE Apartment_Bookings ( apt_booking_id INTEGER, apt_id INTEGER, guest_id INTEGER, booking_status_code CHAR(15), booking_start_date DATETIME, booking_end_date DATETIME ) CREATE TABLE Apartments ( apt_id INTEGER, building_id INTEGER, apt_type_code CHAR(15), apt_number CH...
SELECT apt_type_code, MIN(room_count) FROM Apartments GROUP BY apt_type_code ORDER BY MIN(room_count)
nvbench
CREATE TABLE table_30934 ( "Series #" real, "Production Code" real, "Title" text, "Directed by" text, "Written by" text, "United States Original Airdate" text, "Canada Original Airdate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who were...
SELECT "Written by" FROM table_30934 WHERE "United States Original Airdate" = 'June 9, 2012'
wikisql
CREATE TABLE table_1506950_9 ( player VARCHAR, us_open VARCHAR, pga_ch VARCHAR, masters VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player's results were T6 in the PGA Ch., T4 in the Masters and T8 at the U.S. Open?
SELECT player FROM table_1506950_9 WHERE pga_ch = "T6" AND masters = "T4" AND us_open = "T8"
sql_create_context
CREATE TABLE table_name_52 ( loss VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who did the team lose to on September 8?
SELECT loss FROM table_name_52 WHERE date = "september 8"
sql_create_context
CREATE TABLE table_204_236 ( id number, "title" text, "release date" text, "developer(s)" text, "publisher(s)" text, "genre(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the first game released ?
SELECT "title" FROM table_204_236 ORDER BY "release date" LIMIT 1
squall