instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "HYPERTENSION;RULE OUT CORONARY ARTERY DISEASE\CARDIAC CATH" AND procedures.icd9_code = "7761"
mimicsql_data
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 COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-56556')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.ce...
eicu
CREATE TABLE shop ( shop_id number, shop_name text, location text, open_date text, open_year number ) CREATE TABLE device ( device_id number, device text, carrier text, package_version text, applications text, software_platform text ) CREATE TABLE stock ( shop_id number...
SELECT shop_name, location FROM shop ORDER BY shop_name
spider
CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departure_flight_number int, stop_time int ) CREATE TABLE dual_carrier...
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 AS DAYS_0, days AS DAYS_1, flight WHERE (((DAYS_1.day_name = 'THURSDAY' AND flight.arrival_time <= 1200 AND flight.flight_days = DAYS_1.days_code) AND date_day...
atis
CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city v...
SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id
advising
CREATE TABLE table_52025 ( "Stadium" text, "Capacity" real, "City" text, "Club" text, "Opening" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average opening at Stadyum Samsun with a capacity smaller than 34,658?
SELECT AVG("Opening") FROM table_52025 WHERE "Stadium" = 'stadyum samsun' AND "Capacity" < '34,658'
wikisql
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(2...
SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
nvbench
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 SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-96048')) AND intakeoutput.celllabel = '1/2ns...
eicu
CREATE TABLE table_50331 ( "Year ended" text, "Revenue (\u00a3million)" real, "Profit/(loss) before tax (\u00a3m)" real, "Net profit (\u00a3m)" real, "Earnings per share (p)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total net profi...
SELECT SUM("Net profit (\u00a3m)") FROM table_50331 WHERE "Earnings per share (p)" = '27.4' AND "Profit/(loss) before tax (\u00a3m)" < '194.6'
wikisql
CREATE TABLE table_name_37 ( bodyweight INTEGER, total__kg_ VARCHAR, clean_ VARCHAR, _jerk VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest Bodyweight associated with a Clean & jerk larger than 120, and a Total (kg) of 245?
SELECT MAX(bodyweight) FROM table_name_37 WHERE clean_ & _jerk > 120 AND total__kg_ = 245
sql_create_context
CREATE TABLE table_name_10 ( week INTEGER, game_site VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the earliest week that the Texans played at the Cleveland Browns Stadium?
SELECT MIN(week) FROM table_name_10 WHERE game_site = "cleveland browns stadium"
sql_create_context
CREATE TABLE table_name_8 ( fa_trophy INTEGER, club VARCHAR, play_offs VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which of the lowest FA Trophys involved the Forest Green Rovers club when the play-offs number was bigger than 0?
SELECT MIN(fa_trophy) FROM table_name_8 WHERE club = "forest green rovers" AND play_offs > 0
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 COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.careunit = 'tsicu' AND STRFTIME('%y', transfers.intime) = '2103')
mimic_iii
CREATE TABLE seasons ( year INTEGER, url TEXT ) CREATE TABLE driverStandings ( driverStandingsId INTEGER, raceId INTEGER, driverId INTEGER, points REAL, position INTEGER, positionText TEXT, wins INTEGER ) CREATE TABLE constructorStandings ( constructorStandingsId INTEGER, r...
SELECT name, COUNT(name) FROM constructors AS T1 JOIN constructorStandings AS T2 ON T1.constructorId = T2.constructorId WHERE T1.nationality = "Japanese" AND T2.points > 5 GROUP BY name
nvbench
CREATE TABLE table_24575253_4 ( division_three VARCHAR, division_two VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When westcott 1935 is in division two how many leagues are in division three?
SELECT COUNT(division_three) FROM table_24575253_4 WHERE division_two = "Westcott 1935"
sql_create_context
CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE swimme...
SELECT name, ID FROM swimmer ORDER BY name
nvbench
CREATE TABLE table_12170 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Partner Aurelija Misevi i t had an outcome of runner-up in wh...
SELECT "Tournament" FROM table_12170 WHERE "Outcome" = 'runner-up' AND "Partner" = 'aurelija misevičiūtė'
wikisql
CREATE TABLE table_name_11 ( crowd INTEGER, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the attendance when VFL played MCG?
SELECT MAX(crowd) FROM table_name_11 WHERE venue = "mcg"
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TAB...
SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-38992') AND patient.unitdischargetime IS NULL) AND intak...
eicu
CREATE TABLE table_name_58 ( city VARCHAR, country VARCHAR, airport VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the city in India with an airport named Sardar Vallabhbhai Patel International Airport?
SELECT city FROM table_name_58 WHERE country = "india" AND airport = "sardar vallabhbhai patel international airport"
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 job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE...
SELECT EMAIL, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY DEPARTMENT_ID
nvbench
CREATE TABLE table_50097 ( "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 nationality is Kentucky and the player Tayshaun Prince?
SELECT "Nationality" FROM table_50097 WHERE "School/Club Team" = 'kentucky' AND "Player" = 'tayshaun prince'
wikisql
CREATE TABLE table_name_50 ( grid INTEGER, time_retired VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the highest grid for a time/retired of +19.1 secs?
SELECT MAX(grid) FROM table_name_50 WHERE time_retired = "+19.1 secs"
sql_create_context
CREATE TABLE staff ( staff_id number, staff_address_id number, nickname text, first_name text, middle_name text, last_name text, date_of_birth time, date_joined_staff time, date_left_staff time ) CREATE TABLE vehicles ( vehicle_id number, vehicle_details text ) CREATE TABLE...
SELECT COUNT(*) FROM lessons AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = "Rylan" AND T2.last_name = "Goodwin" AND T1.lesson_status_code = "Completed"
spider
CREATE TABLE table_204_832 ( id number, "name" text, "nationality" text, "club" text, "from" number, "until" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- marc dos santos started as coach the same year as what other coach ?
SELECT "name" FROM table_204_832 WHERE "name" <> 'marc dos santos' AND "from" = (SELECT "from" FROM table_204_832 WHERE "name" = 'marc dos santos')
squall
CREATE TABLE table_20014 ( "Position" real, "Team" text, "Points" real, "Played" real, "Won" real, "Drawn" real, "Lost" real, "For" real, "Against" real, "Difference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the most l...
SELECT MIN("Lost") FROM table_20014 WHERE "Team" = 'Corinthians'
wikisql
CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar ) CREATE TABLE class_of_service ( booking_class varchar, rank i...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SALT LAKE CITY' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = ...
atis
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 COUNT(*) FROM mzjzjlb WHERE mzjzjlb.YLJGDM = '8275886' AND mzjzjlb.JZKSRQ BETWEEN '2009-07-25' AND '2017-03-26' AND mzjzjlb.ZSEBZ > 0
css
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
SELECT (SELECT vitalperiodic.sao2 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-18575') AND patient.unitdischargetime IS NULL) AND...
eicu
CREATE TABLE products ( product_id number, product_name text, product_price number, product_description text ) CREATE TABLE customer_addresses ( customer_id number, address_id number, date_from time, address_type text, date_to time ) CREATE TABLE order_deliveries ( location_cod...
SELECT customer_name FROM customers ORDER BY date_became_customer LIMIT 5
spider
CREATE TABLE table_80371 ( "2002/ 03" text, "2004/ 05" text, "2006/ 07" text, "2007/ 08" text, "2008/ 09" text, "2009/ 10" text, "2010/ 11" text, "2011/ 12" text, "2012/ 13" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the 200...
SELECT "2008/ 09" FROM table_80371 WHERE "2004/ 05" = 'ranking tournaments'
wikisql
CREATE TABLE field ( fieldid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE...
SELECT DISTINCT COUNT(1) FROM paper WHERE year = 1986
scholar
CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight in...
SELECT DISTINCT flight_stop.flight_id, flight_stop.stop_number 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 AS FLIGHT_0, flight AS FLIGHT_1, flight_leg, flight_stop WHERE ((FLIGHT_1.flight_nu...
atis
CREATE TABLE table_49385 ( "Missouri vs." text, "Overall Record" text, "at Columbia" text, "at Opponent's Venue" text, "at Neutral Site" text, "Last 5 Meetings" text, "Last 10 Meetings" text, "Current Streak" text ) -- Using valid SQLite, answer the following questions for the tables p...
SELECT "Last 10 Meetings" FROM table_49385 WHERE "at Opponent's Venue" = 'mu, 11-7'
wikisql
CREATE TABLE table_name_65 ( set_5 VARCHAR, date VARCHAR, set_4 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the set 5 if the Date is jun 7, and a Set 4 is 21-25?
SELECT set_5 FROM table_name_65 WHERE date = "jun 7" AND set_4 = "21-25"
sql_create_context
CREATE TABLE table_1893276_2 ( finish VARCHAR, eliminated VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When jim is eliminated what is the finish?
SELECT finish FROM table_1893276_2 WHERE eliminated = "Jim"
sql_create_context
CREATE TABLE table_203_223 ( id number, "name" text, "gauge" text, "builder" text, "type" text, "date" number, "works number" number, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- based on the table , which locomotive was built ...
SELECT "name" FROM table_203_223 ORDER BY "date" LIMIT 1
squall
CREATE TABLE table_name_9 ( catalog VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Catalog with a Date that is march 13, 2002?
SELECT catalog FROM table_name_9 WHERE date = "march 13, 2002"
sql_create_context
CREATE TABLE table_38720 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the average week of a game with a result of l 10-7 attended by 37,500?
SELECT AVG("Week") FROM table_38720 WHERE "Result" = 'l 10-7' AND "Attendance" < '37,500'
wikisql
CREATE TABLE table_25247 ( "Year" text, "Date" text, "Driver" text, "Team" text, "Manufacturer" text, "Laps" real, "Miles (km)" text, "Race Time" text, "Average Speed (mph)" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided abov...
SELECT COUNT("Year") FROM table_25247 WHERE "Team" = 'Joe Gibbs Racing' AND "Manufacturer" = 'Pontiac'
wikisql
CREATE TABLE Students ( student_id INTEGER, date_of_registration DATETIME, date_of_latest_logon DATETIME, login_name VARCHAR(40), password VARCHAR(10), personal_name VARCHAR(40), middle_name VARCHAR(40), family_name VARCHAR(40) ) CREATE TABLE Courses ( course_id INTEGER, author_...
SELECT date_test_taken, COUNT(date_test_taken) FROM Student_Tests_Taken WHERE test_result = "Pass" ORDER BY COUNT(date_test_taken) DESC
nvbench
CREATE TABLE semester ( semester_id int, semester varchar, year int ) 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...
SELECT DISTINCT advisory_requirement, enforced_requirement, name FROM course WHERE department = 'EECS' AND number = 182
advising
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_DIRE_CD text, MED_DIRE_NM text,...
SELECT t_kc22.PRESCRIPTION_CODE, t_kc22.PRESCRIPTION_ID FROM t_kc22 WHERE t_kc22.MED_EXP_DET_ID = '46663891790'
css
CREATE TABLE mzb ( 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 SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.MED_SER_ORG_NO = '3252243' AND qtb.MED_ORG_DEPT_NM = '小儿头颈肿瘤科' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.MED_SER_ORG_NO = '3252243' AND gyb.MED_ORG_DEPT_NM = '小儿头颈肿瘤科' UNION SELECT zyb.MED_CLINIC_...
css
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
SELECT demographic.dischtime FROM demographic WHERE demographic.subject_id = "65759"
mimicsql_data
CREATE TABLE table_17325580_6 ( game VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many games occur on the date December 12?
SELECT COUNT(game) FROM table_17325580_6 WHERE date = "December 12"
sql_create_context
CREATE TABLE table_2772 ( "Episode" text, "Location" text, "Headliner" text, "Comedians" text, "Airdate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who were the comedians on episode 1x03?
SELECT "Comedians" FROM table_2772 WHERE "Episode" = '1x03'
wikisql
CREATE TABLE table_19161046_1 ( bus_width___bit__ VARCHAR, core___mhz__ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the bus width (in bit) of the model whose core is 650 MHz?
SELECT COUNT(bus_width___bit__) FROM table_19161046_1 WHERE core___mhz__ = 650
sql_create_context
CREATE TABLE table_204_350 ( id number, "date" text, "opponents" text, "venue" text, "result" text, "scorers" text, "attendance" number, "report 1" text, "report 2" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the result o...
SELECT "result" FROM table_204_350 WHERE "date" < (SELECT "date" FROM table_204_350 WHERE "date" = '09-mar-68') ORDER BY "date" DESC LIMIT 1
squall
CREATE TABLE table_28688313_1 ( written_by VARCHAR, us_viewers__in_millions_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who wrote the episode with 7.52 million US viewers?
SELECT written_by FROM table_28688313_1 WHERE us_viewers__in_millions_ = "7.52"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2162" AND procedures.short_title = "Int insert dual-cham dev"
mimicsql_data
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, SUM(Revenue) FROM Manufacturers GROUP BY Name ORDER BY SUM(Revenue)
nvbench
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.admityear < "2200"
mimicsql_data
CREATE TABLE table_44644 ( "Election" real, "Number of PNC votes" text, "Share of votes" text, "Seats" text, "Outcome of election" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many seats did the election before 2004 with 3.4% share of votes ha...
SELECT "Seats" FROM table_44644 WHERE "Election" < '2004' AND "Share of votes" = '3.4%'
wikisql
CREATE TABLE table_test_8 ( "id" int, "anemia" bool, "intra_aortic_balloon_pump_iabp" bool, "systolic_blood_pressure_sbp" int, "intravenous_pressors" bool, "fever" bool, "hemoglobin_a1c_hba1c" float, "heart_disease" bool, "vasopressors" bool, "renal_disease" bool, "temperatur...
SELECT * FROM table_test_8 WHERE creatinine_clearance_cl < 30 OR hemoglobin_a1c_hba1c < 10 OR platelet_count < 150000
criteria2sql
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE microbiologyevents ( ro...
SELECT COUNT(*) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 72198) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND outputevents.itemid IN (SELEC...
mimic_iii
CREATE TABLE table_204_832 ( id number, "name" text, "nationality" text, "club" text, "from" number, "until" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how long did colin clarke coach the puerto rico islanders ?
SELECT "until" - "from" FROM table_204_832 WHERE "name" = 'colin clarke' AND "club" = 'puerto rico islanders'
squall
CREATE TABLE table_13972 ( "Draw" real, "Artist" text, "Song" text, "Result" text, "Place" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the draw having the result of 10%?
SELECT AVG("Draw") FROM table_13972 WHERE "Result" = '10%'
wikisql
CREATE TABLE table_name_49 ( to_par VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the to par score in the match that had a score of 76-71-78-67=292?
SELECT COUNT(to_par) FROM table_name_49 WHERE score = 76 - 71 - 78 - 67 = 292
sql_create_context
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 WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND demographic.dob_year < "2107"
mimicsql_data
CREATE TABLE table_1601027_1 ( headphone_class VARCHAR, us_msrp VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many headphone classes have a US MSRP of $150?
SELECT COUNT(headphone_class) FROM table_1601027_1 WHERE us_msrp = "$150"
sql_create_context
CREATE TABLE table_name_24 ( result VARCHAR, field VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the result of the game at Bishop Kearney Field on August 2?
SELECT result FROM table_name_24 WHERE field = "bishop kearney field" AND date = "august 2"
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 regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), ...
SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(SALARY) DESC
nvbench
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 procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "68" AND procedures.icd9_code = "8321"
mimicsql_data
CREATE TABLE table_5542 ( "Tournament" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which 2011's tournament was Indian Wells?
SELECT "2011" FROM table_5542 WHERE "Tournament" = 'indian wells'
wikisql
CREATE TABLE table_204_755 ( id number, "week" number, "date" text, "opponent" text, "result" text, "attendance" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many wins were before their win on october 26 ?
SELECT COUNT(*) FROM table_204_755 WHERE "result" = 'w' AND "date" < (SELECT "date" FROM table_204_755 WHERE "date" = 'october 26, 1978')
squall
CREATE TABLE table_62086 ( "Device" text, "Carrier" text, "Package Version" text, "Applications" text, "Software Platform" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE PACKAGE VERSION FOR blackberry storm 9530, APPLICATION 5.0.0.419, A...
SELECT "Package Version" FROM table_62086 WHERE "Device" = 'blackberry storm 9530' AND "Applications" = '5.0.0.419' AND "Carrier" = 'mts mobility'
wikisql
CREATE TABLE table_8524 ( "Player" text, "Position" text, "Premier League" real, "FA Cup" real, "League Cup" real, "UEFA Cup" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest FA Cup when the league cup is 1, an...
SELECT MIN("FA Cup") FROM table_8524 WHERE "League Cup" = '1' AND "Total" > '23'
wikisql
CREATE TABLE table_55040 ( "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. -- On what Date did the Away team essendon play?
SELECT "Date" FROM table_55040 WHERE "Away team" = 'essendon'
wikisql
CREATE TABLE table_41318 ( "Medal" text, "Name" text, "Sport" text, "Event" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Sport with a Name that is gustav larsson?
SELECT "Sport" FROM table_41318 WHERE "Name" = 'gustav larsson'
wikisql
CREATE TABLE table_name_52 ( position VARCHAR, player VARCHAR, province___club VARCHAR, date_of_birth__age_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Position, when Province / Club is Example, when Date of Birth (Age) is Example, and whe...
SELECT position FROM table_name_52 WHERE province___club = "example" AND date_of_birth__age_ = "example" AND player = "michael elumeze"
sql_create_context
CREATE TABLE table_78637 ( "Nat." text, "Name" text, "Since" real, "App(GS/Sub)" text, "Goals" real, "Ends" real, "Transfer fee" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the transfer fee is 8.5m, what is the total ends?
SELECT SUM("Ends") FROM table_78637 WHERE "Transfer fee" = '£8.5m'
wikisql
CREATE TABLE table_name_86 ( home_team VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the home team that played against Manchester United?
SELECT home_team FROM table_name_86 WHERE away_team = "manchester united"
sql_create_context
CREATE TABLE list ( lastname VARCHAR, classroom VARCHAR, grade VARCHAR ) CREATE TABLE teachers ( classroom VARCHAR, lastname VARCHAR, firstname VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the last names of the students in third grade...
SELECT DISTINCT T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.grade = 3 AND T2.firstname <> "COVIN" AND T2.lastname <> "JEROME"
sql_create_context
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 class_of_service ( booking_class varchar, rank int, class_description text ) CREATE ...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'MEMPHIS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SEATTL...
atis
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, Owne...
SELECT p.Id AS "post_link", p.Score, LENGTH(p.Title) FROM Posts AS p WHERE p.Title LIKE '%' + NCHAR(128505) + '%' COLLATE Latin1_General_BIN
sede
CREATE TABLE table_51296 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the pick number of the DB?
SELECT COUNT("Pick #") FROM table_51296 WHERE "Position" = 'db'
wikisql
CREATE TABLE table_44237 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Attendance" real, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the record on march 26?
SELECT "Record" FROM table_44237 WHERE "Date" = 'march 26'
wikisql
CREATE TABLE table_name_79 ( december INTEGER, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is average December when game is 30?
SELECT AVG(december) FROM table_name_79 WHERE game = 30
sql_create_context
CREATE TABLE table_name_32 ( ship_types_delivered VARCHAR, yard_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What types of ships were made at the Froemming Brothers ship yard?
SELECT ship_types_delivered FROM table_name_32 WHERE yard_name = "froemming brothers"
sql_create_context
CREATE TABLE table_75408 ( "Game" real, "March" real, "Opponent" text, "Score" text, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many games have a March of 19, and Points smaller than 83?
SELECT COUNT("Game") FROM table_75408 WHERE "March" = '19' AND "Points" < '83'
wikisql
CREATE TABLE restaurant_type ( restypeid number, restypename text, restypedescription text ) CREATE TABLE type_of_restaurant ( resid number, restypeid number ) CREATE TABLE restaurant ( resid number, resname text, address text, rating number ) CREATE TABLE visits_restaurant ( ...
SELECT fname, lname FROM student WHERE major = 600
spider
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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 t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "30" AND lab.label = "Heparin, LMW"
mimicsql_data
CREATE TABLE table_train_32 ( "id" int, "pregnancy_or_lactation" bool, "renal_disease" bool, "hemachromatosis" bool, "glucose_6_phosphate_dehydrogenase_deficiency_g6pd" int, "prisoners" bool, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided abov...
SELECT * FROM table_train_32 WHERE renal_disease = 1
criteria2sql
CREATE TABLE table_10645 ( "Tournament" text, "Winner" text, "Runner-up" text, "Score" text, "Third Place" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the third place for anders j rryd
SELECT "Third Place" FROM table_10645 WHERE "Runner-up" = 'anders järryd'
wikisql
CREATE TABLE subjects ( subject_id number, subject_name text ) CREATE TABLE course_authors_and_tutors ( author_id number, author_tutor_atb text, login_name text, password text, personal_name text, middle_name text, family_name text, gender_mf text, address_line_1 text ) CRE...
SELECT date_test_taken FROM student_tests_taken WHERE test_result = "Pass"
spider
CREATE TABLE table_34543 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is runner-up where the winning score is 6 (65-70-70-69=274) and the margin o...
SELECT "Runner(s)-up" FROM table_34543 WHERE "Margin of victory" = '3 strokes' AND "Winning score" = '–6 (65-70-70-69=274)'
wikisql
CREATE TABLE table_name_32 ( country VARCHAR, density__per_km²_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which country has a density (per km ) of 6,814?
SELECT country FROM table_name_32 WHERE density__per_km²_ = "6,814"
sql_create_context
CREATE TABLE table_name_78 ( title VARCHAR, director VARCHAR, production_number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the title with chuck jones as the director and the production number 9537?
SELECT title FROM table_name_78 WHERE director = "chuck jones" AND production_number = "9537"
sql_create_context
CREATE TABLE table_16083989_1 ( species VARCHAR, voges_proskauer VARCHAR, indole VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which species show a negative result with both voges-proskauer and indole?
SELECT species FROM table_16083989_1 WHERE voges_proskauer = "Negative" AND indole = "Negative"
sql_create_context
CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text...
SELECT mzjzjlb.SG, mzjzjlb.TZ FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '23887920'
css
CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE city ( city_code varchar, ...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (((flight.arrival_time <= 1230 AND flight.arrival_time >= 1130) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHINGTON' AND CITY_1...
atis
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restr...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'NEWA...
atis
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.person_info_XM = '水慧颖' AND hz_info.YLJGDM = '1586101' AND mzjzjlb.JZKSMC LIKE '%急诊%'
css
CREATE TABLE table_name_87 ( opponent VARCHAR, week VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent the falcons played against on week 3?
SELECT opponent FROM table_name_87 WHERE week = 3
sql_create_context
CREATE TABLE table_29186 ( "Rank" real, "Rider" text, "Sat 21 Aug" text, "Mon 23 Aug" text, "Tues 24 Aug" text, "Wed 25 Aug" text, "Thurs 26 Aug" text, "Fri 27 Aug" text, "Sat 29 Aug" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Wh...
SELECT "Thurs 26 Aug" FROM table_29186 WHERE "Wed 25 Aug" = '19'' 59.98 113.192mph'
wikisql
CREATE TABLE table_10587 ( "Year" real, "Award" text, "Category" text, "Nominee" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which category was Michael Stewart a nominee in?
SELECT "Category" FROM table_10587 WHERE "Nominee" = 'michael stewart'
wikisql
CREATE TABLE table_34750 ( "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. -- What college did the player selected in rounds over 3 play for?
SELECT "College/junior/club team (League)" FROM table_34750 WHERE "Round" > '3'
wikisql
CREATE TABLE table_name_97 ( new_entries_this_round VARCHAR, number_of_fixtures VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were the new entries for the Semi-Finals round with fewer than 8 fixtures?
SELECT new_entries_this_round FROM table_name_97 WHERE number_of_fixtures < 8 AND round = "semi-finals"
sql_create_context
CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER ) CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is average age of male...
SELECT job, AVG(age) FROM Person WHERE gender = 'male' GROUP BY job ORDER BY AVG(age)
nvbench