instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "14" AND lab.itemid = "51200"
mimicsql_data
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE SuggestedEdits ( Id number, ...
SELECT COUNT(*) FROM Posts WHERE Posts.OwnerUserId = 263693 AND TIME_TO_STR(CreationDate, '%YEAR') = 2016
sede
CREATE TABLE table_204_169 ( id number, "athlete" text, "event" text, "race 1\ntime" text, "race 2\ntime" text, "total\ntime" text, "total\nrank" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who was last in the slalom overall ?
SELECT "athlete" FROM table_204_169 WHERE "event" = 'slalom' ORDER BY "total\ntime" DESC LIMIT 1
squall
CREATE TABLE table_41485 ( "Date" text, "Location" text, "Country" text, "Event" text, "Winner" text, "Runner-up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the location of the tournament held in Spain?
SELECT "Location" FROM table_41485 WHERE "Country" = 'spain'
wikisql
CREATE TABLE table_6466 ( "English name" text, "Bulgarian name" text, "Bulgarian name ( Transliteration )" text, "Old Bulgarian Names" text, "Old Bulgarian name (Transliteration)" text, "Old Bulgarian name - Meaning" text ) -- Using valid SQLite, answer the following questions for the tables p...
SELECT "Old Bulgarian name - Meaning" FROM table_6466 WHERE "Bulgarian name ( Transliteration )" = 'avgust'
wikisql
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE cost ( costid num...
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-11964')) AND lab.labname = 'alkaline phos.' AND DATETIME(lab.labresulttime, 'st...
eicu
CREATE TABLE table_name_64 ( fa_cup INTEGER, malaysia_cup INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the lowest FA Cup for a Malaysia Cup of 0?
SELECT MIN(fa_cup) FROM table_name_64 WHERE malaysia_cup < 0
sql_create_context
CREATE TABLE table_22879323_10 ( high_rebounds VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were the high rebounds on April 4?
SELECT high_rebounds FROM table_22879323_10 WHERE date = "April 4"
sql_create_context
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 student ( student_id int, lastname varchar, firstname varchar, program_id int, ...
SELECT DISTINCT department, name, number FROM course WHERE credits = 2 AND department = 'SW' AND number < 100 + 100 AND number >= 100
advising
CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE writes ( paperid int, authorid int ...
SELECT DISTINCT COUNT(DISTINCT writes.paperid) FROM author, keyphrase, paperkeyphrase, writes WHERE author.authorname = 'Alvin C Haver' AND keyphrase.keyphrasename = 'Iv Infusion' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND writes.authorid = author.authorid AND writes.paperid = paperkeyphrase.paperid
scholar
CREATE TABLE ENROLL ( CLASS_CODE varchar(5), STU_NUM int, ENROLL_GRADE varchar(50) ) CREATE TABLE PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE varchar(50), PROF_EXTENSION varchar(4), PROF_HIGH_DEGREE varchar(5) ) CREATE TABLE STUDENT ( STU_NUM int, STU_LNAME varc...
SELECT CRS_CODE, COUNT(CRS_CODE) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM GROUP BY CRS_CODE ORDER BY COUNT(CRS_CODE)
nvbench
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, ...
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, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id W...
mimic_iii
CREATE TABLE table_34789 ( "Pick #" text, "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. -- To which college/junior/club team did the player that was Pi...
SELECT "College/junior/club team" FROM table_34789 WHERE "Pick #" = '16'
wikisql
CREATE TABLE table_79870 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Record" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the result for kingdome game site and opponent of denver b...
SELECT "Result" FROM table_79870 WHERE "Game site" = 'kingdome' AND "Opponent" = 'denver broncos'
wikisql
CREATE TABLE table_21012786_2 ( length_weight_of_missile VARCHAR, diameter_of_torsion_spring VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the torsion spring diameter is 38.4cm what would be the length or weight of the missile
SELECT length_weight_of_missile FROM table_21012786_2 WHERE diameter_of_torsion_spring = "38.4cm"
sql_create_context
CREATE TABLE person_info_hz_info ( RYBH text, KH number, KLX number, YLJGDM number ) 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...
SELECT * FROM person_info JOIN hz_info JOIN zyjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND 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_i...
css
CREATE TABLE building ( name VARCHAR, building_id VARCHAR ) CREATE TABLE institution ( name VARCHAR, building_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the name of buildings that do not have any institution.
SELECT name FROM building WHERE NOT building_id IN (SELECT building_id FROM institution)
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 COUNT(*) FROM mzjzjlb WHERE mzjzjlb.YLJGDM = '4755541' AND mzjzjlb.JZKSRQ BETWEEN '2006-02-16' AND '2010-03-24' AND mzjzjlb.WDBZ > 0
css
CREATE TABLE gas_station ( station_id number, open_year number, location text, manager_name text, vice_manager_name text, representative_name text ) CREATE TABLE station_company ( station_id number, company_id number, rank_of_the_year number ) CREATE TABLE company ( company_id ...
SELECT company, main_industry FROM company WHERE headquarters <> 'USA'
spider
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 real ) CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight re...
SELECT Sex, AVG(Weight) FROM people GROUP BY Sex ORDER BY AVG(Weight)
nvbench
CREATE TABLE mzjybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH number, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, ...
SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '87778893' AND NOT mzjzjlb.JZLSH IN (SELECT zyjybgb.JZLSH FROM zyjybgb WHERE zyjybgb.BGRQ >= '2021-10-07' UNION SELECT mzjybgb.JZLSH FROM mzjybgb WHERE mzjybgb...
css
CREATE TABLE table_444 ( "Year" real, "Mens singles" text, "Womens singles" text, "Mens doubles" text, "Womens doubles" text, "Mixed doubles" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the women's singles were men's doubles were ste...
SELECT "Womens singles" FROM table_444 WHERE "Mens doubles" = 'Steen Fladberg Jens Peter Nierhoff'
wikisql
CREATE TABLE bank ( branch_ID int, bname varchar(20), no_of_customers int, city varchar(10), state varchar(20) ) CREATE TABLE loan ( loan_ID varchar(3), loan_type varchar(15), cust_ID varchar(3), branch_ID varchar(3), amount int ) CREATE TABLE customer ( cust_ID varchar(3),...
SELECT acc_type, AVG(acc_bal) FROM customer WHERE credit_score < 50 GROUP BY acc_type ORDER BY acc_type
nvbench
CREATE TABLE table_43414 ( "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. -- What i...
SELECT "High assists" FROM table_43414 WHERE "Record" = '28–40'
wikisql
CREATE TABLE table_63274 ( "Rank" real, "Heat" real, "Lane" real, "Name" text, "Nationality" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest rank when the lane is larger than 6, and the heat is 3, and the national...
SELECT MAX("Rank") FROM table_63274 WHERE "Lane" > '6' AND "Heat" = '3' AND "Nationality" = 'colombia'
wikisql
CREATE TABLE table_name_96 ( bronze INTEGER, gold VARCHAR, silver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average number of bronze of the nation with more than 1 gold and 1 silver medal?
SELECT AVG(bronze) FROM table_name_96 WHERE gold > 1 AND silver = 1
sql_create_context
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '7841691' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2001-04-23' AND '2010-08-18' GROUP BY t_kc21.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) < 2085.24) AS T
css
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-38092') AND NOT patient.admissionweight IS NULL AND DATETIME(patient.unitadmittime) >= DATETIME(CURRENT_TIME(), '-150 month') ORDER BY patient.unit...
eicu
CREATE TABLE university ( enrollment VARCHAR, primary_conference VARCHAR, founded VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the enrollment and primary_conference of the oldest college.
SELECT enrollment, primary_conference FROM university ORDER BY founded LIMIT 1
sql_create_context
CREATE TABLE table_11690135_1 ( interview VARCHAR, swimsuit VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who scored a 9.72 in the swimsuit?
SELECT interview FROM table_11690135_1 WHERE swimsuit = "9.72"
sql_create_context
CREATE TABLE table_203_612 ( 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. -- which country has the most silver medals ?
SELECT "nation" FROM table_203_612 ORDER BY "silver" DESC LIMIT 1
squall
CREATE TABLE table_name_60 ( year INTEGER, number_in_entourage VARCHAR, mission_type VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the latest year of a gratitude type mission with 99 in the entourage?
SELECT MAX(year) FROM table_name_60 WHERE number_in_entourage = "99" AND mission_type = "gratitude"
sql_create_context
CREATE TABLE table_2076608_3 ( enrollment VARCHAR, location_s_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where are the Alexandria enrollment locations?
SELECT enrollment FROM table_2076608_3 WHERE location_s_ = "Alexandria"
sql_create_context
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 real ) CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight re...
SELECT Sex, SUM(Height) FROM people GROUP BY Sex
nvbench
CREATE TABLE table_34854 ( "sSpec number" text, "Frequency" text, "L2 cache" text, "Mult." text, "Voltage" text, "Socket" text, "Release date" text, "Part number(s)" text, "Release price ( USD )" text ) -- Using valid SQLite, answer the following questions for the tables provided a...
SELECT "Release price ( USD )" FROM table_34854 WHERE "Socket" = 'without quickassist'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "BRAIN MASS;INTRACRANIAL HEMORRHAGE" AND demographic.dob_year < "2180"
mimicsql_data
CREATE TABLE table_name_99 ( points INTEGER, home VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest amount of points of the game with toronto as the home team?
SELECT MIN(points) FROM table_name_99 WHERE home = "toronto"
sql_create_context
CREATE TABLE table_33988 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where was home on April 3?
SELECT "Home" FROM table_33988 WHERE "Date" = 'april 3'
wikisql
CREATE TABLE table_name_35 ( d_41_√ VARCHAR, d_43_√ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the D 41 when it has D 43 of r 18
SELECT d_41_√ FROM table_name_35 WHERE d_43_√ = "r 18"
sql_create_context
CREATE TABLE employee ( eid number, name text, salary number ) CREATE TABLE certificate ( eid number, aid number ) CREATE TABLE aircraft ( aid number, name text, distance number ) CREATE TABLE flight ( flno number, origin text, destination text, distance number, de...
SELECT flno, origin, destination FROM flight ORDER BY origin
spider
CREATE TABLE table_72860 ( "1st throw" real, "2nd throw" real, "3rd throw" text, "Equation" text, "Result" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the equation is all equal, what is the 3rd throw?
SELECT "3rd throw" FROM table_72860 WHERE "Equation" = 'all equal'
wikisql
CREATE TABLE club ( clubid number, clubname text, clubdesc text, clublocation text ) CREATE TABLE member_of_club ( stuid number, clubid number, position text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advis...
SELECT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.sex = "F" GROUP BY t1.clubname ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_23248940_9 ( score VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How did the game number 50 end?
SELECT score FROM table_23248940_9 WHERE game = 50
sql_create_context
CREATE TABLE table_69820 ( "Cyclist" text, "Nation" text, "Team" text, "Time" text, "UCI Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the cyclist from Belgium?
SELECT "Cyclist" FROM table_69820 WHERE "Nation" = 'belgium'
wikisql
CREATE TABLE table_name_89 ( opponent VARCHAR, h_a_n VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Opponent of the game with a H/A/N of H and Score of 120-99?
SELECT opponent FROM table_name_89 WHERE h_a_n = "h" AND score = "120-99"
sql_create_context
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) 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 varc...
SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
nvbench
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 demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "68" AND lab.fluid = "Pleural"
mimicsql_data
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), ...
SELECT EMAIL, SALARY FROM employees ORDER BY SALARY DESC
nvbench
CREATE TABLE table_78167 ( "Number" real, "Name" text, "Team" text, "Position" text, "Years with franchise" text, "Year retired" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which team is number 14 and had a franchise in 1993-2000?
SELECT "Team" FROM table_78167 WHERE "Number" = '14' AND "Years with franchise" = '1993-2000'
wikisql
CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE paperdataset ( paperid int, datase...
SELECT DISTINCT keyphrase.keyphraseid FROM author, keyphrase, paper, paperkeyphrase, writes WHERE author.authorname = 'ras bodik' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
scholar
CREATE TABLE table_name_14 ( game INTEGER, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Game has an Opponent of @ pittsburgh penguins?
SELECT MAX(game) FROM table_name_14 WHERE opponent = "@ pittsburgh penguins"
sql_create_context
CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_...
SELECT DISTINCT flight_id FROM flight WHERE (((flight_days IN (SELECT DAYSalias0.days_code FROM days AS DAYSalias0 WHERE DAYSalias0.day_name IN (SELECT DATE_DAYalias0.day_name FROM date_day AS DATE_DAYalias0 WHERE DATE_DAYalias0.day_number = 25 AND DATE_DAYalias0.month_number = 12 AND DATE_DAYalias0.year = 1991)) AND f...
atis
CREATE TABLE table_name_82 ( game INTEGER, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the mean game played on January 9?
SELECT AVG(game) FROM table_name_82 WHERE date = "january 9"
sql_create_context
CREATE TABLE table_name_59 ( driver VARCHAR, grid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- I want the driver for grid of 9
SELECT driver FROM table_name_59 WHERE grid = 9
sql_create_context
CREATE TABLE table_name_89 ( high_school VARCHAR, utah_mr_basketball VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where did Tyler Haws, 2009 Utah Mr. Basketball, go to high school?
SELECT high_school FROM table_name_89 WHERE utah_mr_basketball = "tyler haws" AND year = 2009
sql_create_context
CREATE TABLE complaints ( complaint_type_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many distinct complaint type codes are there in the database?
SELECT COUNT(DISTINCT complaint_type_code) FROM complaints
sql_create_context
CREATE TABLE table_name_95 ( game INTEGER, opponent VARCHAR, february VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest numbered game with an opponent of Minnesota North Stars earlier than February 25?
SELECT MIN(game) FROM table_name_95 WHERE opponent = "minnesota north stars" AND february < 25
sql_create_context
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 jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZ...
css
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, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T2.Revenue
nvbench
CREATE TABLE accounts ( account_id number, customer_id number, account_name text, other_account_details text ) CREATE TABLE financial_transactions ( transaction_id number, previous_transaction_id number, account_id number, card_id number, transaction_type text, transaction_date ...
SELECT card_type_code FROM customers_cards GROUP BY card_type_code ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_40876 ( "Year" real, "Winning team" text, "Losing team" text, "Score" text, "Site" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Score with a Winning team that is san antonio spurs?
SELECT "Score" FROM table_40876 WHERE "Winning team" = 'san antonio spurs'
wikisql
CREATE TABLE table_name_2 ( place VARCHAR, player VARCHAR, score VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When Jim Thorpe of United States has a score of 71, what is the place?
SELECT place FROM table_name_2 WHERE score = 71 AND country = "united states" AND player = "jim thorpe"
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE microlab ( microlabid number, ...
SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 4
eicu
CREATE TABLE table_name_49 ( ends INTEGER, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest ends for Dani Alves?
SELECT MIN(ends) FROM table_name_49 WHERE name = "dani alves"
sql_create_context
CREATE TABLE table_6504 ( "Round" real, "Player" text, "Position" text, "Nationality" text, "College/Junior/Club Team (League)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the position Bill Campbell played before round 6?
SELECT "Position" FROM table_6504 WHERE "Round" < '6' AND "Player" = 'bill campbell'
wikisql
CREATE TABLE table_33281 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the pre-Week 10 game that had an attendance of over 38,865?
SELECT "Date" FROM table_33281 WHERE "Week" < '10' AND "Attendance" = '38,865'
wikisql
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 prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Posaconazole Suspension"
mimicsql_data
CREATE TABLE table_23114 ( "Year (Ceremony)" text, "Film title used in nomination" text, "Persian title" text, "Director" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the film title nominated is Baran, what was the result?
SELECT "Result" FROM table_23114 WHERE "Film title used in nomination" = 'Baran'
wikisql
CREATE TABLE table_72718 ( "City/town" text, "Municipality" text, "County" text, "City/town status" real, "Population" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the cities/towns located in the municipality of Horten?
SELECT "City/town" FROM table_72718 WHERE "Municipality" = 'Horten'
wikisql
CREATE TABLE table_22654073_6 ( team VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the team for record 3-2
SELECT team FROM table_22654073_6 WHERE record = "3-2"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2172" AND procedures.long_title = "Other phototherapy"
mimicsql_data
CREATE TABLE table_name_44 ( to_par VARCHAR, country VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the to par of the player from the United States with a score of 69-68-65=202?
SELECT to_par FROM table_name_44 WHERE country = "united states" AND score = 69 - 68 - 65 = 202
sql_create_context
CREATE TABLE table_204_779 ( id number, "network name" text, "flagship" text, "programming type" text, "owner" text, "affiliates" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the total number of affiliates among all the networks ?
SELECT SUM("affiliates") FROM table_204_779
squall
CREATE TABLE table_203_33 ( id number, "conference" text, "date" text, "place" text, "attendance" number, "archive of presentations" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which wikimania conference has the least number of attendees ?
SELECT "conference" FROM table_203_33 ORDER BY "attendance" LIMIT 1
squall
CREATE TABLE table_27258 ( "Season" real, "Series" text, "Team" text, "Races" real, "Wins" real, "Poles" real, "F.L." real, "Podiums" real, "Points" text, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many wins we...
SELECT "Wins" FROM table_27258 WHERE "Points" = '112'
wikisql
CREATE TABLE table_191105_2 ( lyrics_by VARCHAR, subject VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When interjection is the subject who are the lyrics by?
SELECT lyrics_by FROM table_191105_2 WHERE subject = "interjection"
sql_create_context
CREATE TABLE table_204_90 ( id number, "rank" number, "name" text, "nationality" text, "time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- the total number of ethiopian runners
SELECT COUNT("name") FROM table_204_90 WHERE "nationality" = 'ethiopia'
squall
CREATE TABLE table_name_41 ( division_record VARCHAR, school VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the division record of Sussex Central?
SELECT division_record FROM table_name_41 WHERE school = "sussex central"
sql_create_context
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
SELECT Code, Manufacturer FROM Products WHERE Price BETWEEN 60 AND 120 GROUP BY Name
nvbench
CREATE TABLE table_14681 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which score has a competition of 1997 dunhill cup malaysia and february 23, 1997 as the date?
SELECT "Score" FROM table_14681 WHERE "Competition" = '1997 dunhill cup malaysia' AND "Date" = 'february 23, 1997'
wikisql
CREATE TABLE table_74578 ( "Lane" real, "Name" text, "Nationality" text, "Split (50m)" real, "Time" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total of lane(s) for swimmers from Sweden with a 50m split of faster than 26.25?
SELECT SUM("Lane") FROM table_74578 WHERE "Nationality" = 'sweden' AND "Split (50m)" < '26.25'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE cost ( costid number, ...
SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '006-76924') AND DATETIME(medication.drugstarttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT medication.drugname FROM medica...
eicu
CREATE TABLE table_32169 ( "Date" text, "Venue" text, "Result" text, "Scored" real, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest scored in the 2010 east asian football championship?
SELECT MAX("Scored") FROM table_32169 WHERE "Competition" = '2010 east asian football championship'
wikisql
CREATE TABLE table_23394920_1 ( branding VARCHAR, power_kw VARCHAR, station_type VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When relay is the station type and 5kw is the power kw what is the branding?
SELECT branding FROM table_23394920_1 WHERE power_kw = "5kW" AND station_type = "Relay"
sql_create_context
CREATE TABLE customers ( customer_id VARCHAR, customer_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List all the customers in increasing order of IDs.
SELECT customer_id, customer_name FROM customers ORDER BY customer_id
sql_create_context
CREATE TABLE table_name_23 ( capacity INTEGER, kitmaker VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is umbro's highest capacity?
SELECT MAX(capacity) FROM table_name_23 WHERE kitmaker = "umbro"
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 USE_FRE, EACH_DOSAGE FROM t_kc22 WHERE MED_CLINIC_ID = '01570275256' AND SOC_SRT_DIRE_NM = '重酒石酸卡巴拉汀胶囊'
css
CREATE TABLE table_name_49 ( decile VARCHAR, roll VARCHAR, authority VARCHAR, area VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total Decile that has a state authority, fairlie area and roll smarter than 206?
SELECT COUNT(decile) FROM table_name_49 WHERE authority = "state" AND area = "fairlie" AND roll < 206
sql_create_context
CREATE TABLE table_63686 ( "School" text, "Location" text, "Mascot" text, "County" text, "Year Joined" real, "Year Left" real, "Conference Joined" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the mascot for moores hill that joined ...
SELECT "Mascot" FROM table_63686 WHERE "Year Joined" > '1952' AND "School" = 'moores hill'
wikisql
CREATE TABLE table_name_63 ( railway VARCHAR, built VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which railway was built in 1909?
SELECT railway FROM table_name_63 WHERE built = "1909"
sql_create_context
CREATE TABLE appointment ( patient VARCHAR ) CREATE TABLE patient ( ssn VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what are name and phone number of patients who had more than one appointment?
SELECT name, phone FROM appointment AS T1 JOIN patient AS T2 ON T1.patient = T2.ssn GROUP BY T1.patient HAVING COUNT(*) > 1
sql_create_context
CREATE TABLE Product_Categories ( production_type_code VARCHAR(15), product_type_description VARCHAR(80), vat_rating DECIMAL(19,4) ) CREATE TABLE Orders ( order_id INTEGER, customer_id INTEGER, date_order_placed DATETIME, order_details VARCHAR(255) ) CREATE TABLE Products ( product_id ...
SELECT product_id, COUNT(DISTINCT order_id) FROM Order_Items
nvbench
CREATE TABLE table_train_113 ( "id" int, "mini_mental_state_examination_mmse" int, "systolic_blood_pressure_sbp" int, "body_weight" float, "diastolic_blood_pressure_dbp" int, "body_mass_index_bmi" float, "triglyceride_tg" float, "NOUSE" float ) -- Using valid SQLite, answer the followi...
SELECT * FROM table_train_113 WHERE (body_mass_index_bmi >= 18 AND body_mass_index_bmi <= 33) AND body_weight > 50
criteria2sql
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Badges ( Id...
SELECT PostId AS "post_link", SUM(CASE WHEN VoteTypeId = 3 THEN 1 ELSE 0 END) AS "dvs", Score FROM Votes AS v JOIN Posts AS p ON v.PostId = p.Id WHERE COALESCE(p.CommentCount, 0) = 0 AND v.VoteTypeId = 3 GROUP BY PostId, Score
sede
CREATE TABLE table_name_20 ( time VARCHAR, rider VARCHAR, grid VARCHAR, laps VARCHAR, manufacturer VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the time when laps is less than 21, manufacturer is aprilia, grid is less than 17 and the ri...
SELECT time FROM table_name_20 WHERE laps < 21 AND manufacturer = "aprilia" AND grid < 17 AND rider = "thomas luthi"
sql_create_context
CREATE TABLE table_10903 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where did the team play when they scored 10.10 (...
SELECT "Venue" FROM table_10903 WHERE "Away team score" = '10.10 (70)'
wikisql
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT COUNT(mzjzjlb.ZZYSGH) FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '张静雅' AND mzjzjlb.JZKSRQ BETWEEN '2012-10-17' AND '2017-12-25'
css
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "M" AND prescriptions.drug = "Xopenex Neb"
mimicsql_data
CREATE TABLE table_78116 ( "8:00" text, "8:30" text, "9:00" text, "9:30" text, "10:00" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is at 10:00 when at 9:00 it is lost (#19, 4.6 rating) and at 8:30 it is lost (reruns)?
SELECT "10:00" FROM table_78116 WHERE "9:00" = 'lost (#19, 4.6 rating)' AND "8:30" = 'lost (reruns)'
wikisql
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 COUNT(*) FROM mzjzjlb WHERE YLJGDM = '4671519' AND JZKSRQ BETWEEN '2001-01-01' AND '2021-09-10' AND TXBZ > 0
css