instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
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 patient ( uniquep...
SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '002-72731' AND patient.hospitaladmitsource = 'floor' AND DATETIME(patient.hospitaladmittime) <= DATETIME(CURRENT_TIME(), '-2 year') ORDER BY patient.hospitaladmittime LIMIT 1
eicu
CREATE TABLE table_21564794_3 ( left_st_louis INTEGER, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year did the team who played at the Scottrade Center leave the city?
SELECT MIN(left_st_louis) FROM table_21564794_3 WHERE venue = "Scottrade Center"
sql_create_context
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT Team_ID, School_ID FROM basketball_match GROUP BY All_Neutral
nvbench
CREATE TABLE table_name_93 ( date VARCHAR, versus VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date had a versus of source: cricinfo.com?
SELECT date FROM table_name_93 WHERE versus = "source: cricinfo.com"
sql_create_context
CREATE TABLE table_name_17 ( date VARCHAR, visitor VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the date of the game when the Calgary Flames were the visiting team and there was a record of 1 2 0?
SELECT date FROM table_name_17 WHERE visitor = "calgary flames" AND record = "1–2–0"
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.age, procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE table_11622255_1 ( location VARCHAR, tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the location where tournament is raley's senior gold rush
SELECT location FROM table_11622255_1 WHERE tournament = "Raley's Senior Gold Rush"
sql_create_context
CREATE TABLE table_69896 ( "Rank" real, "Player" text, "County" text, "Tally" text, "Total" real, "Opposition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In Limerick County, what is the Rank with a Total larger than 12 and Tipperary as the O...
SELECT AVG("Rank") FROM table_69896 WHERE "Opposition" = 'tipperary' AND "County" = 'limerick' AND "Total" > '12'
wikisql
CREATE TABLE happy_hour_member ( hh_id number, member_id number, total_amount number ) CREATE TABLE shop ( shop_id number, address text, num_of_staff text, score number, open_year text ) CREATE TABLE happy_hour ( hh_id number, shop_id number, month text, num_of_shaff_in...
SELECT address FROM member EXCEPT SELECT address FROM member WHERE membership_card = 'Black'
spider
CREATE TABLE table_name_7 ( place VARCHAR, athlete VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What place has manfred kokot as the athlete?
SELECT place FROM table_name_7 WHERE athlete = "manfred kokot"
sql_create_context
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 prescriptions ( subject_id text, hadm_id...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "85" AND diagnoses.long_title = "Neurogenic bladder NOS"
mimicsql_data
CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId numb...
SELECT * FROM Users WHERE Id = (SELECT MAX(Id) FROM Users)
sede
CREATE TABLE checking ( custid VARCHAR, balance VARCHAR ) CREATE TABLE accounts ( custid VARCHAR ) CREATE TABLE savings ( balance VARCHAR, custid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the saving balance of the account with the hig...
SELECT T3.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid ORDER BY T2.balance DESC LIMIT 1
sql_create_context
CREATE TABLE department ( department_id number, name text, creation text, ranking number, budget_in_billions number, num_employees number ) CREATE TABLE management ( department_id number, head_id number, temporary_acting text ) CREATE TABLE head ( head_id number, name text,...
SELECT creation, name, budget_in_billions FROM department
spider
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.marital_status = "SINGLE" AND diagnoses.long_title = "Depressive disorder, not elsewhere classified"
mimicsql_data
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.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND 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_MZ...
css
CREATE TABLE table_name_7 ( score VARCHAR, tie_no VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the game score when the tie no is 7?
SELECT score FROM table_name_7 WHERE tie_no = "7"
sql_create_context
CREATE TABLE mzjzjlb_jybgb ( YLJGDM_MZJZJLB text, BGDH number, YLJGDM number ) 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, BGRG...
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH = jybgb....
css
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 course_offering ( offering_id int, course_id int, semester int, section_number int, star...
SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Classical Studies Honors Seminar%' OR name LIKE '%Classical Studies Honors Seminar%') AND department = 'EECS'
advising
CREATE TABLE table_75100 ( "Date" text, "Tournament" text, "Location" text, "Winner" text, "Score" text, "1st prize ( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date of the Greater Greensboro Chrysler Classic?
SELECT "Date" FROM table_75100 WHERE "Tournament" = 'greater greensboro chrysler classic'
wikisql
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_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_icd_procedures ( row_id number, icd9...
SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26793) AND prescriptions.drug = 'zofran' AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-147 month') ORDER BY prescriptions.startdate DESC LIMIT 1
mimic_iii
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Residual foreign body in soft tissue" AND lab."CATEGORY" = "Blood Gas"
mimicsql_data
CREATE TABLE table_name_75 ( player VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who scored 69-71=140?
SELECT player FROM table_name_75 WHERE score = 69 - 71 = 140
sql_create_context
CREATE TABLE table_name_4 ( decision VARCHAR, visitor VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Decision has a Visitor of vancouver, and a Score of 5 4?
SELECT decision FROM table_name_4 WHERE visitor = "vancouver" AND score = "5 – 4"
sql_create_context
CREATE TABLE table_name_37 ( against INTEGER, drawn VARCHAR, played VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the average Against has Drawn of 2, and a Played larger than 10?
SELECT AVG(against) FROM table_name_37 WHERE drawn = 2 AND played > 10
sql_create_context
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 COUNT(*) FROM mzjzjlb WHERE mzjzjlb.YLJGDM = '7278386' AND mzjzjlb.JZKSRQ BETWEEN '2007-11-18' AND '2010-08-03' AND mzjzjlb.WDBZ > 0
css
CREATE TABLE table_26304 ( "Vehicle code" text, "Bore (mm)" text, "Stroke (mm)" text, "Capacity (cm 3 )" real, "Compression ratio" text, "Torque (N m)" real, "Power (HP)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the stroke wher...
SELECT "Stroke (mm)" FROM table_26304 WHERE "Vehicle code" = 'T211'
wikisql
CREATE TABLE table_8388 ( "Publication" text, "Country" text, "Accolade" text, "Year" real, "Rank" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country did Day & Age rank number 1 in Q prior to 2011?
SELECT "Country" FROM table_8388 WHERE "Year" < '2011' AND "Rank" > '1' AND "Publication" = 'q'
wikisql
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId nu...
SELECT a.Id AS "post_link" FROM Posts AS a WHERE a.PostTypeId = 2 AND a.Body LIKE '%##TextToSearch##%' AND LENGTH(a.Body) < '##Length##' AND Score <= 0
sede
CREATE TABLE table_43722 ( "Position" real, "Club" text, "Played" real, "Points" real, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real ) -- Using valid SQLite, answer the following questions for the tables provided above....
SELECT AVG("Losses") FROM table_43722 WHERE "Goals against" > '17' AND "Goal Difference" < '2' AND "Points" > '5'
wikisql
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.JZZDBM, mzjzjlb.JZZDSM 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 = '48404711'
css
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, va...
SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'irritable bowel syndrome')) AND DATETIME(cost.chargetime) <= DA...
mimic_iii
CREATE TABLE table_name_4 ( prr_class VARCHAR, build_date VARCHAR, wheel_arrangement VARCHAR, service VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the PRR class of the freight train built in 1967 with a b-b wheel arrangement?
SELECT prr_class FROM table_name_4 WHERE wheel_arrangement = "b-b" AND service = "freight" AND build_date = "1967"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Medicare" AND demographic.admityear < "2166"
mimicsql_data
CREATE TABLE table_name_65 ( time_retired VARCHAR, driver VARCHAR, laps VARCHAR, grid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the time of retirement with Laps smaller than 66, a grid less than 10, and a Driver of heinz-harald frentzen?...
SELECT time_retired FROM table_name_65 WHERE laps < 66 AND grid < 10 AND driver = "heinz-harald frentzen"
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 d_icd_procedures ( row_id number, icd9_code text, s...
SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_di...
mimic_iii
CREATE TABLE table_name_4 ( spanish_voice_actor VARCHAR, french_voice_actor VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Spanish voice actor does the same character as French voice actor V ronique Desmadryl?
SELECT spanish_voice_actor FROM table_name_4 WHERE french_voice_actor = "véronique desmadryl"
sql_create_context
CREATE TABLE table_name_68 ( founded INTEGER, enrollment VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Founded, when Enrollment is 4,000?
SELECT AVG(founded) FROM table_name_68 WHERE enrollment = 4 OFFSET 000
sql_create_context
CREATE TABLE contacts ( contact_id number, customer_id number, gender text, first_name text, last_name text, contact_phone text ) CREATE TABLE addresses ( address_id number, line_1_number_building text, city text, zip_postcode text, state_province_county text, country te...
SELECT T1.product_name, SUM(T2.order_quantity) FROM products AS T1 JOIN order_items AS T2 ON T1.product_id = T2.product_id GROUP BY T1.product_id
spider
CREATE TABLE Apartment_Facilities ( apt_id INTEGER, facility_code CHAR(15) ) CREATE TABLE Apartments ( apt_id INTEGER, building_id INTEGER, apt_type_code CHAR(15), apt_number CHAR(10), bathroom_count INTEGER, bedroom_count INTEGER, room_count CHAR(5) ) CREATE TABLE Apartment_Buildi...
SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.apt_type_code = "Duplex"
nvbench
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
SELECT jyjgzbb.JCFF FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH...
css
CREATE TABLE table_38456 ( "Poll source" text, "Dates administered" text, "Roy Barnes" text, "Thurbert Baker" text, "DuBose Porter" text, "David Poythress" text, "Undecided" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the DuBose P...
SELECT "DuBose Porter" FROM table_38456 WHERE "Roy Barnes" = '54%'
wikisql
CREATE TABLE plays_games ( stuid number, gameid number, hours_played number ) CREATE TABLE sportsinfo ( stuid number, sportname text, hoursperweek number, gamesplayed number, onscholarship text ) CREATE TABLE video_games ( gameid number, gname text, gtype text ) CREATE TAB...
SELECT COUNT(*) FROM video_games
spider
CREATE TABLE course ( course_id varchar(8), title varchar(50), dept_name varchar(20), credits numeric(2,0) ) CREATE TABLE classroom ( building varchar(15), room_number varchar(7), capacity numeric(4,0) ) CREATE TABLE takes ( ID varchar(5), course_id varchar(8), sec_id varchar(8...
SELECT dept_name, MIN(salary) FROM instructor GROUP BY dept_name ORDER BY dept_name
nvbench
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE airport ( airport_code varchar, airp...
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 = 'OAKLA...
atis
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE ta ( campus_job_id int, student_id int...
SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.friday = 'N' AND course_offering.monday = 'Y' AND course_offering.thursday = 'N' AND course_offering.tuesday = 'N' AND course_offering.wednesday = 'Y' AND course.course_id = course_offering.course_id AND course.department = 'EECS' AND cour...
advising
CREATE TABLE table_20377 ( "N\u00b0" real, "Television service" text, "Country" text, "Language" text, "Content" text, "DAR" text, "HDTV" text, "PPV" text, "Package/Option" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the hdtv...
SELECT "HDTV" FROM table_20377 WHERE "Package/Option" = 'Sky Famiglia' AND "DAR" = '16:9' AND "Television service" = 'myDeejay'
wikisql
CREATE TABLE table_name_78 ( opponent VARCHAR, week VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Opponent that has a Week larger than 3 on october 6, 1991?
SELECT opponent FROM table_name_78 WHERE week > 3 AND date = "october 6, 1991"
sql_create_context
CREATE TABLE table_name_83 ( rank INTEGER, total VARCHAR, silver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of the ranks with a total of 1 and silver less than 0.
SELECT SUM(rank) FROM table_name_83 WHERE total = 1 AND silver < 0
sql_create_context
CREATE TABLE table_18173916_6 ( tuesday VARCHAR, thursday VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Tuesday episode if theThursday episode was 196 Buried?
SELECT tuesday FROM table_18173916_6 WHERE thursday = "196 Buried"
sql_create_context
CREATE TABLE table_name_84 ( tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which 2008 has a 2002 of a, and a Tournament of australian open?
SELECT 2008 FROM table_name_84 WHERE 2002 = "a" AND tournament = "australian open"
sql_create_context
CREATE TABLE table_name_49 ( winner VARCHAR, stage VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the winner in stage 3?
SELECT winner FROM table_name_49 WHERE stage = "3"
sql_create_context
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 STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', patient.hospitaladmittime) FROM patient WHERE patient.uniquepid = '022-47102' AND NOT patient.hospitaladmittime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1
eicu
CREATE TABLE table_11755 ( "Block A" text, "Gran Hamada" text, "Koji Kanemoto" text, "Jushin Liger" text, "Masaaki Mochizuki" text, "Super Shocker" text, "Tatsuhito Takaiwa" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Gran Hamada ha...
SELECT "Gran Hamada" FROM table_11755 WHERE "Block A" = 'tatsuhito takaiwa'
wikisql
CREATE TABLE mzjybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH number, 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, ...
SELECT * FROM hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH WHERE hz_inf...
css
CREATE TABLE table_55861 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the most laps with the time/retired is differential and the grid is more than 2?
SELECT MAX("Laps") FROM table_55861 WHERE "Time/Retired" = 'differential' AND "Grid" > '2'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2155.0" AND procedures.icd9_code = "3806"
mimicsql_data
CREATE TABLE table_name_56 ( score VARCHAR, tie_no VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score when the Tie no was 9?
SELECT score FROM table_name_56 WHERE tie_no = "9"
sql_create_context
CREATE TABLE table_name_45 ( home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score when geelong was the away team?
SELECT home_team AS score FROM table_name_45 WHERE home_team = "geelong"
sql_create_context
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT Team_Name, School_ID FROM basketball_match ORDER BY Team_Name DESC
nvbench
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 (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.MED_SER_ORG_NO = '1534223' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2009-04-28' AND '2018-01-28' GROUP B...
css
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId n...
SELECT Id, DisplayName, Reputation FROM Users WHERE Users.Id NOT IN (SELECT DISTINCT UserId FROM Badges WHERE Name IN ('Copy Editor', 'Electorate', 'Famous Question', 'Fanatic', 'Great Answer', 'Great Question', 'Legendary', 'Marshal', 'Populist', 'Publicist', 'Reversal', 'Stellar Question', 'Steward', 'Unsung Hero') G...
sede
CREATE TABLE products ( product_id number, parent_product_id number, product_category_code text, date_product_first_available time, date_product_discontinued time, product_name text, product_description text, product_price number ) CREATE TABLE complaints ( complaint_id number, ...
SELECT t1.email_address FROM customers AS t1 JOIN complaints AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_id ORDER BY COUNT(*) LIMIT 1
spider
CREATE TABLE table_25288 ( "Constituency" text, "Winner" text, "Party" text, "Margin" real, "Runner-up a" text, "Party a" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the margin when k. balathandayutham is the winner?
SELECT MAX("Margin") FROM table_25288 WHERE "Winner" = 'K. Balathandayutham'
wikisql
CREATE TABLE savings ( custid VARCHAR, balance VARCHAR ) CREATE TABLE checking ( balance VARCHAR, custid VARCHAR ) CREATE TABLE accounts ( name VARCHAR, custid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the name and checking balanc...
SELECT T2.balance, T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid ORDER BY T3.balance LIMIT 1
sql_create_context
CREATE TABLE table_64904 ( "School" text, "City" text, "Team Name" text, "County" text, "Year Joined" text, "Year Left" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year did a team from North Dearborn leave?
SELECT "Year Left" FROM table_64904 WHERE "School" = 'north dearborn'
wikisql
CREATE TABLE table_45212 ( "English" text, "Pali" text, "Sanskrit" text, "Chinese" text, "Tibetan" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which English has a Sanskrit of sam dhi?
SELECT "English" FROM table_45212 WHERE "Sanskrit" = 'samādhi'
wikisql
CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE journal ( jou...
SELECT DISTINCT paper.paperid FROM author, paper, writes WHERE author.authorname = 'emina torlak' AND paper.year = 2010 AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
scholar
CREATE TABLE party_addresses ( party_id number, address_id number, date_address_from time, address_type_code text, date_address_to time ) CREATE TABLE organizations ( organization_id number, date_formed time, organization_name text, uk_vat_number text ) CREATE TABLE services ( ...
SELECT town_city FROM addresses UNION SELECT state_province_county FROM addresses
spider
CREATE TABLE Customers ( customer_id INTEGER, customer_first_name VARCHAR(20), customer_last_name VARCHAR(20), customer_address VARCHAR(255), customer_phone VARCHAR(255), customer_email VARCHAR(255), other_customer_details VARCHAR(255) ) CREATE TABLE Financial_Transactions ( transaction...
SELECT transaction_type, COUNT(*) FROM Financial_Transactions GROUP BY transaction_type
nvbench
CREATE TABLE table_53543 ( "D 50 \u221a" text, "D 49 \u221a" text, "D 48 \u221a" text, "D 47 \u221a" text, "D 46 \u221a" text, "D 45 \u221a" text, "D 44 \u221a" text, "D 43 \u221a" text, "D 42 \u221a" text, "D 41 \u221a" text ) -- Using valid SQLite, answer the following questi...
SELECT "D 44 \u221a" FROM table_53543 WHERE "D 47 \u221a" = 'r 7'
wikisql
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 demographic.age FROM demographic WHERE demographic.subject_id = "83678"
mimicsql_data
CREATE TABLE table_65683 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Record has an Event of inoki bom-ba-ye 2002?
SELECT "Record" FROM table_65683 WHERE "Event" = 'inoki bom-ba-ye 2002'
wikisql
CREATE TABLE table_28372291_1 ( female_saber VARCHAR, average_fencers_rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What female fenced with a saber on the team that had an average fencer rank of 3.5?
SELECT female_saber FROM table_28372291_1 WHERE average_fencers_rank = "3.5"
sql_create_context
CREATE TABLE table_1785117_1 ( broadcast_date VARCHAR, viewers__in_millions_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the broadcast date when 8.3 million viewers watched?
SELECT broadcast_date FROM table_1785117_1 WHERE viewers__in_millions_ = "8.3"
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Lactated Ringers"
mimicsql_data
CREATE TABLE table_38235 ( "Nation" text, "T Score" real, "A Score" real, "E Score" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the sum of the E scores when the total score was 19.466?
SELECT SUM("E Score") FROM table_38235 WHERE "Total" = '19.466'
wikisql
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 = "TRSF WITHIN THIS FACILITY" AND prescriptions.drug = "Ferrous Sulfate (Liquid)"
mimicsql_data
CREATE TABLE table_name_33 ( chemical_class VARCHAR, formula VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the chemical class for ri?
SELECT chemical_class FROM table_name_33 WHERE formula = "ri"
sql_create_context
CREATE TABLE table_60304 ( "Minister" text, "Party" text, "Governments" text, "Term start" text, "Term end" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Government the has the Kadima Party?
SELECT "Governments" FROM table_60304 WHERE "Party" = 'kadima'
wikisql
CREATE TABLE table_name_99 ( season VARCHAR, team_2 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the Season that has the Team 2 of hanoi acb?
SELECT season FROM table_name_99 WHERE team_2 = "hanoi acb"
sql_create_context
CREATE TABLE table_69690 ( "Language" text, "Number" text, "percentage (%)" text, "males" text, "females" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the percentage who speak Russian?
SELECT "percentage (%)" FROM table_69690 WHERE "Language" = 'russian'
wikisql
CREATE TABLE table_41003 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Score, when Tie No is 17?
SELECT "Score" FROM table_41003 WHERE "Tie no" = '17'
wikisql
CREATE TABLE table_52598 ( "Stage" text, "Winner" text, "General classification" text, "Points classification" text, "Trofeo Fast Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Points classification has a Trofeo Fast Team of metauro mobi...
SELECT "Points classification" FROM table_52598 WHERE "Trofeo Fast Team" = 'metauro mobili-pinarello' AND "Stage" = '6'
wikisql
CREATE TABLE table_23203 ( "Institution" text, "Location" text, "Nickname" text, "Founded" real, "Type" text, "Enrollment" real, "Joined" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the location for eagles
SELECT "Location" FROM table_23203 WHERE "Nickname" = 'Eagles'
wikisql
CREATE TABLE table_name_61 ( crew VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Crew, when Date is July 26, 1977?
SELECT crew FROM table_name_61 WHERE date = "july 26, 1977"
sql_create_context
CREATE TABLE table_39760 ( "Office" text, "Democratic ticket" text, "Republican ticket" text, "Law Preservation ticket" text, "Socialist ticket" text, "Socialist Labor ticket" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Office has a Dem...
SELECT "Office" FROM table_39760 WHERE "Democratic ticket" = 'herbert h. lehman'
wikisql
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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Hypoxemia" AND prescriptions.route = "IV"
mimicsql_data
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(25) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY ...
SELECT JOB_ID, AVG(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY AVG(SALARY) DESC
nvbench
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 COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '4451945' AND t_kc21.IN_HOSP_DATE BETWEEN '2019-07-05' AND '2021-01-11' AND t_kc21.SERVANT_FLG = '公务员'
css
CREATE TABLE table_22962745_35 ( bowler VARCHAR, batsmen VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many bowlers were there when david hussey azhar mahmood gurkeerat singh was the batsmen?
SELECT COUNT(bowler) FROM table_22962745_35 WHERE batsmen = "David Hussey Azhar Mahmood Gurkeerat Singh"
sql_create_context
CREATE TABLE Residents_Services ( resident_id INTEGER, service_id INTEGER, date_moved_in DATETIME, property_id INTEGER, date_requested DATETIME, date_provided DATETIME, other_details VARCHAR(255) ) CREATE TABLE Customer_Event_Notes ( Customer_Event_Note_ID INTEGER, Customer_Event_ID...
SELECT customer_details, COUNT(customer_details) FROM Customers GROUP BY customer_details ORDER BY customer_details DESC
nvbench
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellv...
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 = '009-424') AND NOT patient.unitdischargetime IS NULL ORDER BY...
eicu
CREATE TABLE table_name_60 ( russian VARCHAR, ratio VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Russian has a Ratio of 40?
SELECT russian FROM table_name_60 WHERE ratio = "40"
sql_create_context
CREATE TABLE table_name_4 ( record VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Record for the Team of Indiana?
SELECT record FROM table_name_4 WHERE team = "indiana"
sql_create_context
CREATE TABLE table_15824796_5 ( original_air_date VARCHAR, season__number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the original airdate when the season number is 4?
SELECT original_air_date FROM table_15824796_5 WHERE season__number = 4
sql_create_context
CREATE TABLE Assessment_Notes ( notes_id INTEGER, student_id INTEGER, teacher_id INTEGER, date_of_notes DATETIME, text_of_notes VARCHAR(255), other_details VARCHAR(255) ) CREATE TABLE Teachers ( teacher_id INTEGER, address_id INTEGER, first_name VARCHAR(80), middle_name VARCHAR(...
SELECT date_address_to, COUNT(date_address_to) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC
nvbench
CREATE TABLE table_name_2 ( date VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date of the game where Footscray was the away team?
SELECT date FROM table_name_2 WHERE away_team = "footscray"
sql_create_context
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, O...
SELECT COUNT(pl.PostId) AS "count", pl.RelatedPostId AS "post_link" FROM PostLinks AS pl INNER JOIN Posts AS q ON q.Id = pl.PostId WHERE (pl.LinkTypeId = 1) AND (q.PostTypeId = 1) GROUP BY pl.RelatedPostId ORDER BY COUNT(pl.PostId) DESC LIMIT 100
sede
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 prescriptions ( subject_id text, hadm_id...
SELECT demographic.admission_type, demographic.diagnosis FROM demographic WHERE demographic.name = "Jonathan Wiggins"
mimicsql_data