instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_22 ( venue VARCHAR, date VARCHAR, status VARCHAR, against VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Venue, when Status is '2007 Rugby World Cup', when Against is less than 22, and when Date is '08/09/2007'?
SELECT venue FROM table_name_22 WHERE status = "2007 rugby world cup" AND against < 22 AND date = "08/09/2007"
sql_create_context
CREATE TABLE table_4661 ( "Date" text, "Result" text, "Score" text, "Stadium" text, "City" text, "Crowd" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of the match in Penrith that featured a score of 48-12?
SELECT "Result" FROM table_4661 WHERE "Score" = '48-12' AND "City" = 'penrith'
wikisql
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 OUT_DIAG_DIS_CD, OUT_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_NM = '潘莹玉' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc24 WHERE MED_AMOUT > 2220.31)
css
CREATE TABLE train ( Train_ID int, Train_Num text, Name text, From text, Arrival text, Railway_ID int ) CREATE TABLE railway ( Railway_ID int, Railway text, Builder text, Built text, Wheels text, Location text, ObjectNumber text ) CREATE TABLE railway_manage ( R...
SELECT Country, COUNT(Country) FROM manager WHERE Age > 50 OR Age < 46 GROUP BY Country
nvbench
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "WIDOWED" AND procedures.icd9_code = "4105"
mimicsql_data
CREATE TABLE table_71388 ( "Goal" real, "Date" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the date of the game that had a goal of 3?
SELECT "Date" FROM table_71388 WHERE "Goal" = '3'
wikisql
CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) C...
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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.departure_time > 1600 AND flight.to_airport = AIRPORT_SERVICE_1...
atis
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 demographic.dob, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "66411"
mimicsql_data
CREATE TABLE table_name_88 ( abbreviation VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the abbreviation for libya?
SELECT abbreviation FROM table_name_88 WHERE country = "libya"
sql_create_context
CREATE TABLE table_name_89 ( game VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of games for the opponent in Washington?
SELECT COUNT(game) FROM table_name_89 WHERE opponent = "washington"
sql_create_context
CREATE TABLE table_name_45 ( opponent VARCHAR, game VARCHAR, march VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which opponent's game was less than 76 when the march was 10?
SELECT opponent FROM table_name_45 WHERE game < 76 AND march = 10
sql_create_context
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 jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW 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 jyb...
css
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 text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
SELECT MIN(demographic.age) FROM demographic WHERE demographic.gender = "F" AND demographic.age >= "30"
mimicsql_data
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM ...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN 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 = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJ...
css
CREATE TABLE table_58371 ( "Year" text, "Start" text, "Qual" text, "Rank" text, "Finish" text, "Laps" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What finish time started at 32?
SELECT "Finish" FROM table_58371 WHERE "Start" = '32'
wikisql
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), ...
SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history)
nvbench
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 hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM...
css
CREATE TABLE table_name_89 ( player VARCHAR, position VARCHAR, loaned_to VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What player that has a Position of df, and Loaned to is Stoke City?
SELECT player FROM table_name_89 WHERE position = "df" AND loaned_to = "stoke city"
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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CELO-VESSICLE FISTULA"
mimicsql_data
CREATE TABLE table_28053 ( "Episode no." real, "Airdate" text, "Dave Viewers" real, "Dave Rank" real, "Rank (cable)" real, "Dave ja vu Viewers" real, "Total viewers" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest number o...
SELECT MAX("Dave Viewers") FROM table_28053 WHERE "Dave ja vu Viewers" = '119000'
wikisql
CREATE TABLE student ( ID varchar(5), name varchar(20), dept_name varchar(20), tot_cred numeric(3,0) ) CREATE TABLE teaches ( ID varchar(5), course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0) ) CREATE TABLE course ( course_id varchar(8), title v...
SELECT dept_name, AVG(salary) FROM instructor GROUP BY dept_name ORDER BY dept_name DESC
nvbench
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( medicationid ...
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 = '015-59552')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutpu...
eicu
CREATE TABLE fgwyjzb ( 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 gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '6226694' AND gwyjzb.IN_HOSP_DATE BETWEEN '2011-07-25' AND '2019-11-30' AND gwyjzb.INSU_TYPE = '儿童' UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '6226694' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2011-07-25' AND '2019-11-30' AND fgwyjzb.INSU_TYPE =...
css
CREATE TABLE table_16524 ( "Year" text, "Champion" text, "Score" text, "Runner-Up" text, "Location" text, "Semi-Finalist #1" text, "Semi-Finalist #2" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the champion where semi-finalist #2 i...
SELECT "Champion" FROM table_16524 WHERE "Semi-Finalist #2" = 'NA' AND "Location" = 'Morrisville, NC'
wikisql
CREATE TABLE table_203_271 ( id number, "date" text, "series" text, "circuit" text, "city / state" text, "winner" text, "team" text, "car" text, "report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- mark skaife was the winnter of a...
SELECT "team" FROM table_203_271 WHERE "series" = 'atcc round 1' AND "winner" = 'mark skaife'
squall
CREATE TABLE table_45213 ( "Round" real, "Pick" real, "Player" text, "Position" text, "Nationality" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the player in guard position from Stephen F. Austin in a round les...
SELECT "Player" FROM table_45213 WHERE "Round" < '8' AND "Position" = 'guard' AND "School/Club Team" = 'stephen f. austin'
wikisql
CREATE TABLE bdmzjzjlb ( 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 wdmzjzjlb.JZKSRQ FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '70649441899' UNION SELECT bdmzjzjlb.JZKSRQ FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '70649441899'
css
CREATE TABLE table_name_88 ( stadium VARCHAR, final_score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What stadium was the game held in when the final score was 17-31?
SELECT stadium FROM table_name_88 WHERE final_score = "17-31"
sql_create_context
CREATE TABLE table_name_73 ( acquired INTEGER, number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Acquired when the Number shows as 7?
SELECT AVG(acquired) FROM table_name_73 WHERE number = 7
sql_create_context
CREATE TABLE table_22347090_4 ( us_viewers__million_ VARCHAR, no_in_season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many viewers tuned in for season 2?
SELECT us_viewers__million_ FROM table_22347090_4 WHERE no_in_season = 2
sql_create_context
CREATE TABLE table_55448 ( "Date" text, "Tournament" text, "Winning score" text, "To par" text, "Margin of victory" text, "Runner(s)-up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the Masters Tournament?
SELECT "Date" FROM table_55448 WHERE "Tournament" = 'masters tournament'
wikisql
CREATE TABLE player ( Residence VARCHAR, gender VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the residences that have both a player of gender 'M' and a player of gender 'F'.
SELECT Residence FROM player WHERE gender = "M" INTERSECT SELECT Residence FROM player WHERE gender = "F"
sql_create_context
CREATE TABLE table_36390 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Series" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Attendances on may 24?
SELECT MIN("Attendance") FROM table_36390 WHERE "Date" = 'may 24'
wikisql
CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int )...
SELECT DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.end_time <= '1:00' AND course_offering.start_time >= '8:00' AND course.course_id = course_offering.course_id AND course.department = 'BIOMEDE' AND course.numb...
advising
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 person_info.XM 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 jybgb.BGDH = '92482714366'
css
CREATE TABLE table_19894 ( "Series Ep." text, "Episode" real, "Netflix" text, "Segment A" text, "Segment B" text, "Segment C" text, "Segment D" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what episode was segment D ned Can Corn?
SELECT MAX("Episode") FROM table_19894 WHERE "Segment D" = 'ned Can Corn'
wikisql
CREATE TABLE table_3916 ( "Episode #" real, "Series #" real, "Title" text, "Director" text, "Writer" text, "Original airdate" text, "Viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who directed 'running the gauntlet'?
SELECT "Director" FROM table_3916 WHERE "Title" = 'Running the Gauntlet'
wikisql
CREATE TABLE table_name_18 ( class VARCHAR, behind VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the class of the team that has a behind of +44.780?
SELECT class FROM table_name_18 WHERE behind = "+44.780"
sql_create_context
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number ...
SELECT DISTINCT course.department, course.name, course.number FROM course, program, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_id = program_course.program_id
advising
CREATE TABLE employees ( employee_id VARCHAR, first_name VARCHAR, last_name VARCHAR, department_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- display the employee number and name( first name and last name ) for all employees who work in a departm...
SELECT employee_id, first_name, last_name FROM employees WHERE department_id IN (SELECT department_id FROM employees WHERE first_name LIKE '%T%')
sql_create_context
CREATE TABLE table_40258 ( "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 Round against Aleksander Emelianenko had a tim...
SELECT "Round" FROM table_40258 WHERE "Time" = '5:00' AND "Opponent" = 'aleksander emelianenko'
wikisql
CREATE TABLE table_27515452_3 ( agency VARCHAR, sizes VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which company has a person that can wear clothing in 33-23-36
SELECT agency FROM table_27515452_3 WHERE sizes = "33-23-36"
sql_create_context
CREATE TABLE table_48308 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Nation has a Gold larger than 0, and a Total larger than 4, and a Rank of 6?
SELECT "Nation" FROM table_48308 WHERE "Gold" > '0' AND "Total" > '4' AND "Rank" = '6'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text ) CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, ...
SELECT zyjzjlb.ZYZDBM, zyjzjlb.ZYZDMC FROM hz_info JOIN zyjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.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_inf...
css
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decima...
SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY COUNT(HIRE_DATE) DESC
nvbench
CREATE TABLE table_73512 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the...
SELECT "Team" FROM table_73512 WHERE "Record" = '5-8'
wikisql
CREATE TABLE Subjects ( subject_id INTEGER, subject_name VARCHAR(120) ) CREATE TABLE Student_Tests_Taken ( registration_id INTEGER, date_test_taken DATETIME, test_result VARCHAR(255) ) CREATE TABLE Students ( student_id INTEGER, date_of_registration DATETIME, date_of_latest_logon DATET...
SELECT subject_name, COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id GROUP BY T1.subject_id ORDER BY subject_name
nvbench
CREATE TABLE table_69280 ( "Year" real, "Class" text, "Tyres" text, "Team" text, "Co-Drivers" text, "Laps" real, "Pos." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Are there any Teams after 1997?
SELECT "Team" FROM table_69280 WHERE "Year" > '1997'
wikisql
CREATE TABLE table_75427 ( "Country" text, "Skip" text, "Third" text, "Second" text, "Lead" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What skip has angela tuvaeva as the lead?
SELECT "Skip" FROM table_75427 WHERE "Lead" = 'angela tuvaeva'
wikisql
CREATE TABLE Mailshot_Customers ( mailshot_id INTEGER, customer_id INTEGER, outcome_code VARCHAR(15), mailshot_customer_date DATETIME ) CREATE TABLE Products ( product_id INTEGER, product_category VARCHAR(15), product_name VARCHAR(80) ) CREATE TABLE Mailshot_Campaigns ( mailshot_id INT...
SELECT outcome_code, COUNT(*) FROM Mailshot_Customers GROUP BY outcome_code
nvbench
CREATE TABLE table_name_95 ( home VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Home, when Score is 103-93?
SELECT home FROM table_name_95 WHERE score = "103-93"
sql_create_context
CREATE TABLE table_name_11 ( television_service VARCHAR, hdtv VARCHAR, language VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Television Service, when HDTV is No, and when Language is Italian?
SELECT television_service FROM table_name_11 WHERE hdtv = "no" AND language = "italian"
sql_create_context
CREATE TABLE Transactions ( transaction_id INTEGER, investor_id INTEGER, transaction_type_code VARCHAR(10), date_of_transaction DATETIME, amount_of_transaction DECIMAL(19,4), share_count VARCHAR(40), other_details VARCHAR(255) ) CREATE TABLE Transactions_Lots ( transaction_id INTEGER, ...
SELECT date_of_transaction, AVG(share_count) FROM Transactions
nvbench
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE ReviewTaskResults ( Id number, Review...
SELECT Id AS "post_link", Score FROM Posts WHERE PostTypeId = 2 AND ParentId IN (SELECT Id FROM Posts WHERE AnswerCount = 1) ORDER BY Score DESC
sede
CREATE TABLE table_3005915_3 ( starts INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the maximum number of starts?
SELECT MAX(starts) FROM table_3005915_3
sql_create_context
CREATE TABLE table_24524 ( "No." real, "Date" text, "Tournament" text, "Winning score" text, "To par" text, "Margin of victory" text, "Runner(s)-up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Margin of victory on no. 4 was?
SELECT "Margin of victory" FROM table_24524 WHERE "No." = '4'
wikisql
CREATE TABLE table_name_56 ( original_broadway_cast VARCHAR, original_west_end_cast VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the person who was in the Original Broadway Cast that was Original West End Cast of sheila hancock?
SELECT original_broadway_cast FROM table_name_56 WHERE original_west_end_cast = "sheila hancock"
sql_create_context
CREATE TABLE table_204_35 ( id number, "season" text, "tier" number, "division" text, "place" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- did they place better in 1987/88 or 1993/94 ?
SELECT "season" FROM table_204_35 WHERE "season" IN ('1987/88', '1993/94') ORDER BY "place" LIMIT 1
squall
CREATE TABLE department ( Department_ID int, Name text, Creation text, Ranking int, Budget_in_Billions real, Num_Employees real ) CREATE TABLE head ( head_ID int, name text, born_state text, age real ) CREATE TABLE management ( department_ID int, head_ID int, tempor...
SELECT Name, AVG(Num_Employees) FROM department AS T1 JOIN management AS T2 ON T1.department_ID = T2.department_ID WHERE T2.temporary_acting = 'Yes' GROUP BY Name ORDER BY AVG(Num_Employees) DESC
nvbench
CREATE TABLE table_name_12 ( class VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the class with rank of 89th
SELECT class FROM table_name_12 WHERE rank = "89th"
sql_create_context
CREATE TABLE table_55144 ( "Title" text, "Publisher" text, "First Year" text, "Last Year" text, "Genre" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the first year for Popgun?
SELECT "First Year" FROM table_55144 WHERE "Title" = 'popgun'
wikisql
CREATE TABLE table_38210 ( "Character Name" text, "Voice Actor (Japanese)" text, "Voice Actor (English 1997 / Saban)" text, "Voice Actor (English 1998 / Pioneer)" text, "Voice Actor (English 2006 / FUNimation)" text ) -- Using valid SQLite, answer the following questions for the tables provided ab...
SELECT "Character Name" FROM table_38210 WHERE "Voice Actor (Japanese)" = 'masaharu satou'
wikisql
CREATE TABLE table_16858 ( "Player" text, "No." real, "Nationality" text, "Position" text, "Years for Jazz" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What years did number 54 play for the jazz
SELECT "Years for Jazz" FROM table_16858 WHERE "No." = '54'
wikisql
CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) CREATE TABLE Reviewer ( rID int, name text ) CREATE TABLE Movie ( mID int, title text, year int, director text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For e...
SELECT director, COUNT(*) FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID GROUP BY T1.director ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_name_6 ( played INTEGER, position VARCHAR, goals_against VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which lowest played has a Position of 2, and Goals against larger than 53?
SELECT MIN(played) FROM table_name_6 WHERE position = 2 AND goals_against > 53
sql_create_context
CREATE TABLE table_name_53 ( english_title VARCHAR, director_s_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the English title of the film directed by Fernando Meirelles?
SELECT english_title FROM table_name_53 WHERE director_s_ = "fernando meirelles"
sql_create_context
CREATE TABLE table_19548 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the college/junior club team for pick number 63
SELECT "College/junior/club team" FROM table_19548 WHERE "Pick #" = '63'
wikisql
CREATE TABLE table_204_761 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the total number of silver medals won by russia , norway ...
SELECT SUM("silver") FROM table_204_761 WHERE "nation" IN ('russia', 'norway', 'sweden')
squall
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_charge number ) CREATE TABLE member ( member_id number, name text, membership_card tex...
SELECT COUNT(*), address FROM member GROUP BY address
spider
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime...
SELECT (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-181433' AND patient.hospitaldischargetime IS NULL) AND NOT patient.admissionweight IS NULL ORDER BY patient.unitadmittime LIMIT 1 OFFSET 1)...
eicu
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.icd9_code = "5011"
mimicsql_data
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT Headquarter, COUNT(Headquarter) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter DESC
nvbench
CREATE TABLE table_name_43 ( to_par VARCHAR, place VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is To Par, when Place is 3?
SELECT to_par FROM table_name_43 WHERE place = "3"
sql_create_context
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_procedures ( row_id number, ...
SELECT admissions.age FROM admissions WHERE admissions.subject_id = 71192 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1
mimic_iii
CREATE TABLE table_name_15 ( date_of_release VARCHAR, title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date was god & guns released?
SELECT date_of_release FROM table_name_15 WHERE title = "god & guns"
sql_create_context
CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total...
SELECT DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.end_time <= '4:00' AND course_offering.start_time >= '11:00' AND course.course_id = course_offering.course_id AND course.department = 'ECON' AND course.number...
advising
CREATE TABLE table_19130829_4 ( team__number1 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the 2nd leg result in the round where team #1 is Iraklis?
SELECT 2 AS nd_leg FROM table_19130829_4 WHERE team__number1 = "Iraklis"
sql_create_context
CREATE TABLE table_204_692 ( id number, "publication" text, "score" text, "review" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what number of publications are indicated as being in print ?
SELECT COUNT("publication") FROM table_204_692 WHERE "review" = 'print'
squall
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE microlab ( microlabid number, ...
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-80291')) AND medication.drugname IN ('30 ml cup : alum & mag hydroxide...
eicu
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 ACC_Road, School_ID FROM basketball_match GROUP BY All_Home, ACC_Road ORDER BY School_ID
nvbench
CREATE TABLE table_21885 ( "Season" text, "Date" text, "Driver" text, "Team" text, "Chassis" text, "Engine" text, "Laps" text, "Miles (km)" text, "Race Time" text, "Average Speed (mph)" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tabl...
SELECT "Race Time" FROM table_21885 WHERE "Team" = 'Chip Ganassi Racing' AND "Laps" = '228'
wikisql
CREATE TABLE table_29668 ( "Week #" text, "Theme" text, "Song Choice" text, "Original Artist" text, "Order #" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which song was picked that was originally performed by Marisa Monte?
SELECT "Song Choice" FROM table_29668 WHERE "Original Artist" = 'Marisa Monte'
wikisql
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, ...
WITH scorestags_cte AS (SELECT pt.TagId AS TagId, p.OwnerUserId AS uid, p.OwnerDisplayName AS udn, SUM(p.Score) AS sco, COUNT(p.Id) AS num FROM Posts AS p INNER JOIN Posts AS q ON q.Id = p.ParentId INNER JOIN PostTags AS pt ON q.Id = pt.PostId WHERE (p.CommunityOwnedDate IS NULL) GROUP BY pt.TagId, p.OwnerUserId, p.Own...
sede
CREATE TABLE table_name_83 ( population INTEGER, median_household_income VARCHAR, number_of_households VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the population where the median household income is $87,832 and there are fewer than 64,886 hous...
SELECT AVG(population) FROM table_name_83 WHERE median_household_income = "$87,832" AND number_of_households < 64 OFFSET 886
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE procedures.icd9_code = "5771" AND prescriptions.drug_type = "MAIN"
mimicsql_data
CREATE TABLE table_18686317_1 ( rank VARCHAR, yardage VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the rank of the player who got 58179 in yardage?
SELECT rank FROM table_18686317_1 WHERE yardage = 58179
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH text, MZJZLSH text, KH text, KLX number, HZXM text, WDBZ number, RYDJSJ time, RYTJDM number, RYTJMC text, JZKSDM text, JZKSMC text, RZBQDM t...
(SELECT jybgb.BBCJBW 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 j...
css
CREATE TABLE Courses ( course_name VARCHAR, course_id VARCHAR ) CREATE TABLE Student_Course_Enrolment ( course_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the course that has the most student enrollment?
SELECT T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
CREATE TABLE table_39196 ( "Season" real, "Series" text, "Team" text, "Races" real, "Wins" real, "Poles" real, "Podiums" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the largest amount of wins that was before the 2007 season, as we...
SELECT MAX("Wins") FROM table_39196 WHERE "Season" < '2007' AND "Team" = 'silverstone motorsport academy'
wikisql
CREATE TABLE table_name_38 ( away_team VARCHAR, tie_no VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What away team has 7 as the tie no.?
SELECT away_team FROM table_name_38 WHERE tie_no = "7"
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 gwyjzb.MED_ORG_DEPT_CD, gwyjzb.OUT_DIAG_DIS_NM, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '6135153' GROUP BY gwyjzb.MED_ORG_DEPT_CD, gwyjzb.OUT_DIAG_DIS_NM UNION SELECT fgwyjzb.MED_ORG_DEPT_CD, fgwyjzb.OUT_DIAG_DIS_NM, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '61...
css
CREATE TABLE table_train_71 ( "id" int, "gender" string, "language" string, "intention_to_arterial_catheter" bool, "renal_disease" bool, "sepsis" bool, "allergy_to_hydroxyethyl_starch" bool, "age" float, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the ...
SELECT * FROM table_train_71 WHERE (gender = 'male' OR gender = 'female') AND (age >= 3.5 AND age <= 18) AND sepsis = 1
criteria2sql
CREATE TABLE table_67049 ( "Quarter" text, "Score" text, "Club" text, "Opponent" text, "Year" text, "Round" text, "Venue" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which year has a Round of 17?
SELECT "Year" FROM table_67049 WHERE "Round" = '17'
wikisql
CREATE TABLE table_203_379 ( id number, "first issued" text, "design" text, "slogan" text, "serial format" text, "serials issued" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many license plates were issued before 1960 ?
SELECT COUNT(*) FROM table_203_379 WHERE "first issued" < 1960
squall
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code tex...
SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-24054') AND patient.unitdischargetime IS NULL) AN...
eicu
CREATE TABLE table_name_66 ( runner_up VARCHAR, year VARCHAR, champion VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which runner-up placed in a year prior to 2006 and whose Champion was Elon?
SELECT runner_up FROM table_name_66 WHERE year < 2006 AND champion = "elon"
sql_create_context
CREATE TABLE table_name_81 ( touchdowns INTEGER, points VARCHAR, field_goals VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Touchdowns is the lowest one that has Points of 5, and a Field goals larger than 0?
SELECT MIN(touchdowns) FROM table_name_81 WHERE points = 5 AND field_goals > 0
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND procedures.icd9_code = "5781"
mimicsql_data
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE time_zone ( time_zone_cod...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight WHERE ((flight.to_airport = AIRPORT_SERVICE_1.airport_code AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND...
atis
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 demographic.religion FROM demographic WHERE demographic.subject_id = "26746"
mimicsql_data