instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_68652 ( "Tournament" text, "2003" text, "2007" text, "2008" text, "2009" text, "2011" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2007 value with 1r in 2009 and 2r in 2011 at the Tournament of Wimbledon?
SELECT "2007" FROM table_68652 WHERE "2009" = '1r' AND "2011" = '2r' AND "Tournament" = 'wimbledon'
wikisql
CREATE TABLE table_32685 ( "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. -- Who played as the home team when the attendance ...
SELECT "Home team" FROM table_32685 WHERE "Crowd" > '30,080'
wikisql
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) 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...
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis AS FARE_BASIS_0, fare_basis AS FARE_BASIS_1, flight, flight_fare WHERE (((CITY_1....
atis
CREATE TABLE table_24455 ( "No." real, "#" real, "Title" text, "Directed by" text, "Written by" text, "U.S. viewers (million)" text, "Original air date" text, "Production code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the orig...
SELECT "Original air date" FROM table_24455 WHERE "U.S. viewers (million)" = '9.16'
wikisql
CREATE TABLE table_name_69 ( nature_of_incident VARCHAR, circumstances VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the nature of the incident that's a bomb attack?
SELECT nature_of_incident FROM table_name_69 WHERE circumstances = "bomb attack"
sql_create_context
CREATE TABLE table_name_19 ( opponents VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the result is d, who are the opponents?
SELECT opponents FROM table_name_19 WHERE result = "d"
sql_create_context
CREATE TABLE table_13699 ( "Year" real, "Labour" real, "Lib Dem" real, "Green" real, "IWCA" real, "Independent" real, "Conservative" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the the average Lib Dem with Conservative smaller than 0...
SELECT AVG("Lib Dem") FROM table_13699 WHERE "Conservative" < '0'
wikisql
CREATE TABLE table_22050544_1 ( winner VARCHAR, elapsed_time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the winner with an elapsed time of 12 h 42 min?
SELECT winner FROM table_22050544_1 WHERE elapsed_time = "12 h 42 min"
sql_create_context
CREATE TABLE table_name_4 ( gold VARCHAR, nation VARCHAR, silver VARCHAR, bronze VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of gold when the silver is 1, bronze is 1, and the nation is Austria?
SELECT COUNT(gold) FROM table_name_4 WHERE silver = 1 AND bronze = 1 AND nation = "austria"
sql_create_context
CREATE TABLE table_name_6 ( venue VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where was the game played on 30 May 2004?
SELECT venue FROM table_name_6 WHERE date = "30 may 2004"
sql_create_context
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 cost ( row_id number, subject_id number, hadm_id nu...
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT inputevents_cv.itemid 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 STRFTIME('%y-%m-%d', inp...
mimic_iii
CREATE TABLE table_50099 ( "Player" text, "Nationality" text, "Position" text, "Years for Grizzlies" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the nationality of a point guard position in 1999-2001?
SELECT "Nationality" FROM table_50099 WHERE "Position" = 'point guard' AND "Years for Grizzlies" = '1999-2001'
wikisql
CREATE TABLE table_11545282_11 ( position VARCHAR, no VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the position of number 47?
SELECT position FROM table_11545282_11 WHERE no = "47"
sql_create_context
CREATE TABLE table_name_72 ( serial_format VARCHAR, design VARCHAR, serials_issued VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the serial format for white on blue with a serial issued of ss-00-00 to zz-99-99?
SELECT serial_format FROM table_name_72 WHERE design = "white on blue" AND serials_issued = "ss-00-00 to zz-99-99"
sql_create_context
CREATE TABLE table_26613 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the series ...
SELECT MIN("No. in series") FROM table_26613 WHERE "Written by" = 'Tim Schlattmann'
wikisql
CREATE TABLE table_64733 ( "Township" text, "County" text, "Pop. (2010)" real, "Land ( sqmi )" real, "Water (sqmi)" real, "Latitude" real, "Longitude" real, "GEO ID" real, "ANSI code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Ca...
SELECT AVG("Latitude") FROM table_64733 WHERE "Land ( sqmi )" < '35.874' AND "Pop. (2010)" > '35' AND "County" = 'cass' AND "Water (sqmi)" = '0.008'
wikisql
CREATE TABLE table_63048 ( "Year" real, "Date" text, "Winners" text, "Score" text, "Runners Up" text, "Att." real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score for the matchup having attendance of 354?
SELECT "Score" FROM table_63048 WHERE "Att." = '354'
wikisql
CREATE TABLE table_43654 ( "Rank" real, "Country" text, "Year" real, "Males" real, "Females" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the biggest number of females where the males are at 28.2 with a rank greater than ...
SELECT MAX("Females") FROM table_43654 WHERE "Males" = '28.2' AND "Rank" > '5'
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...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "DIVORCED" AND diagnoses.short_title = "Cellulitis of hand"
mimicsql_data
CREATE TABLE table_name_71 ( venue VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the venue for the game on 10-09-2012?
SELECT venue FROM table_name_71 WHERE date = "10-09-2012"
sql_create_context
CREATE TABLE table_27491610_2 ( no_in_season INTEGER, no_in_series VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What number in season is number 141 in series?
SELECT MAX(no_in_season) FROM table_27491610_2 WHERE no_in_series = 141
sql_create_context
CREATE TABLE table_60960 ( "Cover Date" text, "Story Title" text, "Writer/s" text, "Letterer/s" text, "Colourist/s" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Cover Date of the Story Title Spacehikers (Part 2)?
SELECT "Cover Date" FROM table_60960 WHERE "Story Title" = 'spacehikers (part 2)'
wikisql
CREATE TABLE ENROLL ( CLASS_CODE varchar(5), STU_NUM int, ENROLL_GRADE varchar(50) ) CREATE TABLE EMPLOYEE ( EMP_NUM int, EMP_LNAME varchar(15), EMP_FNAME varchar(12), EMP_INITIAL varchar(1), EMP_JOBCODE varchar(5), EMP_HIREDATE datetime, EMP_DOB datetime ) CREATE TABLE STUDENT...
SELECT STU_FNAME, STU_GPA FROM STUDENT ORDER BY STU_GPA DESC LIMIT 5
nvbench
CREATE TABLE table_49732 ( "Round" real, "Player" text, "Position" text, "Nationality" text, "College/Junior/Club Team (League)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many rounds does Colby Robak have with a position of (d)?
SELECT "Round" FROM table_49732 WHERE "Position" = '(d)' AND "Player" = 'colby robak'
wikisql
CREATE TABLE table_204_131 ( id number, "tops design code" text, "electrical system" text, "max speed" text, "weight" text, "brakes" text, "route availability" number, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many times...
SELECT COUNT(*) FROM table_204_131 WHERE "electrical system" = '90 v'
squall
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT person_info.XM FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE jybgb.BGDH = '2...
css
CREATE TABLE table_14500 ( "Name" text, "Years" text, "Gender" text, "Area" text, "Authority" text, "Decile" real, "Roll" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What years does the school have with a roll of 33?
SELECT "Years" FROM table_14500 WHERE "Roll" = '33'
wikisql
CREATE TABLE stock ( shop_id number, device_id number, quantity number ) CREATE TABLE device ( device_id number, device text, carrier text, package_version text, applications text, software_platform text ) CREATE TABLE shop ( shop_id number, shop_name text, location tex...
SELECT T2.shop_name FROM stock AS T1 JOIN shop AS T2 ON T1.shop_id = T2.shop_id GROUP BY T1.shop_id ORDER BY SUM(T1.quantity) DESC LIMIT 1
spider
CREATE TABLE CLASS ( CLASS_CODE varchar(5), CRS_CODE varchar(10), CLASS_SECTION varchar(2), CLASS_TIME varchar(20), CLASS_ROOM varchar(8), PROF_NUM int ) CREATE TABLE ENROLL ( CLASS_CODE varchar(5), STU_NUM int, ENROLL_GRADE varchar(50) ) CREATE TABLE PROFESSOR ( EMP_NUM int, ...
SELECT PROF_OFFICE, COUNT(PROF_OFFICE) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE JOIN PROFESSOR AS T4 ON T2.EMP_NUM = T4.EMP_NUM GROUP BY CRS_DESCRIPTION, PROF_OFFICE ORDER BY COUNT(PROF_OFFICE) DESC
nvbench
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 WHERE demographic.admission_type = "NEWBORN" AND demographic.days_stay > "9"
mimicsql_data
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 MAIN_COND_DES FROM t_kc21 WHERE MED_CLINIC_ID = '04273607781'
css
CREATE TABLE certificate ( eid number(9,0), aid number(9,0) ) CREATE TABLE flight ( flno number(4,0), origin varchar2(20), destination varchar2(20), distance number(6,0), departure_date date, arrival_date date, price number(7,2), aid number(9,0) ) CREATE TABLE aircraft ( ai...
SELECT name, distance FROM aircraft ORDER BY name DESC
nvbench
CREATE TABLE table_66626 ( "City of license" text, "Identifier" text, "Frequency" text, "Power" text, "Class" text, "RECNet" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Class has the Identifier of CBFX-FM-6?
SELECT "Class" FROM table_66626 WHERE "Identifier" = 'cbfx-fm-6'
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_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_i...
mimic_iii
CREATE TABLE table_13456202_1 ( founded INTEGER, school VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHat year was north college hill high school founded?
SELECT MAX(founded) FROM table_13456202_1 WHERE school = "North College Hill High school"
sql_create_context
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zo...
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, state AS STATE_0, state AS STATE_1 WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ST. PAUL' AND date_day.day_number = 2...
atis
CREATE TABLE table_name_33 ( name VARCHAR, games VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who won a medal at the 2008 Beijing Olympics?
SELECT name FROM table_name_33 WHERE games = "2008 beijing"
sql_create_context
CREATE TABLE table_204_22 ( id number, "date" text, "opponent#" text, "rank#" text, "site" text, "result" text, "attendance" number, "record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many of the games were the illini ranked ?
SELECT COUNT(*) FROM table_204_22 WHERE NOT "rank#" IS NULL
squall
CREATE TABLE table_26397 ( "Series #" real, "Season #" 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. -- List the title for the season episode number of 8.
SELECT "Title" FROM table_26397 WHERE "Season #" = '8'
wikisql
CREATE TABLE table_61891 ( "Week 1" text, "Week 2" text, "Week 3" text, "Week 4" text, "Week 5" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the cyber girl in week 3 when Demi Jessica was the cyber girl in week 1?
SELECT "Week 3" FROM table_61891 WHERE "Week 1" = 'demi jessica'
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 WHERE demographic.diagnosis = "STEMI" AND demographic.age < "20"
mimicsql_data
CREATE TABLE table_name_21 ( pop__2010_ INTEGER, latitude VARCHAR, land___sqmi__ VARCHAR, ansi_code VARCHAR, longitude VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Pop (2010) has an ANSI code smaller than 1036864, and a Longitude larger t...
SELECT AVG(pop__2010_) FROM table_name_21 WHERE ansi_code < 1036864 AND longitude > -98.46611 AND land___sqmi__ < 36.238 AND latitude < 48.144102
sql_create_context
CREATE TABLE table_name_73 ( money___$__ VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much did Larry Nelson win?
SELECT money___$__ FROM table_name_73 WHERE player = "larry nelson"
sql_create_context
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time )...
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-44470')) AND vitalperiodic.temperature > 37.139...
eicu
CREATE TABLE table_name_53 ( evening_gown INTEGER, average VARCHAR, swimsuit VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the sum of evening gown for average of 9.06 and swimsuit less than 8.76
SELECT SUM(evening_gown) FROM table_name_53 WHERE average = 9.06 AND swimsuit < 8.76
sql_create_context
CREATE TABLE table_204_940 ( id number, "year" number, "tournaments\nplayed" number, "cuts\nmade" number, "wins" number, "2nd" number, "3rd" number, "top 10s" number, "best\nfinish" text, "earnings\n(\u20ac)" number, "money\nlist rank" number, "scoring\naverage" number, ...
SELECT SUM("wins") FROM table_204_940
squall
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, Deletio...
SELECT Id, LastActivityDate, CreationDate, Score, ViewCount, Body, OwnerUserId, Title, Tags, AnswerCount FROM Posts WHERE Tags LIKE '%<windows-phone%' AND PostTypeId = 1 ORDER BY LastActivityDate DESC
sede
CREATE TABLE table_204_922 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which country scored the most gold medals at this event ?
SELECT "nation" FROM table_204_922 ORDER BY "gold" DESC LIMIT 1
squall
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 demographic.diagnosis, procedures.icd9_code FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Brian Brock"
mimicsql_data
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number,...
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 = 13837)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit wt'...
mimic_iii
CREATE TABLE table_15765 ( "Shirt No" real, "Player" text, "Birth Date" text, "Weight" real, "Height" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Birth Date of 8 November 1980, and a Weight smaller than 93 has what sum of a shirt number?
SELECT SUM("Shirt No") FROM table_15765 WHERE "Birth Date" = '8 november 1980' AND "Weight" < '93'
wikisql
CREATE TABLE table_19259 ( "AGR Power Station" text, "Net MWe" real, "Construction started" real, "Connected to grid" real, "Commercial operation" real, "Accounting closure date" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year did const...
SELECT "Construction started" FROM table_19259 WHERE "AGR Power Station" = 'Heysham 1'
wikisql
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE cost ( ro...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = '1 int mam-cor art byp...
mimic_iii
CREATE TABLE table_33009 ( "Region" text, "Host" text, "Venue" text, "City" text, "State" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What region does the University of California, Los Angeles play in?
SELECT "Region" FROM table_33009 WHERE "State" = 'california' AND "Host" = 'university of california, los angeles'
wikisql
CREATE TABLE table_23705843_1 ( original_air_date VARCHAR, ratings__millions_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the original air date if the ratings is 1.92 million?
SELECT original_air_date FROM table_23705843_1 WHERE ratings__millions_ = "1.92"
sql_create_context
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester i...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND semester.semester = 'WN' AND semester.semester_id = course_offering.semester AND semester.year = 2016 ORDER BY course.department
advising
CREATE TABLE table_27771406_1 ( club VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What club did Cyril Christiani play for?
SELECT club FROM table_27771406_1 WHERE player = "Cyril Christiani"
sql_create_context
CREATE TABLE player ( Player_ID int, Player text, Years_Played text, Total_WL text, Singles_WL text, Doubles_WL text, Team int ) CREATE TABLE team ( Team_id int, Name text ) CREATE TABLE match_season ( Season real, Player text, Position text, Country int, Team i...
SELECT Position, COUNT(*) FROM match_season GROUP BY Position ORDER BY Position
nvbench
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT demographic.language FROM demographic WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE table_71812 ( "Date" text, "Visiting Team" text, "Final Score" text, "Host Team" text, "Stadium" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Host Team has Final Score of 42-23?
SELECT "Host Team" FROM table_71812 WHERE "Final Score" = '42-23'
wikisql
CREATE TABLE table_name_88 ( phonetic VARCHAR, standard_thai VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the phonetic when the standard thai is ?
SELECT phonetic FROM table_name_88 WHERE standard_thai = "ผ่า"
sql_create_context
CREATE TABLE Products ( Product_ID INTEGER, Product_Type_Code CHAR(15), Product_Name VARCHAR(255), Product_Price DECIMAL(20,4) ) CREATE TABLE Parties ( Party_ID INTEGER, Party_Details VARCHAR(255) ) CREATE TABLE Products_in_Events ( Product_in_Event_ID INTEGER, Event_ID INTEGER, Pr...
SELECT Product_Type_Code, COUNT(Product_Type_Code) FROM Products GROUP BY Product_Type_Code
nvbench
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE Posts ( ...
SELECT YEAR(p.CreationDate), SUM(CASE WHEN NOT t.Id IS NULL THEN 1 ELSE 0 END) / CAST(COUNT(p.Id) AS FLOAT) AS "ratio of id requests" FROM Posts AS p JOIN PostTags AS pt ON pt.PostId = p.Id LEFT OUTER JOIN Tags AS t ON t.Id = pt.TagId AND t.TagName = 'single-word-requests' WHERE p.PostTypeId = 1 GROUP BY YEAR(p.Creatio...
sede
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate tim...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE NOT admissions.dischtime IS NULL AND STRFTIME('%y', admissions.dischtime) = '2103'
mimic_iii
CREATE TABLE table_10975034_5 ( college VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What college did Craig Zimmer go to?
SELECT college FROM table_10975034_5 WHERE player = "Craig Zimmer"
sql_create_context
CREATE TABLE table_train_31 ( "id" int, "allergy_to_insulin" bool, "active_infection" bool, "periodic_paralysis" bool, "receiving_continuous_intravenous_inotropic_support" bool, "age" float, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided above...
SELECT * FROM table_train_31 WHERE allergy_to_insulin = 1
criteria2sql
CREATE TABLE table_67601 ( "Rank" real, "Lane" real, "Name" text, "Nationality" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of the rank for the name of Chen Yan in a lane less than 2?
SELECT COUNT("Rank") FROM table_67601 WHERE "Name" = 'chen yan' AND "Lane" < '2'
wikisql
CREATE TABLE table_name_74 ( service VARCHAR, network VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which service does the network of atn urdu offer?
SELECT service FROM table_name_74 WHERE network = "atn urdu"
sql_create_context
CREATE TABLE table_43371 ( "Season" text, "Competition" text, "Round" text, "Opponent" text, "Series" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Competition for Season 2002 03, and the Opponent was zenit st. petersburg?
SELECT "Competition" FROM table_43371 WHERE "Season" = '2002–03' AND "Opponent" = 'zenit st. petersburg'
wikisql
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT MIN(t1.c1) FROM (SELECT COUNT(DISTINCT diagnosis.patientunitstayid) AS c1 FROM diagnosis WHERE diagnosis.diagnosisname = 'lower urinary tract infection - likely bacterial' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2104' GROUP BY STRFTIME('%y-%m', diagnosis.diagnosistime)) AS t1
eicu
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND prescriptions.formulary_drug_cd = "ESMOBASE"
mimicsql_data
CREATE TABLE table_name_15 ( report VARCHAR, set_1 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What shows for Report hen there is a set 1 of 19 25?
SELECT report FROM table_name_15 WHERE set_1 = "19–25"
sql_create_context
CREATE TABLE table_train_133 ( "id" int, "vascular" bool, "interferon_alpha" bool, "pulmonary_disease" bool, "mini_mental_state_examination_mmse" int, "cardiac" bool, "neuropsychological_testing" bool, "clinical_dementia_rating_scale" float, "rituximab" bool, "hematologic_disease...
SELECT * FROM table_train_133 WHERE glucocorticoids = 1 OR interferon_alpha = 1 OR anti_cd20_antibody = 1 OR rituximab = 1 OR anti_ctla_4_antibody = 1 OR ipilimumab = 1
criteria2sql
CREATE TABLE table_36216 ( "Series Ep." text, "Episode" real, "Netflix" text, "Segment A" text, "Segment B" text, "Segment C" text, "Segment D" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which series episode has a netflix figure of s04e2...
SELECT "Series Ep." FROM table_36216 WHERE "Netflix" = 's04e21'
wikisql
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, las...
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 = 30044)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.lab...
mimic_iii
CREATE TABLE table_name_93 ( pick VARCHAR, round VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the pick number for the compensation-a round, for player Frank Catalanotto?
SELECT pick FROM table_name_93 WHERE round = "compensation-a" AND player = "frank catalanotto"
sql_create_context
CREATE TABLE table_name_64 ( player_name VARCHAR, position VARCHAR, college VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was a linebacker at Tennessee?
SELECT player_name FROM table_name_64 WHERE position = "linebacker" AND college = "tennessee"
sql_create_context
CREATE TABLE table_4302 ( "Year" real, "GDP at constant prices (THB trillions)" text, "GDP at constant prices growth rate (percent change)" text, "GDP at current prices (USD billions)" text, "Export volume of goods and services (percent change)" text, "Current account balance (percent of GDP)" t...
SELECT "Current account balance (percent of GDP)" FROM table_4302 WHERE "Export volume of goods and services (percent change)" = '-4.2'
wikisql
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE labevents ( row_id number, subje...
SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 83182 AND admissions.dischtime IS NULL)
mimic_iii
CREATE TABLE table_59151 ( "Round" real, "Player" text, "Nationality" text, "NHL team" text, "College/Junior/Club Team (League)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE NHL TEAM OF FINLAND?
SELECT "NHL team" FROM table_59151 WHERE "Nationality" = 'finland'
wikisql
CREATE TABLE table_1354805_6 ( couple VARCHAR, number_of_dances VARCHAR, competition_finish VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who danced 11 and finished at more than a 2.0
SELECT couple FROM table_1354805_6 WHERE number_of_dances = 11 AND competition_finish > 2.0
sql_create_context
CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
SELECT COUNT(*) > 0 FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 280 AND instructor.name LIKE '%Jiarui Fei%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_inst...
advising
CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments ...
SELECT DISTINCT COURSEalias0.department, COURSEalias0.name, COURSEalias0.number, SEMESTERalias0.semester FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, program_course AS PROGRAM_COURSEalias0...
advising
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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CELO-VESSICLE FISTULA" AND demographic.age < "83"
mimicsql_data
CREATE TABLE table_202_114 ( id number, "make/model" text, "series" text, "model" text, "year" number, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which buses are the newest in the current fleet ?
SELECT "series" FROM table_202_114 ORDER BY "year" DESC LIMIT 1
squall
CREATE TABLE table_203_180 ( id number, "#" number, "weekend end date" text, "film" text, "weekend gross (millions)" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the last film of the year ?
SELECT "film" FROM table_203_180 ORDER BY "weekend end date" DESC LIMIT 1
squall
CREATE TABLE table_name_67 ( pregame_host VARCHAR, color_commentator_s_ VARCHAR, play_by_play VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the pregame host when the Play-by-play was by JP Dellacamera, earlier than ...
SELECT pregame_host FROM table_name_67 WHERE play_by_play = "jp dellacamera" AND year < 2009 AND color_commentator_s_ = "ty keough"
sql_create_context
CREATE TABLE table_67133 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "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 Coates (0 2)?
SELECT "Score" FROM table_67133 WHERE "Loss" = 'coates (0–2)'
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "ASIAN" AND procedures.long_title = "Colonoscopy"
mimicsql_data
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
SELECT MAX(demographic.age) FROM demographic WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND demographic.discharge_location = "HOME HEALTH CARE"
mimicsql_data
CREATE TABLE table_204_535 ( id number, "pos" text, "rider" text, "manufacturer" text, "laps" number, "time/retired" text, "grid" number, "points" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is next after joan o.
SELECT "rider" FROM table_204_535 WHERE "pos" = (SELECT "pos" FROM table_204_535 WHERE "rider" = 'joan olive') + 1
squall
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_icd_diagnoses ( row_id number...
SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5364 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND prescriptions.drug = 'vancomycin hcl' ORDER BY prescriptions.startdate DESC LIMIT...
mimic_iii
CREATE TABLE table_72783 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Ground" text, "Crowd" real, "Date" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number of groun...
SELECT COUNT("Ground") FROM table_72783 WHERE "Home team" = 'Essendon'
wikisql
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, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
SELECT DATE(CreationDate), SUM(CASE WHEN PostTypeId = 1 THEN 1 ELSE 0 END) AS Questions, SUM(CASE WHEN PostTypeId = 2 THEN 1 ELSE 0 END) AS Answers FROM Posts WHERE CAST(TIME_TO_STR(CreationDate, '%Y-%m-%d %H:%M:%S') AS TEXT(10)) >= '2019-09-27' GROUP BY DATE(CreationDate) ORDER BY DATE(CreationDate) DESC
sede
CREATE TABLE table_72075 ( "Player" text, "No." text, "Nationality" text, "Position" text, "Years in Toronto" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the total number of positions on the Toronto team in 2...
SELECT COUNT("Position") FROM table_72075 WHERE "Years in Toronto" = '2006-07'
wikisql
CREATE TABLE zzmzjzjlb ( 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...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jyb...
css
CREATE TABLE table_2668352_16 ( district VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many districts have John C. Calhoun as the incumbent?
SELECT COUNT(district) FROM table_2668352_16 WHERE incumbent = "John C. Calhoun"
sql_create_context
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 MED_AMOUT FROM t_kc21 WHERE MED_CLINIC_ID = '17535786353'
css
CREATE TABLE table_30657 ( "Couple" text, "Style" text, "Music" text, "Trine Dehli Cleve" real, "Tor Fl\u00f8ysvik" real, "Karianne Gulliksen" real, "Christer Tornell" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is ...
SELECT MIN("Tor Fl\u00f8ysvik") FROM table_30657 WHERE "Karianne Gulliksen" = '6'
wikisql
CREATE TABLE table_2144389_9 ( vocalist VARCHAR, rōmaji VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When pok mon ieru kana? bw is the romaji who is the vocalist?
SELECT vocalist FROM table_2144389_9 WHERE rōmaji = "Pokémon ieru kana? BW"
sql_create_context