instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_82 ( octal INTEGER, hexadecimal VARCHAR, glyph VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest octal with a 30 hexadecimal and less than 0 glyphs?
SELECT MIN(octal) FROM table_name_82 WHERE hexadecimal = 30 AND glyph < 0
sql_create_context
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, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '周雪枫' AND t_kc22.STA_DATE BETWEEN '2007-09-27' AND '2016-08-29' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fgwyjz...
css
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.age, demographic.discharge_location FROM demographic WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE document_drafts ( document_id number, draft_number number, draft_details text ) CREATE TABLE ref_document_status ( document_status_code text, document_status_description text ) CREATE TABLE employees ( employee_id number, role_code text, employee_name text, other_detai...
SELECT employees.employee_name, COUNT(*) FROM employees JOIN circulation_history ON circulation_history.employee_id = employees.employee_id GROUP BY circulation_history.document_id, circulation_history.draft_number, circulation_history.copy_number ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_11734041_17 ( school_club_team_country VARCHAR, height_in_ft VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What school did the 7-4 player attend?
SELECT school_club_team_country FROM table_11734041_17 WHERE height_in_ft = "7-4"
sql_create_context
CREATE TABLE Functional_Areas ( functional_area_code VARCHAR(15), parent_functional_area_code VARCHAR(15), functional_area_description VARCHAR(80) ) CREATE TABLE Roles ( role_code VARCHAR(15), role_description VARCHAR(80) ) CREATE TABLE Document_Structures ( document_structure_code VARCHAR(15)...
SELECT document_name, access_count FROM Documents ORDER BY document_name
nvbench
CREATE TABLE table_214479_8 ( y_ VARCHAR, _2009 VARCHAR, expression VARCHAR, month VARCHAR, d VARCHAR, e VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the y = 2009 when the expression is month = floor ((d + e + 114) / 31)?
SELECT y_ = _2009 FROM table_214479_8 WHERE expression = month = FLOOR((d + e + 114) / 31)
sql_create_context
CREATE TABLE table_26821 ( "Season" real, "Series" text, "Team" text, "Races" real, "Wins" real, "Poles" real, "FLaps" real, "Podiums" real, "Points" real, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the lo...
SELECT MIN("Points") FROM table_26821 WHERE "Poles" = '0' AND "Races" = '10'
wikisql
CREATE TABLE table_35438 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Last match" text, "Replaced by" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the last match with a resigned manner of...
SELECT "Last match" FROM table_35438 WHERE "Manner of departure" = 'resigned' AND "Date of vacancy" = 'round 1'
wikisql
CREATE TABLE table_name_40 ( constituency_number VARCHAR, number_of_electorates__2009_ INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the constituency number with electorates (2009) number larger than 152,958?
SELECT constituency_number FROM table_name_40 WHERE number_of_electorates__2009_ > 152 OFFSET 958
sql_create_context
CREATE TABLE Institution ( Institution_id text, Institution text, Location text, Founded real, Type text, Enrollment int, Team text, Primary_Conference text, building_id text ) CREATE TABLE protein ( common_name text, protein_name text, divergence_from_human_lineage real...
SELECT Institution, COUNT(*) FROM Institution AS T1 JOIN protein AS T2 ON T1.Institution_id = T2.Institution_id GROUP BY T1.Institution_id
nvbench
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE locations ( LOCAT...
SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(MANAGER_ID) DESC
nvbench
CREATE TABLE table_name_71 ( catalog VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Catalog has a Country of Japan?
SELECT catalog FROM table_name_71 WHERE country = "japan"
sql_create_context
CREATE TABLE table_11254821_2 ( points_awarded__platinum_ VARCHAR, points_awarded__gold_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many platinum points were awarded when 9 gold points were awarded?
SELECT points_awarded__platinum_ FROM table_11254821_2 WHERE points_awarded__gold_ = 9
sql_create_context
CREATE TABLE writer ( wid int, gender text, name text, nationality text, birth_city text, birth_year int ) CREATE TABLE written_by ( id int, msid int, wid int ) CREATE TABLE director ( did int, gender text, name text, nationality text, birth_city text, birth...
SELECT name FROM actor WHERE birth_city = 'Austin' AND birth_year > 1980
imdb
CREATE TABLE table_34555 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game Site" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which opponent was played at Forbes Field after week 4?
SELECT "Opponent" FROM table_34555 WHERE "Game Site" = 'forbes field' AND "Week" > '4'
wikisql
CREATE TABLE table_11236195_5 ( season VARCHAR, winningteam VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many seasons did the canterbury bulldogs (8) win?
SELECT COUNT(season) FROM table_11236195_5 WHERE winningteam = "Canterbury Bulldogs (8)"
sql_create_context
CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, ...
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 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 T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Manufacturer DESC
nvbench
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_items ( row_id number, itemid ...
SELECT COUNT(*) > 0 FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5310)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'd10w' AND...
mimic_iii
CREATE TABLE table_name_86 ( title VARCHAR, release_date VARCHAR, production_num VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the title when the release date is 1938-12-17 and the production number is 8610?
SELECT title FROM table_name_86 WHERE release_date = "1938-12-17" AND production_num = "8610"
sql_create_context
CREATE TABLE table_58190 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the time of retirement with Laps smaller than 66, a grid less than 10, and a Driver of hein...
SELECT "Time/Retired" FROM table_58190 WHERE "Laps" < '66' AND "Grid" < '10' AND "Driver" = 'heinz-harald frentzen'
wikisql
CREATE TABLE table_63958 ( "Name" text, "Nationality" text, "Races won" real, "Races ridden" real, "Win average" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many races did the German racer that won less than 10 races ride?
SELECT COUNT("Races ridden") FROM table_63958 WHERE "Nationality" = 'german' AND "Races won" < '10'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wa...
SELECT AVG(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-56914')) AND intakeoutput.celllabel = 'volum...
eicu
CREATE TABLE table_80001 ( "Name" text, "GP-GS" text, "Effic" real, "Att-Cmp-Int" text, "Avg/G" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Avg/G of 2.7 is what effic?
SELECT "Effic" FROM table_80001 WHERE "Avg/G" = '2.7'
wikisql
CREATE TABLE table_7545 ( "Name" text, "Date of Birth" text, "Height" real, "Weight" real, "Spike" real, "Block" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest Weight, when Spike is less than 330, when Block is 315, and when...
SELECT MIN("Weight") FROM table_7545 WHERE "Spike" < '330' AND "Block" = '315' AND "Height" > '187'
wikisql
CREATE TABLE Financial_Transactions ( transaction_id INTEGER, account_id INTEGER, invoice_number INTEGER, transaction_type VARCHAR(15), transaction_date DATETIME, transaction_amount DECIMAL(19,4), transaction_comment VARCHAR(255), other_transaction_details VARCHAR(255) ) CREATE TABLE Or...
SELECT transaction_type, SUM(transaction_amount) FROM Financial_Transactions GROUP BY transaction_type
nvbench
CREATE TABLE table_name_92 ( name VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Name, when the Time is 8:10.1?
SELECT name FROM table_name_92 WHERE time = "8:10.1"
sql_create_context
CREATE TABLE table_40001 ( "Round" real, "Overall" real, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Player from appalachian state?
SELECT "Player" FROM table_40001 WHERE "College" = 'appalachian state'
wikisql
CREATE TABLE table_name_70 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What 2007 has 236 for 2006?
SELECT 2007 FROM table_name_70 WHERE 2006 = "236"
sql_create_context
CREATE TABLE player ( Player_ID int, name text, Position text, Club_ID int, Apps real, Tries real, Goals text, Points real ) CREATE TABLE club ( Club_ID int, name text, Region text, Start_year text ) CREATE TABLE competition_result ( Competition_ID int, Club_ID_...
SELECT Competition_type, COUNT(*) FROM competition GROUP BY Competition_type ORDER BY Competition_type DESC
nvbench
CREATE TABLE table_name_29 ( score VARCHAR, surface VARCHAR, opponent_in_the_final VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When playing against Yi Jingqian in the final on a hard surface what was the score?
SELECT score FROM table_name_29 WHERE surface = "hard" AND opponent_in_the_final = "yi jingqian"
sql_create_context
CREATE TABLE table_65354 ( "Draw" real, "Language" text, "Artist" text, "Place" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the highest draw when points is less than 11 and language is norwegian?
SELECT MAX("Draw") FROM table_65354 WHERE "Points" < '11' AND "Language" = 'norwegian'
wikisql
CREATE TABLE table_64755 ( "Rank" real, "Heat" real, "Lane" real, "Name" text, "Nationality" text, "Time" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What lane had a heat after 12, a rank of 38 and a time larger than 22.67?
SELECT AVG("Lane") FROM table_64755 WHERE "Heat" > '12' AND "Rank" = '38' AND "Time" > '22.67'
wikisql
CREATE TABLE list ( classroom VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the number of students in one classroom.
SELECT COUNT(*), classroom FROM list GROUP BY classroom
sql_create_context
CREATE TABLE table_name_49 ( played VARCHAR, drawn VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of matches played for the team with 0 draws and 33 points?
SELECT played FROM table_name_49 WHERE drawn = "0" AND points = "33"
sql_create_context
CREATE TABLE table_name_11 ( score VARCHAR, tie_no INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score when the Tie no less than 2?
SELECT score FROM table_name_11 WHERE tie_no < 2
sql_create_context
CREATE TABLE table_56811 ( "Race Name" text, "Circuit" text, "Date" text, "Winning driver" text, "Constructor" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the race name for ferrari on 25 april
SELECT "Race Name" FROM table_56811 WHERE "Constructor" = 'ferrari' AND "Date" = '25 april'
wikisql
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) 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, H...
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc21_t_kc22.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '施和畅' AND t_kc21.MED_SER_ORG_NO = '4094247' AND t_kc21.IN_HOSP_DATE BETWEEN '2010-09-25' AND '2013-02-08')
css
CREATE TABLE table_73802 ( "City / Municipality" text, "No. of s Barangay" real, "District" real, "Area (km\u00b2)" text, "Population (2010)" real, "Income class (2007)" text, "ZIP code" real, "Mayor" text ) -- Using valid SQLite, answer the following questions for the tables provided ...
SELECT COUNT("Population (2010)") FROM table_73802 WHERE "Area (km\u00b2)" = '134.51'
wikisql
CREATE TABLE csu_fees ( campus number, year number, campusfee number ) CREATE TABLE campuses ( id number, campus text, location text, county text, year number ) CREATE TABLE enrollments ( campus number, year number, totalenrollment_ay number, fte_ay number ) CREATE TAB...
SELECT T1.campus, SUM(T2.degrees) FROM campuses AS T1 JOIN degrees AS T2 ON T1.id = T2.campus WHERE T2.year >= 1998 AND T2.year <= 2002 GROUP BY T1.campus
spider
CREATE TABLE table_name_65 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the 1997 for atp masters series 1992
SELECT 1997 FROM table_name_65 WHERE 1992 = "atp masters series"
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 INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.long_title = "Combined right and left heart angiocardiography"
mimicsql_data
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, ...
SELECT num.TagName AS Tag, ROW_NUMBER() OVER (ORDER BY rate.Rate DESC) AS JanRank, ROW_NUMBER() OVER (ORDER BY num.Num DESC) AS TotalRank, rate.Rate AS QuestionsInJan, num.Num AS QuestionsTotal FROM (SELECT COUNT(PostId) AS Rate, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId AN...
sede
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 T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name DESC
nvbench
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 WHERE demographic.diagnosis = "STEMI" AND demographic.admityear < "2155"
mimicsql_data
CREATE TABLE table_name_1 ( played VARCHAR, lost VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What play has a loss of 2?
SELECT played FROM table_name_1 WHERE lost = "2"
sql_create_context
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 * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGD...
css
CREATE TABLE table_27548 ( "Authority" text, "Rate or precept" text, "Budget limit (\u00a3m)" text, "Budget plans (\u00a3m)" text, "Rate limit (p)" text, "Rate change (%)" text, "Desired rate (p)" text, "Desired rate change (%)" text ) -- Using valid SQLite, answer the following questi...
SELECT "Authority" FROM table_27548 WHERE "Budget limit (\u00a3m)" = '900'
wikisql
CREATE TABLE table_name_76 ( played VARCHAR, try_bonus VARCHAR, drawn VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the played with try bonus of 6 and drawn of 0
SELECT played FROM table_name_76 WHERE try_bonus = "6" AND drawn = "0"
sql_create_context
CREATE TABLE table_name_92 ( score VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score of the game on 8 Sep 1990?
SELECT score FROM table_name_92 WHERE date = "8 sep 1990"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text...
(SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jyb...
css
CREATE TABLE table_37223 ( "Disaster" text, "Type" text, "Location" text, "Deaths" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where was the disaster located that took place on 1916?
SELECT "Location" FROM table_37223 WHERE "Date" = '1916'
wikisql
CREATE TABLE table_name_62 ( hexadecimal INTEGER, glyph VARCHAR, decimal VARCHAR, octal VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average hexadecimal with a decimal less than 53, an octal less than 61, and a glyph greater than 0?
SELECT AVG(hexadecimal) FROM table_name_62 WHERE decimal < 53 AND octal < 61 AND glyph > 0
sql_create_context
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE employees ( EMPLOYEE_I...
SELECT FIRST_NAME, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate re...
SELECT Date_of_Birth, Weight FROM people ORDER BY Weight
nvbench
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE fare ( fare...
SELECT DISTINCT airline.airline_code FROM airline, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, fare_basis, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND fare_basis.class_type = 'B...
atis
CREATE TABLE table_204_396 ( id number, "country" text, "masters" number, "u.s. open" number, "the open" number, "pga" number, "total" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what are the number of pga winning golfers that zimbabwe ...
SELECT "pga" FROM table_204_396 WHERE "country" = 'zimbabwe'
squall
CREATE TABLE table_34428 ( "Player" text, "Hometown" text, "Occupation" text, "Education" text, "Game Status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the occupation was utility worker on-air talent, what was the game status?
SELECT "Game Status" FROM table_34428 WHERE "Occupation" = 'utility worker on-air talent'
wikisql
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, econom...
SELECT DISTINCT ground_service.ground_fare FROM airport, airport_service, city, ground_service WHERE airport.airport_code = airport_service.airport_code AND city.city_code = airport_service.city_code AND city.city_name = 'BOSTON' AND ground_service.airport_code = airport.airport_code AND ground_service.transport_type =...
atis
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. -- Visua...
SELECT T2.title, AVG(MIN(T1.stars)) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T2.title ORDER BY AVG(MIN(T1.stars)) DESC
nvbench
CREATE TABLE table_28980706_4 ( rank__timeslot_ VARCHAR, share__18_49_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 13 is the share (18-49) what is the rank (timeslot)?
SELECT rank__timeslot_ FROM table_28980706_4 WHERE share__18_49_ = 13
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.short_title = "Left heart cardiac cath"
mimicsql_data
CREATE TABLE table_name_51 ( week VARCHAR, date VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what week were there 26,243 in attendance on September 21, 1969?
SELECT COUNT(week) FROM table_name_51 WHERE date = "september 21, 1969" AND attendance < 26 OFFSET 243
sql_create_context
CREATE TABLE region ( Region_ID int, Region_name text, Date text, Label text, Format text, Catalogue text ) CREATE TABLE party_events ( Event_ID int, Event_Name text, Party_ID int, Member_in_charge_ID int ) CREATE TABLE party ( Party_ID int, Minister text, Took_offi...
SELECT Left_office, COUNT(Left_office) FROM party GROUP BY Minister ORDER BY COUNT(Left_office)
nvbench
CREATE TABLE table_15943 ( "Season" real, "Timeslot ( ET )" text, "Season premiere" text, "Season finale" text, "TV season" text, "Rank" text, "Viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the year of the season...
SELECT "TV season" FROM table_15943 WHERE "Season" = '12'
wikisql
CREATE TABLE table_name_68 ( report VARCHAR, winning_team VARCHAR, pole_position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Report of Winning Team Penske Racing, and what was Rick Mears' Pole position?
SELECT report FROM table_name_68 WHERE winning_team = "penske racing" AND pole_position = "rick mears"
sql_create_context
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) 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...
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(MANAGER_ID)
nvbench
CREATE TABLE table_46501 ( "Name" text, "Club" text, "Position" text, "Years" text, "Current status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Club during the Years 1995 1996?
SELECT "Club" FROM table_46501 WHERE "Years" = '1995–1996'
wikisql
CREATE TABLE table_23619492_3 ( paula_radcliffe___gbr__ VARCHAR, world_record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number of african record
SELECT COUNT(paula_radcliffe___gbr__) FROM table_23619492_3 WHERE world_record = "African record"
sql_create_context
CREATE TABLE table_58524 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the sum of Grid for giancarlo fisichella
SELECT SUM("Grid") FROM table_58524 WHERE "Driver" = 'giancarlo fisichella'
wikisql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREAT...
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'medication' AND cost.eventid IN (SELECT medication.medicationid FROM medication WHERE medication.drugname = 'levothyroxine sodium 50 mcg po tabs')
eicu
CREATE TABLE table_25800134_1 ( writer_s_ VARCHAR, series__number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who wrote the episode with series number 56?
SELECT writer_s_ FROM table_25800134_1 WHERE series__number = 56
sql_create_context
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON 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_MZJZJLB WHERE mzjzjlb.JZZDSM = '混合性焦虑障碍' AND hz_info.RYB...
css
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE restriction ( restriction_code text, advance_purc...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILAD...
atis
CREATE TABLE table_name_22 ( place VARCHAR, to_par VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Place of the Player with a To par of +2 and a Score of 70-72-73=215?
SELECT place FROM table_name_22 WHERE to_par = "+2" AND score = 70 - 72 - 73 = 215
sql_create_context
CREATE TABLE table_name_82 ( tournament VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Tournament, when Date is '6 October 2008'?
SELECT tournament FROM table_name_82 WHERE date = "6 october 2008"
sql_create_context
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 MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '88581683' AND MED_SER_ORG_NO = '6417819' AND OUT_DIAG_DIS_NM LIKE '%失调%'
css
CREATE TABLE table_203_51 ( id number, "channel" text, "definition" text, "organisation" text, "ownership" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the definition of the last channel ?
SELECT "definition" FROM table_203_51 ORDER BY id DESC LIMIT 1
squall
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 WHERE demographic.ethnicity = "BLACK/HAITIAN" AND demographic.admityear < "2124"
mimicsql_data
CREATE TABLE Sales ( sales_transaction_id INTEGER, sales_details VARCHAR(255) ) CREATE TABLE Ref_Transaction_Types ( transaction_type_code VARCHAR(10), transaction_type_description VARCHAR(80) ) CREATE TABLE Purchases ( purchase_transaction_id INTEGER, purchase_details VARCHAR(255) ) CREATE T...
SELECT date_of_transaction, COUNT(date_of_transaction) FROM Transactions WHERE share_count < 10 ORDER BY date_of_transaction DESC
nvbench
CREATE TABLE table_name_1 ( term_of_office VARCHAR, member VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the term of office for noel beaton?
SELECT term_of_office FROM table_name_1 WHERE member = "noel beaton"
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2175" AND diagnoses.long_title = "Aspergillosis"
mimicsql_data
CREATE TABLE table_name_94 ( constituency_number VARCHAR, reserved_for___sc___st__none_ VARCHAR, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the constituency number of the Seoni district and has none reserved?
SELECT constituency_number FROM table_name_94 WHERE reserved_for___sc___st__none_ = "none" AND district = "seoni"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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 te...
SELECT jyjgzbb.CKZFWDX, jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '38098966311'
css
CREATE TABLE domain_author ( aid int, did int ) CREATE TABLE keyword ( keyword varchar, kid int ) CREATE TABLE publication ( abstract varchar, cid int, citation_num int, jid int, pid int, reference_num int, title varchar, year int ) CREATE TABLE author ( aid int, ...
SELECT keyword.keyword FROM journal, keyword, publication, publication_keyword WHERE journal.name = 'PVLDB' AND publication_keyword.kid = keyword.kid AND publication.jid = journal.jid AND publication.pid = publication_keyword.pid
academic
CREATE TABLE table_28902 ( "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. -- who are the candidates for district new york 10?
SELECT "Candidates" FROM table_28902 WHERE "District" = 'New York 10'
wikisql
CREATE TABLE table_1749567_2 ( name VARCHAR, number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the name of race #28?
SELECT name FROM table_1749567_2 WHERE number = 28
sql_create_context
CREATE TABLE event ( Event_ID int, Date text, Venue text, Name text, Event_Attendance int ) CREATE TABLE news_report ( journalist_ID int, Event_ID int, Work_Type text ) CREATE TABLE journalist ( journalist_ID int, Name text, Nationality text, Age text, Years_working...
SELECT Work_Type, AVG(t1.Age) FROM journalist AS t1 JOIN news_report AS t2 ON t1.journalist_ID = t2.journalist_ID GROUP BY t2.Work_Type ORDER BY AVG(t1.Age)
nvbench
CREATE TABLE table_name_59 ( copa_libertadores_1992 VARCHAR, supercopa_sudamericana_1992 VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Copa Libertadores 1992 has a Supercopa Sudamericana 1992 of round of 16, and a Team of gr mio?
SELECT copa_libertadores_1992 FROM table_name_59 WHERE supercopa_sudamericana_1992 = "round of 16" AND team = "grêmio"
sql_create_context
CREATE TABLE table_6037 ( "City" text, "State" text, "School" text, "Colony Name" text, "Date Founded" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which City has a Colony Name of northeastern crescent colony?
SELECT "City" FROM table_6037 WHERE "Colony Name" = 'northeastern crescent colony'
wikisql
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 WHERE demographic.gender = "F" AND demographic.diagnosis = "BRADYCARDIA"
mimicsql_data
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT Posts.Id AS "post_link", Posts.OwnerUserId AS "user_link", Score, ViewCount, Score * 1000 / ViewCount AS "Score per Thousand Views" FROM Posts WHERE Score >= 5 AND PostTypeId = 1 ORDER BY ViewCount LIMIT 1000
sede
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id num...
SELECT LAST_DATE_OF_MONTH(p.CreationDate), AVG(CAST(p.Score AS FLOAT)) FROM Posts AS p WHERE (p.PostTypeId = 2) AND (p.CreationDate >= '##Date1?2010-01-01##') AND (p.CreationDate <= '##Date2?2021-01-01##') GROUP BY LAST_DATE_OF_MONTH(p.CreationDate) ORDER BY LAST_DATE_OF_MONTH(p.CreationDate)
sede
CREATE TABLE table_name_99 ( venue VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the venue when the date is 16 january 1996?
SELECT venue FROM table_name_99 WHERE date = "16 january 1996"
sql_create_context
CREATE TABLE table_73871 ( "Locale" text, "Skip" text, "W" real, "L" real, "PF" real, "PA" real, "Ends Won" real, "Ends Lost" real, "Blank Ends" real, "Stolen Ends" real, "Shot Pct." real ) -- Using valid SQLite, answer the following questions for the tables provided above....
SELECT COUNT("PF") FROM table_73871 WHERE "Skip" = 'Kelly Scott'
wikisql
CREATE TABLE table_train_85 ( "id" int, "mini_mental_state_examination_mmse" int, "elevated_serum_phenylalanine" int, "elevated_creatinine" float, "renal_disease" bool, "geriatric_depression_scale_gds" int, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the table...
SELECT * FROM table_train_85 WHERE mini_mental_state_examination_mmse >= 15 AND mini_mental_state_examination_mmse <= 26
criteria2sql
CREATE TABLE table_name_18 ( score VARCHAR, result VARCHAR, style VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Score has a Result of third place, and a Style of cha-cha-cha?
SELECT score FROM table_name_18 WHERE result = "third place" AND style = "cha-cha-cha"
sql_create_context
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) 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 numbe...
SELECT SUM(cost.cost) FROM cost WHERE cost.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 30733) AND DATETIME(cost.chargetime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')
mimic_iii
CREATE TABLE table_72726 ( "Series #" real, "Season #" real, "Title" text, "Directed by:" text, "Written by:" text, "Original air date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Season originally aired on September 17, 1955
SELECT "Season #" FROM table_72726 WHERE "Original air date" = 'September 17, 1955'
wikisql