instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_98 ( builder VARCHAR, kanji VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which builder has the the kanji of ?
SELECT builder FROM table_name_98 WHERE kanji = "曙"
sql_create_context
CREATE TABLE table_9994 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country does david gilford play for?
SELECT "Country" FROM table_9994 WHERE "Player" = 'david gilford'
wikisql
CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE venue ( venueid int, venue...
SELECT DISTINCT paper.paperid FROM author, paper, writes WHERE author.authorname = 'ali farhadi' AND paper.year = 2014 AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
scholar
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
SELECT Id AS "post_link", CreationDate, Tags FROM Posts WHERE LENGTH(Tags) - LENGTH(REPLACE(Tags, '<', '')) > 5
sede
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.gender, demographic.language FROM demographic WHERE demographic.name = "Travis Hofman"
mimicsql_data
CREATE TABLE table_27671835_3 ( new_membership_total INTEGER, members_lost INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the new membership total if the members lost is bigger than 1.0?
SELECT MAX(new_membership_total) FROM table_27671835_3 WHERE members_lost > 1.0
sql_create_context
CREATE TABLE table_38070 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the largest week that has t 35-35 as the result?
SELECT MAX("Week") FROM table_38070 WHERE "Result" = 't 35-35'
wikisql
CREATE TABLE table_75122 ( "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 "Club" FROM table_75122 WHERE "Points" = '56'
wikisql
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM 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.BGD...
css
CREATE TABLE table_name_58 ( to_par VARCHAR, place VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the to par for the t1 place with a score of 70-72-73-72=287?
SELECT to_par FROM table_name_58 WHERE place = "t1" AND score = 70 - 72 - 73 - 72 = 287
sql_create_context
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnon...
SELECT * FROM Votes WHERE VoteTypeId = 9 LIMIT 100
sede
CREATE TABLE table_78137 ( "D 41 O" text, "D 42 O" text, "D 43 O" text, "D 44 O" text, "D 45 +" text, "R 55 +" text, "R 54 +" text, "R 53 +" text, "R 52 O" text, "R 51 O" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which R 51 ...
SELECT "R 51 O" FROM table_78137 WHERE "D 42 O" = 'r 19'
wikisql
CREATE TABLE table_37452 ( "Team" text, "Driver" text, "Laps" real, "Time" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the grid of driver jo o urbano?
SELECT SUM("Grid") FROM table_37452 WHERE "Driver" = 'joão urbano'
wikisql
CREATE TABLE professor ( prof_office VARCHAR, emp_num VARCHAR ) CREATE TABLE CLASS ( prof_num VARCHAR, crs_code VARCHAR ) CREATE TABLE course ( crs_description VARCHAR, crs_code VARCHAR ) CREATE TABLE employee ( emp_fname VARCHAR, emp_num VARCHAR ) -- Using valid SQLite, answer the ...
SELECT T2.emp_fname, T4.prof_office, T3.crs_description FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN professor AS T4 ON T2.emp_num = T4.emp_num
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 MED_CLINIC_ID FROM t_kc21 WHERE PERSON_NM = '严志用' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE AMOUNT > 6005.61)
css
CREATE TABLE table_204_419 ( id number, "year" text, "tournament" text, "venue" text, "played" number, "won" number, "lost" number, "tied" number, "n/r" number, "result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- in how many ...
SELECT SUM("tied") FROM table_204_419
squall
CREATE TABLE table_60113 ( "Country" text, "Date" text, "Label" text, "Format" text, "Catalogue #" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date for the United Kingdom with an LP format?
SELECT "Date" FROM table_60113 WHERE "Country" = 'united kingdom' AND "Format" = 'lp'
wikisql
CREATE TABLE table_64260 ( "Class" text, "Railway number(s)" text, "Quantity" text, "Year(s) of manufacture" text, "Type" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the quantity of the aw class?
SELECT "Quantity" FROM table_64260 WHERE "Class" = 'aw'
wikisql
CREATE TABLE table_204_496 ( id number, "pos" number, "no" number, "driver" text, "team" text, "laps" number, "time/retired" text, "grid" number, "points" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- at the 2006 gran premio telme...
SELECT "driver" FROM table_204_496 WHERE "driver" IN ('oriol servia', 'katherine legge') ORDER BY "laps" DESC LIMIT 1
squall
CREATE TABLE table_name_68 ( competition VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Competition on July 7?
SELECT competition FROM table_name_68 WHERE date = "july 7"
sql_create_context
CREATE TABLE table_name_29 ( location_attendance VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the location and attendance of game 63?
SELECT location_attendance FROM table_name_29 WHERE game = 63
sql_create_context
CREATE TABLE Has_amenity ( dormid INTEGER, amenid INTEGER ) CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEG...
SELECT COUNT(*), Major FROM Student GROUP BY Major
nvbench
CREATE TABLE table_name_43 ( withdrawn INTEGER, type VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- With a Type of 4-6-4t, what is the sum Withdrawn?
SELECT SUM(withdrawn) FROM table_name_43 WHERE type = "4-6-4t"
sql_create_context
CREATE TABLE table_49559 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where did Jim Furyk place?
SELECT "Place" FROM table_49559 WHERE "Player" = 'jim furyk'
wikisql
CREATE TABLE table_204_734 ( id number, "first name" text, "surname" text, "death year" number, "beginning of\nservice" text, "end of\nservice" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the difference between the y...
SELECT ABS((SELECT "death year" FROM table_204_734 WHERE "first name" = 'seitz') - (SELECT "death year" FROM table_204_734 WHERE "first name" = 'aizele'))
squall
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type t...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT icustays.hadm_id FROM icustays WHERE icustays.icustay_id IN (SELECT inputevents_cv.icustay_id FROM inputevents_cv WHERE inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = '.25 ns+0.5:1 hepari...
mimic_iii
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, demographic.expire_flag FROM demographic WHERE demographic.subject_id = "23602"
mimicsql_data
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 jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE employees ( EMPLO...
SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID DESC
nvbench
CREATE TABLE table_name_13 ( series_1 VARCHAR, series_11 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Series 1 has a Series 11 of peter jones?
SELECT series_1 FROM table_name_13 WHERE series_11 = "peter jones"
sql_create_context
CREATE TABLE table_name_63 ( date VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Score of 3 6, 7 5, 6 4 included what date?
SELECT date FROM table_name_63 WHERE score = "3–6, 7–5, 6–4"
sql_create_context
CREATE TABLE table_name_18 ( rank INTEGER, country VARCHAR, wins VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the most rank for the United States with wins less than 1
SELECT MAX(rank) FROM table_name_18 WHERE country = "united states" AND wins < 1
sql_create_context
CREATE TABLE table_name_1 ( event VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What event did Cristina Iovu participate in?
SELECT event FROM table_name_1 WHERE name = "cristina iovu"
sql_create_context
CREATE TABLE table_28068063_3 ( eliminated_from_competition VARCHAR, points_margin VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many teams had a point margin of 48?
SELECT COUNT(eliminated_from_competition) FROM table_28068063_3 WHERE points_margin = 48
sql_create_context
CREATE TABLE wdmzjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH number, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZD...
SELECT jybgb.SHSJ FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND 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 WHERE person_info.XM = '周泰宁' AND jybg...
css
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', labevents.charttime)) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'white blood cells') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31088 AND a...
mimic_iii
CREATE TABLE table_71747 ( "Year" real, "Opponent" text, "Competition" text, "Score" text, "Venue" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was the average attendance 80,388?
SELECT AVG("Year") FROM table_71747 WHERE "Attendance" = '80,388'
wikisql
CREATE TABLE table_name_9 ( year INTEGER, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what Year is the Location of the Festival Koror, Palau?
SELECT SUM(year) FROM table_name_9 WHERE location = "koror, palau"
sql_create_context
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.insurance = "Medicare" AND diagnoses.long_title = "Acute myocardial infarction of inferolateral wall, initial episode of care"
mimicsql_data
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREAT...
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-50368')) AND vitalperiodic.respiration > 17.0 A...
eicu
CREATE TABLE table_26107 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Prod. Code" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number in the seaso...
SELECT COUNT("No. in season") FROM table_26107 WHERE "Prod. Code" = '2-05'
wikisql
CREATE TABLE Customers ( Customer_ID INTEGER, Customer_Details VARCHAR(255) ) CREATE TABLE Customer_Policies ( Policy_ID INTEGER, Customer_ID INTEGER, Policy_Type_Code CHAR(15), Start_Date DATE, End_Date DATE ) CREATE TABLE Claims ( Claim_ID INTEGER, Policy_ID INTEGER, Date_Cla...
SELECT Date_Payment_Made, Amount_Payment FROM Payments GROUP BY Payment_Method_Code, Date_Payment_Made ORDER BY Date_Payment_Made
nvbench
CREATE TABLE table_45710 ( "Year" real, "Games played" real, "Games won" real, "Games drawn" real, "Games lost" real, "Points for" real, "Points against" real, "Points difference" real, "Bonus points" real, "Table points" real ) -- Using valid SQLite, answer the following quest...
SELECT SUM("Games lost") FROM table_45710 WHERE "Points against" = '61' AND "Points difference" < '42'
wikisql
CREATE TABLE table_6595 ( "Locomotive" text, "Delivered as" text, "Entered service" text, "Owner" text, "Status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Entered service date of the H1 Locomotive?
SELECT "Entered service" FROM table_6595 WHERE "Locomotive" = 'h1'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT MAX(demographic.days_stay) FROM demographic WHERE demographic.diagnosis = "PITUITARY BLEED"
mimicsql_data
CREATE TABLE table_name_25 ( country VARCHAR, score VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Country is player Sandy Lyle from when she scored less than 69?
SELECT country FROM table_name_25 WHERE score < 69 AND player = "sandy lyle"
sql_create_context
CREATE TABLE table_21321804_1 ( cfl_team VARCHAR, college VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which cfl team is manitoba college?
SELECT cfl_team FROM table_21321804_1 WHERE college = "Manitoba"
sql_create_context
CREATE TABLE table_34647 ( "Date" text, "Tournament Name" text, "Location" text, "Partner" text, "Score in Final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the Partner in the United Airlines Tournament (1)?
SELECT "Partner" FROM table_34647 WHERE "Tournament Name" = 'united airlines tournament (1)'
wikisql
CREATE TABLE table_204_946 ( id number, "pos" number, "no" number, "driver" text, "team" text, "laps" number, "time/retired" text, "grid" number, "points" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many points did patrick c...
SELECT "points" FROM table_204_946 WHERE "driver" = 'patrick carpentier'
squall
CREATE TABLE table_28768469_10 ( high_assists VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In game 73, what were the total number of high assists?
SELECT COUNT(high_assists) FROM table_28768469_10 WHERE game = 73
sql_create_context
CREATE TABLE table_name_64 ( total_goals INTEGER, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total goals for Mark Ward?
SELECT MIN(total_goals) FROM table_name_64 WHERE name = "mark ward"
sql_create_context
CREATE TABLE table_name_65 ( played VARCHAR, lost VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the played with lost of 5
SELECT played FROM table_name_65 WHERE lost = "5"
sql_create_context
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airlin...
SELECT DISTINCT flight_id FROM flight WHERE ((flight_id IN (SELECT FLIGHT_FAREalias0.flight_id FROM flight_fare AS FLIGHT_FAREalias0 WHERE FLIGHT_FAREalias0.fare_id IN (SELECT FAREalias0.fare_id FROM fare AS FAREalias0 WHERE ((FAREalias0.fare_basis_code IN (SELECT FARE_BASISalias0.fare_basis_code FROM fare_basis AS FAR...
atis
CREATE TABLE table_name_49 ( pole INTEGER, flap VARCHAR, race VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest pole with a Flap larger than 5, and a before race 155?
SELECT MIN(pole) FROM table_name_49 WHERE flap > 5 AND race < 155
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 = "M" AND diagnoses.short_title = "Hyperosmolality"
mimicsql_data
CREATE TABLE table_68783 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Home Team has an Attendance of 1,859?
SELECT "Home team" FROM table_68783 WHERE "Attendance" = '1,859'
wikisql
CREATE TABLE table_40322 ( "Party" text, "1985" real, "1987" real, "1990" real, "1995" real, "1999" real, "2003" real, "2007" real, "2011" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest 2003 value with a 2011 less...
SELECT MAX("2003") FROM table_40322 WHERE "2011" < '107' AND "1995" < '17'
wikisql
CREATE TABLE table_204_850 ( id number, "name" text, "railway" text, "series" text, "maker" text, "dates" text, "drive" text, "wheel arrangement" text, "weight" text, "power" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided ...
SELECT (SELECT "weight" FROM table_204_850 WHERE "name" = 'ae 8/8') > (SELECT "weight" FROM table_204_850 WHERE "name" = 're 6/6')
squall
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 d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_i...
mimic_iii
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "M" AND prescriptions.formulary_drug_cd = "HEPA100SYR"
mimicsql_data
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABL...
SELECT * FROM PostTypes
sede
CREATE TABLE table_name_71 ( state VARCHAR, frequency VARCHAR, city_of_license VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What state is the radio station in that has a frequency of 90.1 FM and a city license in New Castle?
SELECT state FROM table_name_71 WHERE frequency = "90.1 fm" AND city_of_license = "new castle"
sql_create_context
CREATE TABLE table_28924 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What district was John Dawson from?
SELECT "District" FROM table_28924 WHERE "Incumbent" = 'John Dawson'
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 locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(...
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history)
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.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz...
css
CREATE TABLE table_12608427_8 ( started VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date did De Vries start?
SELECT started FROM table_12608427_8 WHERE name = "de Vries"
sql_create_context
CREATE TABLE college ( College_ID int, Name text, Leader_Name text, College_Location text ) CREATE TABLE round ( Round_ID int, Member_ID int, Decoration_Theme text, Rank_in_Round int ) CREATE TABLE member ( Member_ID int, Name text, Country text, College_ID int ) -- U...
SELECT Country, COUNT(Country) FROM member GROUP BY Country ORDER BY COUNT(Country) DESC
nvbench
CREATE TABLE table_name_20 ( pick INTEGER, college VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the highest pick number of the player who went to LSU in college?
SELECT MAX(pick) FROM table_name_20 WHERE college = "lsu"
sql_create_context
CREATE TABLE table_79594 ( "Rank" real, "Total Population (2010)" real, "Indian American Population (2010)" real, "% Indian American" real, "Asian American Population (2010)" real, "% Asian American" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -...
SELECT SUM("Total Population (2010)") FROM table_79594 WHERE "Asian American Population (2010)" < '60,072' AND "Indian American Population (2010)" > '14,696' AND "% Indian American" = '4.2'
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.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON person_info.RYBH = hz_info.RYBH AND 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 = j...
css
CREATE TABLE table_5324 ( "Bullet weight gram (grain)" text, "8.23 g (127 gr)" real, "9.72 g (150 gr)" real, "11.34 g (175 gr)" real, "12.96 g (200 gr)" real, "14.26 g (220 gr)" real, "Case capacity (%)" real ) -- Using valid SQLite, answer the following questions for the tables provided a...
SELECT AVG("8.23 g (127 gr)") FROM table_5324 WHERE "Bullet weight gram (grain)" = '8x64mm s' AND "12.96 g (200 gr)" < '102.9'
wikisql
CREATE TABLE table_name_24 ( venue VARCHAR, competition VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which venue hosts the Olympic Games for DNQ position?
SELECT venue FROM table_name_24 WHERE competition = "olympic games" AND position = "dnq"
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 SOC_SRT_DIRE_NM, EACH_DOSAGE, USE_FRE FROM t_kc22 WHERE MED_CLINIC_ID = '66681246924'
css
CREATE TABLE table_41788 ( "Landfill" text, "Location" text, "Acres" real, "Opened" real, "Capacity" text, "Status" text, "Rehab Period" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of acres at Sai Tso Wan, opening...
SELECT COUNT("Acres") FROM table_41788 WHERE "Landfill" = 'sai tso wan' AND "Opened" < '1978'
wikisql
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE Tags ( Id num...
SELECT TIME_TO_STR(CreationDate, '%Y'), TIME_TO_STR(CreationDate, '%-M'), COUNT(*) FROM Posts WHERE Tags LIKE '%activemq%' AND CreationDate BETWEEN '2015-01-01' AND '2019-01-01' GROUP BY TIME_TO_STR(CreationDate, '%Y'), TIME_TO_STR(CreationDate, '%-M') ORDER BY TIME_TO_STR(CreationDate, '%Y'), TIME_TO_STR(CreationDate,...
sede
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 AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_AGE > 25)
css
CREATE TABLE Events ( Event_ID INTEGER, Service_ID INTEGER, Event_Details VARCHAR(255) ) CREATE TABLE Participants_in_Events ( Event_ID INTEGER, Participant_ID INTEGER ) CREATE TABLE Participants ( Participant_ID INTEGER, Participant_Type_Code CHAR(15), Participant_Details VARCHAR(255)...
SELECT Participant_Type_Code, COUNT(Participant_Type_Code) FROM Participants GROUP BY Participant_Type_Code
nvbench
CREATE TABLE trip ( id INTEGER, duration INTEGER, start_date TEXT, start_station_name TEXT, start_station_id INTEGER, end_date TEXT, end_station_name TEXT, end_station_id INTEGER, bike_id INTEGER, subscription_type TEXT, zip_code INTEGER ) CREATE TABLE status ( station_i...
SELECT city, MAX(lat) FROM station GROUP BY city ORDER BY city
nvbench
CREATE TABLE table_name_71 ( silver VARCHAR, bronze VARCHAR, nation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of silver medals when there are 0 Bronze medals, and the nation is the United Kingdom?
SELECT COUNT(silver) FROM table_name_71 WHERE bronze = 0 AND nation = "united kingdom"
sql_create_context
CREATE TABLE customers ( address_line_1 VARCHAR, address_line_2 VARCHAR, email_address VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the address line 1 and 2 of the customer with email 'vbogisich@example.org'.
SELECT address_line_1, address_line_2 FROM customers WHERE email_address = "vbogisich@example.org"
sql_create_context
CREATE TABLE table_204_821 ( id number, "speed [km/h (mph)]" text, "train" text, "type" text, "location" text, "date" text, "comments" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the difference in speed number of the fastest and s...
SELECT MAX("speed [km/h (mph)]") - MIN("speed [km/h (mph)]") FROM table_204_821
squall
CREATE TABLE table_74920 ( "Race" text, "Class(es)" text, "Length/Duration" text, "Circuit" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the date of the race that lasted 6 hours?
SELECT "Date" FROM table_74920 WHERE "Length/Duration" = '6 hours'
wikisql
CREATE TABLE table_name_60 ( nominated VARCHAR, award VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the performance nominated for a Capif Award.
SELECT nominated FROM table_name_60 WHERE award = "capif award"
sql_create_context
CREATE TABLE competition_result ( Competition_ID int, Club_ID_1 int, Club_ID_2 int, Score text ) CREATE TABLE club ( Club_ID int, name text, Region text, Start_year text ) CREATE TABLE player ( Player_ID int, name text, Position text, Club_ID int, Apps real, Tri...
SELECT Competition_type, COUNT(*) FROM competition GROUP BY Competition_type ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_46289 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is time of manufacturer with grid 21?
SELECT "Time" FROM table_46289 WHERE "Grid" = '21'
wikisql
CREATE TABLE table_2413292_1 ( semifinal_matches VARCHAR, commercial_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who played in the semi finals matches at the Buick WCT finals?
SELECT semifinal_matches FROM table_2413292_1 WHERE commercial_name = "Buick WCT Finals"
sql_create_context
CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adults INTEGER, Kids INTEGER ) CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, baseP...
SELECT roomName, COUNT(roomName) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE FirstName LIKE '%ROY%' GROUP BY roomName ORDER BY roomName
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 = '6425807' AND t_kc21.IN_HOSP_DATE BETWEEN '2001-07-03' AND '2018-10-02' AND t_kc21.CLINIC_TYPE = '门诊'
css
CREATE TABLE table_11341 ( "Round" text, "Pick" text, "Player" text, "Position" text, "Nationality" text, "Team" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team had Pick 2?
SELECT "Team" FROM table_11341 WHERE "Pick" = '2'
wikisql
CREATE TABLE table_name_96 ( home_team VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the home team score when the away team is Collingwood?
SELECT home_team AS score FROM table_name_96 WHERE away_team = "collingwood"
sql_create_context
CREATE TABLE table_59703 ( "Name" text, "Dates active" text, "Windspeeds" text, "Pressure" text, "Deaths" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the storm active during season aggregates?
SELECT "Name" FROM table_59703 WHERE "Dates active" = 'season aggregates'
wikisql
CREATE TABLE table_20558 ( "#" real, "Date" text, "at/vs." text, "Opponent" text, "Score" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many were in attendance during the game on January 9, 1988?
SELECT "Attendance" FROM table_20558 WHERE "Date" = 'January 9, 1988'
wikisql
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additio...
SELECT DISTINCT instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'MATH' AND course.number = 497 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.o...
advising
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 WHERE demographic.discharge_location = "DEAD/EXPIRED" AND demographic.admityear < "2174"
mimicsql_data
CREATE TABLE table_name_98 ( gb_ VARCHAR, c_ VARCHAR, reds_season VARCHAR, win_percentage VARCHAR, wins VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In 1900 with 62 wins and a win percentage less than 0.457, what was the GB [c]?
SELECT gb_ AS "c_" FROM table_name_98 WHERE win_percentage < 0.457 AND wins = 62 AND reds_season = 1900
sql_create_context
CREATE TABLE all_documents ( document_id number, date_stored time, document_type_code text, document_name text, document_description text, other_details text ) CREATE TABLE document_locations ( document_id number, location_code text, date_in_location_from time, date_in_locaton_t...
SELECT DISTINCT destroyed_by_employee_id FROM documents_to_be_destroyed
spider
CREATE TABLE table_203_781 ( id number, "year" number, "competition" text, "venue" text, "position" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what number of competitions were held in 2010 ?
SELECT COUNT("competition") FROM table_203_781 WHERE "year" = 2010
squall
CREATE TABLE table_74786 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who did the Patriots play in week 4?
SELECT "Opponent" FROM table_74786 WHERE "Week" = '4'
wikisql
CREATE TABLE table_train_210 ( "id" int, "serum_potassium" float, "serum_calcium" float, "estimated_glomerular_filtration_rate_egfr" int, "body_mass_index_bmi" float, "age" float, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided above. -- estim...
SELECT * FROM table_train_210 WHERE estimated_glomerular_filtration_rate_egfr < 90
criteria2sql
CREATE TABLE table_203_308 ( id number, "athlete" text, "nation" text, "olympics" text, "gold" number, "silver" number, "bronze" number, "total" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who has won the most total snowboarding med...
SELECT "athlete" FROM table_203_308 ORDER BY "total" DESC LIMIT 1
squall
CREATE TABLE table_204_763 ( id number, "county" text, "km" number, "intersecting road" text, "notes" text, "coordinates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what are the total km for this xhart
SELECT SUM("km") FROM table_204_763
squall