instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_203_537 ( id number, "#" number, "date" text, "venue" text, "opponent" text, "score" text, "result" text, "competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what venue is listed above wembley stadium , london...
SELECT "venue" FROM table_203_537 WHERE id = (SELECT id FROM table_203_537 WHERE "venue" = 'wembley stadium, london') - 1
squall
CREATE TABLE table_name_19 ( country VARCHAR, language VARCHAR, director VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country is the film directed by Jean-Luc Godard in French from?
SELECT country FROM table_name_19 WHERE language = "french" AND director = "jean-luc godard"
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetake...
SELECT patient.age FROM patient WHERE patient.uniquepid = '015-8398' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1
eicu
CREATE TABLE table_1840495_2 ( median_house__hold_income VARCHAR, place VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For upper Arlington, what was the median household income?
SELECT median_house__hold_income FROM table_1840495_2 WHERE place = "Upper Arlington"
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND lab.itemid = "51379"
mimicsql_data
CREATE TABLE table_204_929 ( id number, "location" text, "name of mill and\ngrid reference" text, "type" text, "maps" text, "first mention\nor built" text, "last mention\nor demise" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many m...
SELECT COUNT(*) FROM table_204_929 WHERE "first mention\nor built" < 1700
squall
CREATE TABLE table_name_51 ( runs VARCHAR, average VARCHAR, innings VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of runs when the average was less than 31.25 and there were fewer than 24 innings?
SELECT COUNT(runs) FROM table_name_51 WHERE average > 31.25 AND innings < 24
sql_create_context
CREATE TABLE table_name_10 ( geographic_character VARCHAR, barangay VARCHAR, population__2007_ VARCHAR, population__2010_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE TYPE OF LAND WITH A 2007 POPULATION SMALLER THAN 4346, 2010 POPULATIO...
SELECT geographic_character FROM table_name_10 WHERE population__2007_ < 4346 AND population__2010_ > 3385 AND barangay = "manalongon"
sql_create_context
CREATE TABLE table_20728138_1 ( seats_won VARCHAR, seats_contested VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many seats were won, when the seats contested was 48?
SELECT seats_won FROM table_20728138_1 WHERE seats_contested = 48
sql_create_context
CREATE TABLE table_42004 ( "Office" text, "Republican ticket" text, "Democratic ticket" text, "Liberal ticket" text, "Conservative ticket" text, "Socialist Workers ticket" text, "Socialist Labor ticket" text ) -- Using valid SQLite, answer the following questions for the tables provided ab...
SELECT "Socialist Labor ticket" FROM table_42004 WHERE "Democratic ticket" = 'robert m. morgenthau'
wikisql
CREATE TABLE table_76771 ( "Name" text, "Gain" real, "Loss" real, "Long" real, "Avg/G" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Avg/G has a Name of josh freeman, and a Loss smaller than 134?
SELECT SUM("Avg/G") FROM table_76771 WHERE "Name" = 'josh freeman' AND "Loss" < '134'
wikisql
CREATE TABLE Customers ( customer_id INTEGER, customer_type_code VARCHAR(20), address_line_1 VARCHAR(80), address_line_2 VARCHAR(80), town_city VARCHAR(80), state VARCHAR(80), email_address VARCHAR(255), phone_number VARCHAR(80) ) CREATE TABLE Staff ( staff_id INTEGER, gender VA...
SELECT product_name, COUNT(*) FROM Products AS t1 JOIN Complaints AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_name ORDER BY product_name
nvbench
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_labitems ( row_id number, itemid number, label text ) CREATE TABLE transfers ( row_id number, subject_id number, had...
SELECT chartevents.charttime 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 = 18866)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart ra...
mimic_iii
CREATE TABLE table_name_16 ( laps INTEGER, time VARCHAR, grid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the average Laps that has the Time of +17.485, and the Grid smaller than 7?
SELECT AVG(laps) FROM table_name_16 WHERE time = "+17.485" AND grid < 7
sql_create_context
CREATE TABLE table_67472 ( "Branding" text, "Callsign" text, "Frequency" text, "Power (kW)" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the callsign of Cagayan de Oro with 5kW?
SELECT "Callsign" FROM table_67472 WHERE "Power (kW)" = '5kw' AND "Location" = 'cagayan de oro'
wikisql
CREATE TABLE table_name_45 ( opponent VARCHAR, outcome VARCHAR, partner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In the match played with partner Andres Molteni, with the outcome of winner, who was the opponent?
SELECT opponent FROM table_name_45 WHERE outcome = "winner" AND partner = "andres molteni"
sql_create_context
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
SELECT SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '76143414' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2010-08-24' AND '2019-03-19' AND t_kc22.MED_INV_ITEM_TYPE = '西药费'
css
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 MIN(demographic.age) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.diagnosis = "MORBID OBESITY/SDA"
mimicsql_data
CREATE TABLE table_name_96 ( laps INTEGER, driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Driver Ricardo Sperafico has what as his average laps?
SELECT AVG(laps) FROM table_name_96 WHERE driver = "ricardo sperafico"
sql_create_context
CREATE TABLE table_7972 ( "Aircraft" text, "Type" text, "Version" text, "Produced" text, "Quantity" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where was the Kai Kuh-1 Surion Produced?
SELECT "Produced" FROM table_7972 WHERE "Aircraft" = 'kai kuh-1 surion'
wikisql
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) 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...
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 = 7742) AND NOT icustays.outtime IS NU...
mimic_iii
CREATE TABLE Student_Course_Enrolment ( registration_id INTEGER, student_id INTEGER, course_id INTEGER, date_of_enrolment DATETIME, date_of_completion DATETIME ) CREATE TABLE Subjects ( subject_id INTEGER, subject_name VARCHAR(120) ) CREATE TABLE Students ( student_id INTEGER, date...
SELECT date_of_latest_logon, COUNT(date_of_latest_logon) FROM Students WHERE family_name = "Jaskolski" OR family_name = "Langosh"
nvbench
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE Comments ( Id number, PostId number, Score number,...
SELECT Id AS "comment_link", Text, UserId AS "user_link", CreationDate FROM Comments WHERE Text LIKE '%##Word##%' AND CreationDate >= '##Date1##' AND CreationDate <= '##Date2##' ORDER BY CreationDate
sede
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dod_year <= "2168.0" AND diagnoses.long_title = "Hyperosmolality and/or hypernatremia"
mimicsql_data
CREATE TABLE certificate ( eid number(9,0), aid number(9,0) ) CREATE TABLE employee ( eid number(9,0), name varchar2(30), salary number(10,2) ) CREATE TABLE aircraft ( aid number(9,0), name varchar2(30), distance number(6,0) ) CREATE TABLE flight ( flno number(4,0), origin var...
SELECT destination, COUNT(destination) FROM flight WHERE price > 300 GROUP BY destination ORDER BY COUNT(destination) DESC
nvbench
CREATE TABLE Research_Outcomes ( outcome_code VARCHAR(10), outcome_description VARCHAR(255) ) CREATE TABLE Documents ( document_id INTEGER, document_type_code VARCHAR(10), grant_id INTEGER, sent_date DATETIME, response_received_date DATETIME, other_details VARCHAR(255) ) CREATE TABLE R...
SELECT date_from, COUNT(date_from) FROM Project_Staff ORDER BY date_from DESC
nvbench
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE ta ( campus_job_id int, ...
SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Mineralogy , Petrology , or Geochemistry%' OR name LIKE '%Mineralogy , Petrology , or Geochemistry%') AND credits = 6
advising
CREATE TABLE table_name_42 ( grid VARCHAR, constructor VARCHAR, laps VARCHAR, time_retired VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the grid number with less than 52 laps and a Time/Retired of collision, and a Constructor of arrows - su...
SELECT COUNT(grid) FROM table_name_42 WHERE laps < 52 AND time_retired = "collision" AND constructor = "arrows - supertec"
sql_create_context
CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE time_zone ( time_zone_code t...
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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVE...
atis
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 WHERE demographic.marital_status = "SINGLE" AND demographic.diagnosis = "HYPOXIA"
mimicsql_data
CREATE TABLE table_3085 ( "Name" text, "Position" text, "Period" text, "Appearances\u00b9" real, "Goals\u00b9" real, "Nationality\u00b2" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which position did pierre bajoc play?
SELECT "Position" FROM table_3085 WHERE "Name" = 'Pierre Bajoc'
wikisql
CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE field ( fieldid int ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE ...
SELECT DISTINCT paper.journalid FROM author, paper, writes WHERE author.authorname = 'Donald E Knuth' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid GROUP BY paper.journalid
scholar
CREATE TABLE documents ( document_type_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What document types have more than 2 corresponding documents?
SELECT document_type_code FROM documents GROUP BY document_type_code HAVING COUNT(*) > 2
sql_create_context
CREATE TABLE txmzjzjlb ( 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.YQBH, jyjgzbb.YQMC FROM hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON 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 AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH ...
css
CREATE TABLE entrepreneur ( Entrepreneur_ID int, People_ID int, Company text, Money_Requested real, Investor text ) CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Date_of_Birth text ) -- Using valid SQLite, answer the following questions for the tabl...
SELECT Investor, COUNT(Investor) FROM entrepreneur GROUP BY Investor ORDER BY COUNT(Investor)
nvbench
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city var...
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 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 NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 4528.81)
css
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE lab ( labid number, patientuni...
SELECT diagnosis.diagnosistime FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-25367')) AND diagnosis.diagnosisname = 'alcohol withdrawal' O...
eicu
CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_...
SELECT DISTINCT flight.flight_id FROM aircraft, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, equipment_sequence, flight WHERE (aircraft.basic_type = '747' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND equipment_se...
atis
CREATE TABLE table_name_31 ( week INTEGER, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the earliest week when the New Orleans Saints were the opponents?
SELECT MIN(week) FROM table_name_31 WHERE opponent = "new orleans saints"
sql_create_context
CREATE TABLE table_22180353_1 ( registration VARCHAR, type VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is every registration for the type of T 6 G?
SELECT registration FROM table_22180353_1 WHERE type = "T 6 G"
sql_create_context
CREATE TABLE has_amenity ( dormid number, amenid number ) CREATE TABLE dorm_amenity ( amenid number, amenity_name text ) CREATE TABLE lives_in ( stuid number, dormid number, room_number number ) CREATE TABLE student ( stuid number, lname text, fname text, age number, s...
SELECT COUNT(*) FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.dorm_name = 'Smith Hall' AND T1.sex = 'F'
spider
CREATE TABLE table_65332 ( "Vessel" text, "Origin" text, "Type" text, "In service" real, "Unit" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest listed In service for a vessel of xavery czernicki class?
SELECT MIN("In service") FROM table_65332 WHERE "Vessel" = 'xavery czernicki class'
wikisql
CREATE TABLE table_name_42 ( player VARCHAR, height VARCHAR, year_born VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What player was born in 1976 and is smaller than 2.03?
SELECT player FROM table_name_42 WHERE height < 2.03 AND year_born = 1976
sql_create_context
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,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 locations ( LOCAT...
SELECT JOB_ID, AVG(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID DESC
nvbench
CREATE TABLE table_train_247 ( "id" int, "mini_mental_state_examination_mmse" int, "creatinine_consistently" float, "creatinine_clearance_cl" float, "seizure_disorder" bool, "age" float, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided above. -...
SELECT * FROM table_train_247 WHERE mini_mental_state_examination_mmse < 24
criteria2sql
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 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 = '016-27397')) AND intakeoutput.cellpath LIKE '%intake%' AND D...
eicu
CREATE TABLE table_1920 ( "Township" text, "County" text, "Pop. (2010)" real, "Land ( sqmi )" text, "Water (sqmi)" text, "Latitude" text, "Longitude" text, "GEO ID" real, "ANSI code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If ...
SELECT "Land ( sqmi )" FROM table_1920 WHERE "Water (sqmi)" = '1.701'
wikisql
CREATE TABLE ship ( Ship_ID int, Name text, Type text, Nationality text, Tonnage int ) CREATE TABLE mission ( Mission_ID int, Ship_ID int, Code text, Launched_Year int, Location text, Speed_knots int, Fate text ) -- Using valid SQLite, answer the following questions fo...
SELECT Type, COUNT(Type) FROM ship GROUP BY Type ORDER BY Type
nvbench
CREATE TABLE table_name_35 ( laps INTEGER, driver VARCHAR, grid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the least laps for driver gerhard berger with a grid more than 6?
SELECT MIN(laps) FROM table_name_35 WHERE driver = "gerhard berger" AND grid > 6
sql_create_context
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE cost ( costid num...
SELECT allergy.allergyname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-25705')) AND DATETIME(allergy.allergytime, 'start of month') = DATETI...
eicu
CREATE TABLE table_10095 ( "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. -- When the Away team scored 20.15 (135) on the Dat...
SELECT "Crowd" FROM table_10095 WHERE "Date" = '23 april 1973' AND "Away team score" = '20.15 (135)'
wikisql
CREATE TABLE hosting_city ( year number, match_id number, host_city text ) CREATE TABLE match ( match_id number, date text, venue text, score text, result text, competition text ) CREATE TABLE city ( city_id number, city text, hanzi text, hanyu_pinyin text, regi...
SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id ORDER BY T2.feb DESC LIMIT 1
spider
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 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-15775...
eicu
CREATE TABLE table_46173 ( "Date" text, "Opponent" text, "Score" text, "Result" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Score has a Date of may 4?
SELECT "Score" FROM table_46173 WHERE "Date" = 'may 4'
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "URGENT" AND prescriptions.route = "TD"
mimicsql_data
CREATE TABLE table_name_67 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the 1851 when 1881 had 764?
SELECT 1851 FROM table_name_67 WHERE 1881 = "764"
sql_create_context
CREATE TABLE table_1341930_5 ( result VARCHAR, first_elected VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the result for first elected in 1944
SELECT result FROM table_1341930_5 WHERE first_elected = 1944
sql_create_context
CREATE TABLE film ( film_id number, title text, studio text, director text, gross_in_dollar number ) CREATE TABLE film_market_estimation ( estimation_id number, low_estimate number, high_estimate number, film_id number, type text, market_id number, year number ) CREATE ...
SELECT low_estimate, high_estimate FROM film_market_estimation
spider
CREATE TABLE table_61872 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text ) -- Using valid SQLite, answer the following questions f...
SELECT "Try bonus" FROM table_61872 WHERE "Losing bonus" = '1' AND "Points for" = '179'
wikisql
CREATE TABLE table_name_1 ( away_team VARCHAR, crowd INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What did the away team score in the game with a crowd size larger than 22,000?
SELECT away_team AS score FROM table_name_1 WHERE crowd > 22 OFFSET 000
sql_create_context
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE flight_stop ( flight_id int, stop_number int, ...
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 = 'PHOENIX' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LAS VE...
atis
CREATE TABLE table_name_36 ( country VARCHAR, moving_to VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country is the player moving to Hamburger SV from?
SELECT country FROM table_name_36 WHERE moving_to = "hamburger sv"
sql_create_context
CREATE TABLE section ( course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0), building varchar(15), room_number varchar(7), time_slot_id varchar(4) ) CREATE TABLE instructor ( ID varchar(5), name varchar(20), dept_name varchar(20), salary numeric(8,...
SELECT dept_name, MIN(salary) FROM instructor GROUP BY dept_name ORDER BY MIN(salary)
nvbench
CREATE TABLE table_12451376_3 ( title VARCHAR, season_3_ep__number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the title of season 3 ep# 12?
SELECT title FROM table_12451376_3 WHERE season_3_ep__number = 12
sql_create_context
CREATE TABLE table_22749 ( "Character" text, "Original Broadway performer" text, "Original Australian performer" text, "Original West End performer" text, "2005 World AIDS Day Benefit Dream Cast" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How ma...
SELECT COUNT("Original Australian performer") FROM table_22749 WHERE "Original West End performer" = 'Jordan Dunne'
wikisql
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 jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM ...
css
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,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 departments ( DEPARTMENT_ID decimal...
SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY AVG(SALARY)
nvbench
CREATE TABLE review ( rid int, business_id varchar, user_id varchar, rating float, text longtext, year int, month varchar ) CREATE TABLE business ( bid int, business_id varchar, name varchar, full_address varchar, city varchar, latitude varchar, longitude varchar...
SELECT business.name FROM business, category, review, user WHERE category.business_id = business.business_id AND category.category_name = 'Bars' AND review.business_id = business.business_id AND user.name = 'Patrick' AND user.user_id = review.user_id
yelp
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requi...
SELECT COUNT(*) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'IOE' AND course.number = 801 AND semester.semester = 'WN' AND semester.semester_id = course_offering.semester AND semester.year = 2016
advising
CREATE TABLE table_name_54 ( webcast VARCHAR, website VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The KTRH.com website includes which type of webcast?
SELECT webcast FROM table_name_54 WHERE website = "ktrh.com"
sql_create_context
CREATE TABLE table_name_1 ( away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the away team's score of the game where the away team is Geelong?
SELECT away_team AS score FROM table_name_1 WHERE away_team = "geelong"
sql_create_context
CREATE TABLE table_18309 ( "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 other cadidate ran against Dave Treen?
SELECT "Candidates" FROM table_18309 WHERE "Incumbent" = 'Dave Treen'
wikisql
CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE days ( d...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((((flight.departure_time <= 2359 AND flight.departure_time >= 1800) AND date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year...
atis
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT u.Id AS "user_link", CAST(DATEDIFF(day, u.CreationDate, CURRENT_TIMESTAMP()) AS VARCHAR) + ' Days' AS "member_for", u.Reputation AS "rep", u.Reputation - you.Reputation AS "rep_more_than_yours", (u.Reputation / DATEDIFF(day, u.CreationDate, CURRENT_TIMESTAMP())) AS "avg_rep_per_day" FROM Users AS u, Users AS you...
sede
CREATE TABLE table_55993 ( "Pick" real, "Player" text, "Team" text, "Position" text, "School" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest pick when the School is Stanford University?
SELECT MIN("Pick") FROM table_55993 WHERE "School" = 'stanford university'
wikisql
CREATE TABLE table_67501 ( "Season" real, "Cars Entered" real, "Winning Driver" text, "Second Driver" text, "Third Driver" text, "Race Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Winning Driver has a Second Driver of jimmy bryan...
SELECT "Winning Driver" FROM table_67501 WHERE "Second Driver" = 'jimmy bryan'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, ...
SELECT mzjzjlb.JZZTDM, mzjzjlb.JZZTMC FROM mzjzjlb WHERE mzjzjlb.JZLSH = '48598074227'
css
CREATE TABLE table_18296 ( "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 are the candidates in the district whose incumbent is Gus Yatron?
SELECT "Candidates" FROM table_18296 WHERE "Incumbent" = 'Gus Yatron'
wikisql
CREATE TABLE table_12962773_10 ( position VARCHAR, height VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position was played by the player who was 2.12 meters tall?
SELECT position FROM table_12962773_10 WHERE height = "2.12"
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time )...
SELECT AVG(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 = '016-27397' AND patient.hospitaldischargetime IS ...
eicu
CREATE TABLE program ( program_id number, name text, origin text, launch number, owner text ) CREATE TABLE broadcast ( channel_id number, program_id number, time_of_day text ) CREATE TABLE broadcast_share ( channel_id number, program_id number, date text, share_in_perce...
SELECT name FROM channel WHERE owner = 'CCTV' OR owner = 'HBS'
spider
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, Vote...
SELECT DISTINCT PostId AS "post_link", Comment, UserId AS "user_link", CreationDate, url = 'site://posts/' + CAST(PostId AS TEXT) + '/revisions' FROM PostHistory WHERE Comment LIKE '%##keyword##%' AND UserId = '##id##' ORDER BY CreationDate
sede
CREATE TABLE table_name_62 ( wins INTEGER, byes VARCHAR, golden_rivers VARCHAR, against VARCHAR, losses VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the total number of wins that had an against greater than 1136 but losses less than 15...
SELECT SUM(wins) FROM table_name_62 WHERE against > 1136 AND losses < 15 AND golden_rivers = "ultima" AND byes < 2
sql_create_context
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 demographic.days_stay FROM demographic WHERE demographic.name = "Robert Clayton"
mimicsql_data
CREATE TABLE wdmzjzjlb ( 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 * FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jy...
css
CREATE TABLE zyb ( 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 qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_NM = '昌和志' AND NOT qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 7632.77) UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_NM = '昌和志' AND NOT gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT...
css
CREATE TABLE table_name_55 ( date VARCHAR, type VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date was the individual time trial?
SELECT date FROM table_name_55 WHERE type = "individual time trial"
sql_create_context
CREATE TABLE table_1926 ( "Township" text, "County" text, "Pop. (2010)" real, "Land ( sqmi )" text, "Water (sqmi)" text, "Latitude" text, "Longitude" text, "GEO ID" real, "ANSI code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Wha...
SELECT "Township" FROM table_1926 WHERE "Longitude" = '-99.287270'
wikisql
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '王清妍' AND t_kc22.STA_DATE BETWEEN '2016-05-27' AND '2019-08-14' AND t_kc22.SELF_PAY_PRO < 0.69
css
CREATE TABLE table_43325 ( "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. -- How many wins were in the PGA Championship when there were more ...
SELECT COUNT("Wins") FROM table_43325 WHERE "Tournament" = 'pga championship' AND "Events" > '10'
wikisql
CREATE TABLE table_32384 ( "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 is the score for Fitzroy when they are the ...
SELECT "Home team score" FROM table_32384 WHERE "Home team" = 'fitzroy'
wikisql
CREATE TABLE table_1563 ( "No. in series" text, "No. in season" text, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided ab...
SELECT "Written by" FROM table_1563 WHERE "U.S. viewers (millions)" = '7.56'
wikisql
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE T...
SELECT OwnerDisplayName, SUM(LENGTH(Body)) AS QA_Weight FROM Posts WHERE OwnerUserId IS NULL AND PostTypeId >= 1 AND PostTypeId <= 2 GROUP BY OwnerDisplayName ORDER BY SUM(LENGTH(Body)) DESC
sede
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.dob_year < "2197" AND procedures.icd9_code = "3142"
mimicsql_data
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "56" AND prescriptions.route = "PO/NG"
mimicsql_data
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2097" AND lab.label = "Reticulocyte Count, Manual"
mimicsql_data
CREATE TABLE table_50784 ( "Tournament" text, "1990" text, "1991" text, "1992" text, "1993" text, "1994" text, "1995" text, "1996" text, "1997" text, "1998" text, "1999" text, "2000" text, "2001" text, "2002" text, "2003" text, "2004" text, "2005" text...
SELECT "Tournament" FROM table_50784 WHERE "1990" = 'olympic games'
wikisql
CREATE TABLE table_18610 ( "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 is the candidate for south carolina 3?
SELECT "Candidates" FROM table_18610 WHERE "District" = 'South Carolina 3'
wikisql
CREATE TABLE Detention ( detention_id INTEGER, detention_type_code VARCHAR(10), teacher_id INTEGER, datetime_detention_start DATETIME, datetime_detention_end DATETIME, detention_summary VARCHAR(255), other_details VARCHAR(255) ) CREATE TABLE Ref_Address_Types ( address_type_code VARCHAR...
SELECT date_address_from, COUNT(date_address_from) FROM Student_Addresses ORDER BY monthly_rental DESC
nvbench