instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_12962773_12 ( height VARCHAR, no VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What height is player number 9?
SELECT height FROM table_12962773_12 WHERE no = 9
sql_create_context
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE labevents ( row_id number, ...
SELECT STRFTIME('%j', admissions.dischtime) - STRFTIME('%j', admissions.admittime) FROM admissions WHERE admissions.subject_id = 26195 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1
mimic_iii
CREATE TABLE table_name_25 ( song VARCHAR, rank VARCHAR, points VARCHAR, draw VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which song has more than 66 points, a draw greater than 3, and is ranked 3rd?
SELECT song FROM table_name_25 WHERE points > 66 AND draw > 3 AND rank = "3rd"
sql_create_context
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 57023) AND DATETIME(microbiologyevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') ORDER BY microbiologyevent...
mimic_iii
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 demographic.diagnosis, lab.fluid FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.subject_id = "18372"
mimicsql_data
CREATE TABLE table_name_74 ( round INTEGER, selection VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many rounds had a selection of 165?
SELECT SUM(round) FROM table_name_74 WHERE selection = 165
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, ...
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE STRFTIME('%y', labevents.charttime) <= '2102' GROUP BY labevents.itemid) AS t1 WHERE t1.c1 <= 4)
mimic_iii
CREATE TABLE flight_fare ( flight_id int, fare_id int ) 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 ) CREA...
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 ((date_day.day_number = 21 AND date_day.month_number = 2 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time...
atis
CREATE TABLE table_1473672_6 ( nationality VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country did Derek Black come from?
SELECT nationality FROM table_1473672_6 WHERE player = "Derek Black"
sql_create_context
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airli...
SELECT DISTINCT ground_service.transport_type FROM airport, airport_service, city AS CITY_0, city AS CITY_1, ground_service WHERE airport.airport_code = airport_service.airport_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = airport_service.city_code AND CITY_1.city_name = 'BOSTON' AND ground_service.airpor...
atis
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 regions ( REGION_...
SELECT T1.SALARY, T1.MANAGER_ID FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID WHERE T1.EMPLOYEE_ID = T2.MANAGER_ID
nvbench
CREATE TABLE table_40442 ( "Year" real, "Series" text, "Winning team" text, "Losing team" text, "Score" text, "Site" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where was the series that the Kansas City Royals lost?
SELECT "Site" FROM table_40442 WHERE "Winning team" = 'kansas city royals'
wikisql
CREATE TABLE table_name_78 ( rank INTEGER, grid VARCHAR, time_retired VARCHAR, laps VARCHAR, qual VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the rank of the car who had more than 182 laps, gris less than 3, with a qual time of more t...
SELECT MIN(rank) FROM table_name_78 WHERE laps > 182 AND qual > 134.14 AND time_retired = "+14:21.72" AND grid < 3
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 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Hx of bladder malignancy" AND prescriptions.drug_type = "ADDITIVE"
mimicsql_data
CREATE TABLE table_11792 ( "Name" text, "Appointed/Elected" text, "Term expires" text, "Appointing Governor" text, "Governor's Party Affiliation" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who has a term that expires on December 31, 2020 and Ter...
SELECT "Name" FROM table_11792 WHERE "Term expires" = 'december 31, 2020' AND "Appointing Governor" = 'terry branstad'
wikisql
CREATE TABLE dorm_amenity ( amenid number, amenity_name text ) CREATE TABLE has_amenity ( dormid number, amenid number ) CREATE TABLE dorm ( dormid number, dorm_name text, student_capacity number, gender text ) CREATE TABLE lives_in ( stuid number, dormid number, room_numb...
SELECT amenity_name FROM dorm_amenity ORDER BY amenity_name
spider
CREATE TABLE table_14118521_1 ( edo_flight VARCHAR, duration VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the edo flight with duration being 17 days, 15 hours, 53 minutes, 18 seconds
SELECT edo_flight FROM table_14118521_1 WHERE duration = "17 days, 15 hours, 53 minutes, 18 seconds"
sql_create_context
CREATE TABLE table_15058 ( "Pick" real, "Player" text, "Team" text, "Position" text, "School" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What school did Conor Jackson attend?
SELECT "School" FROM table_15058 WHERE "Player" = 'conor jackson'
wikisql
CREATE TABLE table_40203 ( "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. -- What was the time for the bout against Amanda Lavoy...
SELECT "Time" FROM table_40203 WHERE "Round" < '3' AND "Opponent" = 'amanda lavoy'
wikisql
CREATE TABLE table_20594 ( "Western Title" text, "Chinese Title" text, "Pinyin" text, "Released Date" text, "Genre" text, "Game Modes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the game modes for the game released in 2007?
SELECT "Game Modes" FROM table_20594 WHERE "Released Date" = '2007'
wikisql
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, Rejectio...
WITH ByUser AS (SELECT OwnerUserId, CAST(COUNT(AcceptedAnswerId) AS FLOAT) / CAST(COUNT(*) AS FLOAT) AS AcceptRate FROM Posts AS p WHERE p.PostTypeId = 1 AND CommunityOwnedDate IS NULL AND EXISTS(SELECT 1 FROM Posts WHERE ParentId = p.Id) GROUP BY OwnerUserId HAVING COUNT(*) >= 4), FirstStep AS (SELECT AcceptRate, ROW_...
sede
CREATE TABLE gyb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
SELECT 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 <= 7550.96) 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.AMOUN...
css
CREATE TABLE authorship ( authid number, instid number, paperid number, authorder number ) CREATE TABLE inst ( instid number, name text, country text ) CREATE TABLE papers ( paperid number, title text ) CREATE TABLE authors ( authid number, lname text, fname text ) -...
SELECT COUNT(DISTINCT t1.title) FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "University of Pennsylvania"
spider
CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
SELECT zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '08218858' AND NOT zyjzjlb.JZLSH IN (SELECT JZLSH FROM jybgb WHERE BGRQ <= '2020-10-17')
css
CREATE TABLE artist ( artist_name varchar2(50), country varchar2(20), gender varchar2(20), preferred_genre varchar2(50) ) CREATE TABLE song ( song_name varchar2(50), artist_name varchar2(50), country varchar2(20), f_id number(10), genre_is varchar2(20), rating number(10), la...
SELECT formats, COUNT(*) FROM files GROUP BY formats ORDER BY formats
nvbench
CREATE TABLE table_12441518_1 ( recurring_cast_seasons VARCHAR, character VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Kevin lucas appears in which seasons?
SELECT recurring_cast_seasons FROM table_12441518_1 WHERE character = "Kevin Lucas"
sql_create_context
CREATE TABLE table_8550 ( "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 fo...
SELECT "Club" FROM table_8550 WHERE "Drawn" = '0' AND "Points" = '26'
wikisql
CREATE TABLE table_10383 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the record for bobcats
SELECT "Record" FROM table_10383 WHERE "Home" = 'bobcats'
wikisql
CREATE TABLE table_38322 ( "Event" text, "Round" text, "Result" text, "Opponent" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The round that had the final, what was the result?
SELECT "Result" FROM table_38322 WHERE "Round" = 'final'
wikisql
CREATE TABLE table_71915 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the winning total from 1976?
SELECT MAX("Total") FROM table_71915 WHERE "Year(s) won" = '1976'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND prescriptions.drug_type = "BASE"
mimicsql_data
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayNa...
SELECT Id AS "user_link", Reputation, (10 * UpVotes) AS "10 * UpVotesCast", CAST(10 * UpVotes AS FLOAT) / Reputation AS ratio FROM Users WHERE Reputation > 1 ORDER BY ratio DESC LIMIT 200000000
sede
CREATE TABLE table_22049 ( "Team" text, "Average" text, "Points" real, "Played" real, "1988-89" text, "1989-90" text, "1990-1991" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the average if the game played during 1990-91 is 40 and...
SELECT "Average" FROM table_22049 WHERE "1990-1991" = '40' AND "Points" < '121.0'
wikisql
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE procedures_icd ( ...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', admissions.admittime)) FROM admissions WHERE admissions.subject_id = 27172 AND admissions.dischtime IS NULL
mimic_iii
CREATE TABLE table_28436909_4 ( canadian_chapters VARCHAR, founding_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 1872-10-10 is the founding date what are the canadian chapters?
SELECT canadian_chapters FROM table_28436909_4 WHERE founding_date = "1872-10-10"
sql_create_context
CREATE TABLE table_67466 ( "Stage" text, "Winner" text, "General classification" text, "Points Classification" text, "Team Classification" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the stgae with winner of robbie mcewen
SELECT "Stage" FROM table_67466 WHERE "Winner" = 'robbie mcewen'
wikisql
CREATE TABLE table_29570 ( "Game" real, "March" real, "Opponent" text, "Score" text, "Location/Attendance" text, "Record" text, "Points" real, "Decision" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many times did they play the pit...
SELECT COUNT("March") FROM table_29570 WHERE "Opponent" = 'Pittsburgh Penguins'
wikisql
CREATE TABLE table_36949 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Weeks are on september 8, 1980 and Attendances larger than 55,045? Question 4
SELECT COUNT("Week") FROM table_36949 WHERE "Date" = 'september 8, 1980' AND "Attendance" > '55,045'
wikisql
CREATE TABLE table_name_52 ( network VARCHAR, call_sign VARCHAR, virtual_channel VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Call sign of k33ln-ld, and a Virtual channel of 33.5 is what network?
SELECT network FROM table_name_52 WHERE call_sign = "k33ln-ld" AND virtual_channel = "33.5"
sql_create_context
CREATE TABLE table_name_62 ( round VARCHAR, player VARCHAR, pick VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of rounds that had draft pick 97, duncan mccoll?
SELECT COUNT(round) FROM table_name_62 WHERE player = "duncan mccoll" AND pick < 97
sql_create_context
CREATE TABLE table_11839306_2 ( track VARCHAR, rōmaji_title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many tracks are titled M Sukoshi T ku?
SELECT COUNT(track) FROM table_11839306_2 WHERE rōmaji_title = "Mō Sukoshi Tōku"
sql_create_context
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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "16" AND prescriptions.drug = "SW"
mimicsql_data
CREATE TABLE table_name_3 ( fleet_size INTEGER, type VARCHAR, introduced VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average fleet size for the Shunter type introduced in 1959?
SELECT AVG(fleet_size) FROM table_name_3 WHERE type = "shunter" AND introduced = "1959"
sql_create_context
CREATE TABLE table_17402 ( "Vendor and type" text, "Models" text, "NetFlow Version" text, "Implementation" text, "Comments" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many netflow version are there when the vendor and type is enterasys switc...
SELECT COUNT("NetFlow Version") FROM table_17402 WHERE "Vendor and type" = 'Enterasys Switches'
wikisql
CREATE TABLE table_16456 ( "Team" text, "Location" text, "Joined" real, "Conference" text, "Division" text, "Previous Conference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What conference was the churchill chargers team in?
SELECT "Conference" FROM table_16456 WHERE "Team" = 'Churchill Chargers'
wikisql
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT wdmzjzjlb.JZJSSJ FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '45655595406' UNION SELECT bdmzjzjlb.JZJSSJ FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '45655595406'
css
CREATE TABLE table_1220125_4 ( pennant VARCHAR, laid_down VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the pennant for 4 may 1943?
SELECT pennant FROM table_1220125_4 WHERE laid_down = "4 May 1943"
sql_create_context
CREATE TABLE table_27723228_12 ( score VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the score for indiana
SELECT score FROM table_27723228_12 WHERE team = "Indiana"
sql_create_context
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate tim...
SELECT Id AS "post_link", Title, Body, Tags FROM Posts WHERE Tags LIKE '%jira%' OR Title LIKE '%JIRA%'
sede
CREATE TABLE table_name_95 ( county VARCHAR, size VARCHAR, mascot VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which County has a Size larger than 258, and a Mascot of commodores?
SELECT county FROM table_name_95 WHERE size > 258 AND mascot = "commodores"
sql_create_context
CREATE TABLE table_name_93 ( record VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Record has an Opponent of milwaukee bucks?
SELECT record FROM table_name_93 WHERE opponent = "milwaukee bucks"
sql_create_context
CREATE TABLE table_204_13 ( id number, "finished" text, "post" number, "horse" text, "jockey" text, "trainer" text, "owner" text, "time / behind" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the name of the trainer of the first...
SELECT "trainer" FROM table_204_13 WHERE "finished" = 1
squall
CREATE TABLE table_name_15 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who attended the school in 2008, that Deandria Hill attended in 2005?
SELECT 2008 FROM table_name_15 WHERE 2005 = "deandria hill"
sql_create_context
CREATE TABLE table_13762472_4 ( high_rebounds VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who had high rebounds when score is w 111 92 (ot)
SELECT high_rebounds FROM table_13762472_4 WHERE score = "W 111–92 (OT)"
sql_create_context
CREATE TABLE table_name_92 ( played INTEGER, against VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Played is the highest one that has an Against smaller than 18, and Points smaller than 10?
SELECT MAX(played) FROM table_name_92 WHERE against < 18 AND points < 10
sql_create_context
CREATE TABLE table_58529 ( "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 was the away team when the venue was Lake O...
SELECT "Away team" FROM table_58529 WHERE "Venue" = 'lake oval'
wikisql
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT outputevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM outputevents WHERE DATETIME(outputevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY outputevents.itemid) AS...
mimic_iii
CREATE TABLE table_60771 ( "Date" text, "Nationality / Opponent" text, "Ground" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the Date has a Competition of welsh rugby union challenge trophy and a Result of 3...
SELECT "Date" FROM table_60771 WHERE "Competition" = 'welsh rugby union challenge trophy' AND "Result" = '34-34'
wikisql
CREATE TABLE Organizations ( organization_id INTEGER, parent_organization_id INTEGER, organization_details VARCHAR(255) ) CREATE TABLE Customer_Event_Notes ( Customer_Event_Note_ID INTEGER, Customer_Event_ID INTEGER, service_type_code CHAR(15), resident_id INTEGER, property_id INTEGER, ...
SELECT date_moved_in, COUNT(date_moved_in) FROM Residents ORDER BY COUNT(date_moved_in) DESC
nvbench
CREATE TABLE table_name_99 ( netflix VARCHAR, segment_b VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Segment B of aerospace fuel lines is what netflix episode?
SELECT netflix FROM table_name_99 WHERE segment_b = "aerospace fuel lines"
sql_create_context
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 gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '5664551' AND t_kc22.SOC_SRT_DIRE_NM = '叶酸片' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fgwyjzb.MED_SER_ORG_NO = '5664551' AND t_kc22.SOC_SRT_DIR...
css
CREATE TABLE table_46241 ( "School" text, "Location" text, "Founded" real, "Enrollment" real, "Nickname" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the most recent year founded that has a nickname of bruins?
SELECT MAX("Founded") FROM table_46241 WHERE "Nickname" = 'bruins'
wikisql
CREATE TABLE table_51760 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Event" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the year that the position was 1st in paris?
SELECT "Year" FROM table_51760 WHERE "Position" = '1st' AND "Venue" = 'paris'
wikisql
CREATE TABLE table_40842 ( "Western Title" text, "Chinese Title" text, "Pinyin" text, "Released Date" text, "Genre" text, "Game Modes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the release date for the Chinese title ?
SELECT "Released Date" FROM table_40842 WHERE "Chinese Title" = '摸摸瓦力欧制造'
wikisql
CREATE TABLE table_name_2 ( score VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score on March 23?
SELECT score FROM table_name_2 WHERE date = "march 23"
sql_create_context
CREATE TABLE table_67252 ( "Institution" text, "Location" text, "Nickname" text, "Current Conference" text, "Classification" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The River Hawks belonged to what current conference?
SELECT "Current Conference" FROM table_67252 WHERE "Nickname" = 'river hawks'
wikisql
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insuranc...
SELECT transfers.wardid FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1457) AND NOT transfers.wardid IS NULL AND DATETIME(transfers.intime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY transfers.intime LIMIT 1
mimic_iii
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "16" AND procedures.long_title = "Continuous intra-arterial blood gas monitoring"
mimicsql_data
CREATE TABLE table_9372 ( "Year" text, "Starts" real, "Wins" real, "Top Fives" real, "Top Tens" real, "Poles" real, "Rank" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of top fives when casey mears had more than 1 ...
SELECT SUM("Top Fives") FROM table_9372 WHERE "Poles" > '1' AND "Top Tens" < '9'
wikisql
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 jybgb.SQKS, jybgb.SQKSMC FROM jybgb WHERE jybgb.BGDH = '70072856056'
css
CREATE TABLE table_8599 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Points difference" text, "Points" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What club had a points differenc...
SELECT "Club" FROM table_8599 WHERE "Points difference" = '-24'
wikisql
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
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 '2000-08-07' AND '2002-12-06' AND t_kc22.SOC_SRT_DIRE_NM = '盐酸胺碘酮片'
css
CREATE TABLE table_18048 ( "Incumbent" text, "Reason for Vacancy" text, "Appointed Successor" text, "Date of Appointment" text, "Elected Successor" text, "Date of Election" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the election dat...
SELECT "Date of Election" FROM table_18048 WHERE "Appointed Successor" = 'H. Brent Coles'
wikisql
CREATE TABLE table_name_63 ( eliminated_by VARCHAR, wrestler VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who Eliminated Kane?
SELECT eliminated_by FROM table_name_63 WHERE wrestler = "kane"
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 name, COUNT(name) FROM course AS T1 JOIN teaches AS T2 ON T1.course_id = T2.course_id JOIN instructor AS T3 ON T2.ID = T3.ID WHERE year = 2008 GROUP BY name ORDER BY COUNT(name) DESC
nvbench
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE program_cours...
SELECT COUNT(*) > 0 FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias0 WHERE COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id AND NOT COURSEalias0.course_id IN...
advising
CREATE TABLE table_name_35 ( years VARCHAR, displacement VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the years for the displacement 4.0l (242cid)?
SELECT years FROM table_name_35 WHERE displacement = "4.0l (242cid)"
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 intakeoutput ( in...
SELECT COUNT(*) > 0 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 NULL)) AND intakeoutpu...
eicu
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
SELECT MIN(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'abdom aortic aneurysm') GROUP BY STRFTIME('%y', diagnoses_icd.charttime)) AS t1
mimic_iii
CREATE TABLE table_200_1 ( id number, "year" number, "title" text, "role" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what year was the film polio water released ?
SELECT "year" FROM table_200_1 WHERE "title" = 'polio water'
squall
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TAB...
SELECT p.Id AS "post_link", p.Score FROM Posts AS p INNER JOIN PostHistory AS ph ON ph.PostId = p.Id INNER JOIN CloseReasonTypes AS crt ON crt.Id = CAST(ph.Comment AS INT) INNER JOIN PostTags ON PostTags.PostId = p.Id INNER JOIN Tags ON PostTags.TagId = Tags.Id WHERE Tags.TagName IN ('elm') AND ph.PostHistoryTypeId = 1...
sede
CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE has_amenity ( dormid number, amenid number ) CREATE TABLE dorm ( dormid number, dorm_name text, student_capacity number, ...
SELECT COUNT(*), T3.dorm_name FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T1.age > 20 GROUP BY T3.dorm_name
spider
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, ...
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '9593364' AND t_kc22.SOC_SRT_DIRE_CD = '334225104-r'
css
CREATE TABLE table_33519 ( "Year" real, "Player" text, "Nationality" text, "Position" text, "Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What nationality has a year larger than 2009 with a position of power forward?
SELECT "Nationality" FROM table_33519 WHERE "Year" > '2009' AND "Position" = 'power forward'
wikisql
CREATE TABLE table_name_10 ( crowd VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How large was the crowd at Carlton's home game?
SELECT COUNT(crowd) FROM table_name_10 WHERE home_team = "carlton"
sql_create_context
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_NM = '何明煦' AND MED_SER_ORG_NO = '6644206' AND OUT_DIAG_DIS_NM LIKE '%迟滞%'
css
CREATE TABLE table_52278 ( "Years" text, "Winners" text, "Runners-Up" text, "Score" text, "Third" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the winner in the competition in which the runner-up was Rosenborg?
SELECT "Winners" FROM table_52278 WHERE "Runners-Up" = 'rosenborg'
wikisql
CREATE TABLE airport ( Airport_ID int, Airport_Name text, Total_Passengers real, %_Change_2007 text, International_Passengers real, Domestic_Passengers real, Transit_Passengers real, Aircraft_Movements real, Freight_Metric_Tonnes real ) CREATE TABLE aircraft ( Aircraft_ID int(11...
SELECT Aircraft, COUNT(*) FROM aircraft AS T1 JOIN match AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft ORDER BY Aircraft DESC
nvbench
CREATE TABLE table_1939214_1 ( year VARCHAR, league VARCHAR, regular_season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what year did the team compete in the 2nd, Northeast season of the USL PDL League?
SELECT year FROM table_1939214_1 WHERE league = "USL PDL" AND regular_season = "2nd, Northeast"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.long_title = "Acute diastolic heart failure"
mimicsql_data
CREATE TABLE person_info_hz_info ( RYBH text, KH number, KLX number, YLJGDM number ) CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZ...
SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb 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 person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM AND pers...
css
CREATE TABLE table_name_47 ( player VARCHAR, to_par VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Player that has a To standard of 7?
SELECT player FROM table_name_47 WHERE to_par = "–7"
sql_create_context
CREATE TABLE table_18294 ( "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's the party with dbeingtrict being massachusetts 3
SELECT "Party" FROM table_18294 WHERE "District" = 'Massachusetts 3'
wikisql
CREATE TABLE table_64109 ( "Date Released" text, "Polling institute" text, "Socialist" text, "Social Democratic" text, "Green-Communist" text, "People's Party" text, "Left Bloc" text, "Lead" text ) -- Using valid SQLite, answer the following questions for the tables provided above. --...
SELECT "Social Democratic" FROM table_64109 WHERE "Date Released" = 'october 10, 1999'
wikisql
CREATE TABLE table_24307 ( "Competition" text, "Round" text, "Opponent" text, "Result" text, "Score" text, "Home/Away" text, "Venue" text, "Attendance" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the result of...
SELECT "Result" FROM table_24307 WHERE "Round" = 'QF'
wikisql
CREATE TABLE table_name_40 ( year INTEGER, position VARCHAR, event VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the sum of year for 2nd position for junior race
SELECT SUM(year) FROM table_name_40 WHERE position = "2nd" AND event = "junior race"
sql_create_context
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND program_course.category LIKE '%PreMajor%' AND program_course.course_id = course.course_id AND semester.semester = 'FA' AND semester.semester_id = co...
advising
CREATE TABLE table_45767 ( "Rank" real, "Name" text, "Country" text, "Wins" real, "Years" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Country has Wins larger than 2, and a Rank of 2, and a Name of federico bahamontes?
SELECT "Country" FROM table_45767 WHERE "Wins" > '2' AND "Rank" = '2' AND "Name" = 'federico bahamontes'
wikisql
CREATE TABLE table_11265 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- with a record of 66-78 what was the loss?
SELECT "Loss" FROM table_11265 WHERE "Record" = '66-78'
wikisql
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 employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), ...
SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY AVG(MANAGER_ID)
nvbench