instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_18950885_3 ( char_cells VARCHAR, graphics_mode INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If graphics mode is less than 1.0, what are the char cells?
SELECT char_cells FROM table_18950885_3 WHERE graphics_mode < 1.0
sql_create_context
CREATE TABLE table_name_48 ( total VARCHAR, silver VARCHAR, bronze VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Total(s) are there, when the number of Bronze is greater than 13, when the Rank is 8, and when the number of Silv...
SELECT COUNT(total) FROM table_name_48 WHERE bronze > 13 AND rank = "8" AND silver < 11
sql_create_context
CREATE TABLE table_name_10 ( method VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the method when the record is 1-1?
SELECT method FROM table_name_10 WHERE record = "1-1"
sql_create_context
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,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...
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY SUM(MANAGER_ID)
nvbench
CREATE TABLE table_name_61 ( finish VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Finish on June 1, 2008?
SELECT finish FROM table_name_61 WHERE date = "june 1, 2008"
sql_create_context
CREATE TABLE Students ( student_id INTEGER, date_of_registration DATETIME, date_of_latest_logon DATETIME, login_name VARCHAR(40), password VARCHAR(10), personal_name VARCHAR(40), middle_name VARCHAR(40), family_name VARCHAR(40) ) CREATE TABLE Course_Authors_and_Tutors ( author_id IN...
SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment ORDER BY COUNT(date_of_enrolment) DESC
nvbench
CREATE TABLE table_69421 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name of David Kimball, and an Overall smaller than 229 is what highest round?
SELECT MAX("Round") FROM table_69421 WHERE "Name" = 'david kimball' AND "Overall" < '229'
wikisql
CREATE TABLE table_203_765 ( id number, "genre" text, "date" text, "japanese title (original title)" text, "english title" text, "scoring" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which year saw the highest number of rele...
SELECT "date" FROM table_203_765 GROUP BY "date" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE table_23242950_1 ( no_in_season INTEGER, us_viewers__millions_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the season number of the episode originally seen by 6.64 million people in the US?
SELECT MIN(no_in_season) FROM table_23242950_1 WHERE us_viewers__millions_ = "6.64"
sql_create_context
CREATE TABLE table_name_28 ( series VARCHAR, position VARCHAR, season VARCHAR, podiums VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Series, when the Season is after 2008, when the value for Podiums is 3, and when the Position is 8th?
SELECT series FROM table_name_28 WHERE season > 2008 AND podiums = "3" AND position = "8th"
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT prescriptions.drug_type FROM prescriptions WHERE prescriptions.drug = "Verapamil"
mimicsql_data
CREATE TABLE table_name_61 ( nba_draft VARCHAR, school VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the NBA draft result of the player from Dunbar High School?
SELECT nba_draft FROM table_name_61 WHERE school = "dunbar high school"
sql_create_context
CREATE TABLE table_name_82 ( earnings__ INTEGER, rank VARCHAR, country VARCHAR, wins VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the united states has 22 wins and a rank greater than 2, what is the total earnings?
SELECT SUM(earnings__) AS $__ FROM table_name_82 WHERE country = "united states" AND wins = 22 AND rank > 2
sql_create_context
CREATE TABLE table_name_85 ( second_vice_president VARCHAR, inaugurated VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Second Vice President, when Inaugurated is '26 March 1928'?
SELECT second_vice_president FROM table_name_85 WHERE inaugurated = "26 march 1928"
sql_create_context
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text te...
SELECT Users.Id AS "user_link", Users.Id AS "user_id", COUNT(quest.Id) AS "total_questions", COUNT(quest.AcceptedAnswerId) AS "accepted_answers", CONCAT(CASE COUNT(quest.Id) WHEN 0 THEN 0 ELSE COUNT(quest.AcceptedAnswerId) * 100 / COUNT(quest.Id) END, ' %') AS "%_accepted" FROM Users LEFT JOIN Posts AS quest ON quest.O...
sede
CREATE TABLE table_74087 ( "Year" real, "Title" text, "Format" text, "Studio" text, "Release Date" text, "Copyright Information" text, "Catalog Number" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the catalog number for october 6, 198...
SELECT "Catalog Number" FROM table_74087 WHERE "Release Date" = 'October 6, 1988'
wikisql
CREATE TABLE table_name_87 ( round INTEGER, school_club_team VARCHAR, pick VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Round is the lowest one that has a School/Club Team of alabama, and a Pick larger than 43?
SELECT MIN(round) FROM table_name_87 WHERE school_club_team = "alabama" AND pick > 43
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "30" AND lab.label = "CD34"
mimicsql_data
CREATE TABLE table_2517 ( "Year" text, "Date" text, "Driver" text, "Team" text, "Manufacturer" text, "Laps" text, "Miles (km)" text, "Race Time" text, "Average Speed (mph)" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above...
SELECT "Manufacturer" FROM table_2517 WHERE "Driver" = 'Matt Kenseth' AND "Date" = 'March 7'
wikisql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemics...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '016-27397' AND patient.wardid = 613 AND patient.hospitaldischargetime IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1
eicu
CREATE TABLE table_name_20 ( year INTEGER, bronze VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE YEAR WITH A BRONZE OF AIMO TEPSELL?
SELECT MIN(year) FROM table_name_20 WHERE bronze = "aimo tepsell"
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 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, SUM(SALARY) FROM employees ORDER BY SUM(SALARY)
nvbench
CREATE TABLE table_name_22 ( player VARCHAR, position VARCHAR, school_club_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHo has a Position of end and a School/Club Team of oregon state?
SELECT player FROM table_name_22 WHERE position = "end" AND school_club_team = "oregon state"
sql_create_context
CREATE TABLE table_18305523_2 ( writer_s VARCHAR, cover_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who wrote the story that is cover date 19 October 1985?
SELECT writer_s FROM table_18305523_2 WHERE cover_date = "19 October 1985"
sql_create_context
CREATE TABLE zyb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
SELECT SUM(t_kc24.OVE_PAY) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.PERSON_NM = '孙沛珊' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2005-05-10' AND '2011-02-17' UNION SELECT SUM(t_kc24.OVE_PAY) FROM gyb JOIN t_kc24 ON gyb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gyb.PERSON_NM = '孙沛珊' AND t_kc2...
css
CREATE TABLE txmzjzjlb ( 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 * FROM person_info JOIN hz_info JOIN txmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE person_info.XM = '水康成' AND hz_info.YLJGDM = '3230609' AND NOT txmzjzjlb.JZZDSM LIKE '%张力%' UNION SELECT * FROM person_info JO...
css
CREATE TABLE movie ( movie_id int, Title text, Year int, Director text, Budget_million real, Gross_worldwide int ) CREATE TABLE culture_company ( Company_name text, Type text, Incorporated_in text, Group_Equity_Shareholding real, book_club_id text, movie_id text ) CREAT...
SELECT Category, COUNT(*) FROM book_club GROUP BY Category ORDER BY COUNT(*)
nvbench
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CR...
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'labevents' AND cost.event_id IN (SELECT labevents.row_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'wbc, csf'))
mimic_iii
CREATE TABLE table_31786 ( "Division" text, "League Apps" real, "League Goals" real, "FA Cup Apps" real, "FA Cup Goals" real, "Total Apps" real, "Total Goals" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which FA Cup apps has league goals ...
SELECT AVG("FA Cup Apps") FROM table_31786 WHERE "League Goals" = '1' AND "Total Goals" < '1'
wikisql
CREATE TABLE table_72374 ( "Country" text, "Total Drivers" real, "Champions" text, "Championships" text, "Current September 22, 2013" real, "First driver(s)" text, "Last/Current driver(s) September 22, 2013" text ) -- Using valid SQLite, answer the following questions for the tables provid...
SELECT "Champions" FROM table_72374 WHERE "Last/Current driver(s) September 22, 2013" = 'Vladimir Arabadzhiev ( 2010 )'
wikisql
CREATE TABLE host ( Host_ID int, Name text, Nationality text, Age text ) CREATE TABLE party_host ( Party_ID int, Host_ID int, Is_Main_in_Charge bool ) CREATE TABLE party ( Party_ID int, Party_Theme text, Location text, First_year text, Last_year text, Number_of_host...
SELECT Nationality, COUNT(*) FROM host GROUP BY Nationality ORDER BY Nationality DESC
nvbench
CREATE TABLE table_name_1 ( song_choice VARCHAR, theme VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Song choice with a Theme that is 1960s?
SELECT song_choice FROM table_name_1 WHERE theme = "1960s"
sql_create_context
CREATE TABLE table_name_99 ( score_1 VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the final score of the match that had an attendance of 9,205?
SELECT score_1 FROM table_name_99 WHERE attendance = "9,205"
sql_create_context
CREATE TABLE table_16436 ( "English name" text, "Original name" text, "Area in km\u00b2" text, "Population at 2010 Census" real, "Number of settlements and villages" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the area in km2 for the dist...
SELECT "Area in km\u00b2" FROM table_16436 WHERE "Original name" = 'Kecamatan Bogor Timur'
wikisql
CREATE TABLE table_name_93 ( score VARCHAR, visitor VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Score has a Visitor of montreal canadiens, and Points of 5?
SELECT score FROM table_name_93 WHERE visitor = "montreal canadiens" AND points = 5
sql_create_context
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ...
SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'neurosurgery - clipping of aneurysm(s)')) AN...
eicu
CREATE TABLE table_24122 ( "Episode" text, "Broadcast date" text, "Run time" text, "Viewers (in millions)" text, "Archive" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many million viewers watched the episode with a run time of 25:22?
SELECT "Viewers (in millions)" FROM table_24122 WHERE "Run time" = '25:22'
wikisql
CREATE TABLE table_17340355_10 ( team VARCHAR, high_points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Steve Nash (24) got high points for how many teams?
SELECT COUNT(team) FROM table_17340355_10 WHERE high_points = "Steve Nash (24)"
sql_create_context
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), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
SELECT PHONE_NUMBER, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY PHONE_NUMBER DESC
nvbench
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE course ( c...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (semester.semester = ...
advising
CREATE TABLE table_32592 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What day is north melbourne the away side?
SELECT "Date" FROM table_32592 WHERE "Away team" = 'north melbourne'
wikisql
CREATE TABLE table_name_61 ( cmp_att_int VARCHAR, gp_gs VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Cmp-Att-Int has a GP-GS of 3-0?
SELECT cmp_att_int FROM table_name_61 WHERE gp_gs = "3-0"
sql_create_context
CREATE TABLE table_18173916_8 ( friday VARCHAR, tuesday VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which episode was Transmitted on friday if the episode of '414 insanely twisted shadow planet' was transmitted on tuesday?
SELECT friday FROM table_18173916_8 WHERE tuesday = "414 Insanely Twisted Shadow Planet"
sql_create_context
CREATE TABLE browser ( id number, name text, market_share number ) CREATE TABLE accelerator_compatible_browser ( accelerator_id number, browser_id number, compatible_since_year number ) CREATE TABLE web_client_accelerator ( id number, name text, operating_system text, client te...
SELECT T3.name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id JOIN browser AS T3 ON T2.browser_id = T3.id WHERE T1.name = 'CACHEbox' INTERSECT SELECT T3.name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id...
spider
CREATE TABLE table_name_19 ( dob VARCHAR, surname VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When is mr. ryan's DOB?
SELECT dob FROM table_name_19 WHERE surname = "ryan"
sql_create_context
CREATE TABLE table_5294 ( "Season" text, "Champion" text, "Constructor" text, "Teams' Champion" text, "Secondary Class" text, "Nations Cup" text, "Winter Series Champion" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the Teams' Champ...
SELECT "Teams' Champion" FROM table_5294 WHERE "Season" = '1989'
wikisql
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, war...
SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 20 AND 29) AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY pres...
mimic_iii
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 course.department, course.name, course.number, program_course.workload FROM course, program, program_course WHERE program_course.course_id = course.course_id AND program.name LIKE 'CS-LSA' AND program.program_id = program_course.program_id
advising
CREATE TABLE table_39279 ( "Dance" text, "Best dancer(s)" text, "Best score" text, "Worst dancer(s)" text, "Worst score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the dance that has priscilla presley is the worst dancer(s), and the wors...
SELECT "Dance" FROM table_39279 WHERE "Worst dancer(s)" = 'priscilla presley' AND "Worst score" = '21'
wikisql
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE T...
SELECT pr.OwnerUserId, COUNT(pr.OwnerUserId) FROM Posts AS q, Posts AS a, Posts AS pr, Posts AS pt WHERE q.Id = a.ParentId AND a.OwnerUserId = pr.OwnerUserId AND pr.PostTypeId = 2 AND pr.ParentId = pt.Id AND pt.PostTypeId = 1 AND q.PostTypeId = 1 AND q.CreationDate BETWEEN '2017-01-01' AND '2017-01-31' AND NOT a.Parent...
sede
CREATE TABLE table_25468520_1 ( quantity VARCHAR, theme VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many times is the theme roadside attractions: wawa goose?
SELECT COUNT(quantity) FROM table_25468520_1 WHERE theme = "Roadside Attractions: Wawa Goose"
sql_create_context
CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) ...
SELECT meter_200, AVG(meter_100) FROM swimmer GROUP BY meter_200 ORDER BY meter_200 DESC
nvbench
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Hemododialysis hypotensn" AND prescriptions.drug_type = "MAIN"
mimicsql_data
CREATE TABLE table_name_52 ( total INTEGER, nation VARCHAR, bronze VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Total, when the Nation is Sweden, and when the value for Bronze is less than 3?
SELECT AVG(total) FROM table_name_52 WHERE nation = "sweden" AND bronze < 3
sql_create_context
CREATE TABLE table_203_125 ( id number, "club" text, "winners" number, "runner-ups" number, "winning years" text, "runner-up years" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many times has sk sturm graz been the runner ups ?
SELECT "runner-ups" FROM table_203_125 WHERE "club" = 'sk sturm graz'
squall
CREATE TABLE table_name_42 ( to_par VARCHAR, country VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which To par has a Country of united states, and a Player of dave stockton?
SELECT to_par FROM table_name_42 WHERE country = "united states" AND player = "dave stockton"
sql_create_context
CREATE TABLE products ( product_id text, product_name text, product_price number, product_description text, other_product_service_details text ) CREATE TABLE order_items ( order_item_id number, order_id number, product_id number, order_quantity text, other_item_details text ) C...
SELECT marketing_region_code FROM drama_workshop_groups GROUP BY marketing_region_code ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_55391 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score of the game on February 27 with New Jersey as the visitor team?
SELECT "Score" FROM table_55391 WHERE "Visitor" = 'new jersey' AND "Date" = 'february 27'
wikisql
CREATE TABLE table_76663 ( "Season" text, "Series" text, "Team Name" text, "Races" text, "Wins" text, "Poles" text, "F.L." text, "Podiums" text, "Points" text, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the...
SELECT "Wins" FROM table_76663 WHERE "F.L." = '0' AND "Poles" = '0' AND "Position" = '7th' AND "Points" = '35'
wikisql
CREATE TABLE table_16121 ( "Year" real, "Division" real, "League" text, "Regular Season" text, "Playoffs" text, "Open Cup" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the league where regular season is 2nd, northwest
SELECT "League" FROM table_16121 WHERE "Regular Season" = '2nd, Northwest'
wikisql
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 t_kc24.t_kc21_OUT_DIAG_DIS_CD, t_kc24.t_kc21_OUT_DIAG_DIS_NM FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_NM = '朱同和' AND t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 9872.67)
css
CREATE TABLE table_name_17 ( opponent VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which opponent was present on April 14?
SELECT opponent FROM table_name_17 WHERE date = "april 14"
sql_create_context
CREATE TABLE table_18424435_3 ( title VARCHAR, production_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which episodes had production code 217?
SELECT title FROM table_18424435_3 WHERE production_code = 217
sql_create_context
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 JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '6526650' AND t_kc22.SOC_SRT_DIRE_NM = '蒲地蓝消炎口服液' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fgwyjzb.MED_SER_ORG_NO = '6526650' AND t_kc22.SOC_SR...
css
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_ORG_DEPT_CD, MED_ORG_DEPT_NM FROM t_kc22 WHERE STA_DATE BETWEEN '2000-08-12' AND '2018-10-18' AND MED_INV_ITEM_TYPE = '手术费' GROUP BY MED_ORG_DEPT_CD ORDER BY COUNT(*) LIMIT 12
css
CREATE TABLE table_name_86 ( nationality VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the nationality of Mattias Modig?
SELECT nationality FROM table_name_86 WHERE player = "mattias modig"
sql_create_context
CREATE TABLE table_56599 ( "Season" real, "Driver" text, "Co-Driver" text, "Team" text, "Tuner" text, "Governing Body" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the earliest season with driver Farad Bathena?
SELECT MIN("Season") FROM table_56599 WHERE "Driver" = 'farad bathena'
wikisql
CREATE TABLE table_10302 ( "Year" real, "Tournament" text, "Venue" text, "Result" text, "Extra" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the venue when the result is 2nd and extra is 4 x 100 m relay?
SELECT "Venue" FROM table_10302 WHERE "Result" = '2nd' AND "Extra" = '4 x 100 m relay'
wikisql
CREATE TABLE table_9156 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Country of the Player with a To par of 1?
SELECT "Country" FROM table_9156 WHERE "To par" = '–1'
wikisql
CREATE TABLE table_name_66 ( top_5 INTEGER, top_10 VARCHAR, wins VARCHAR, driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Frank Kimmel's lowest top 5 with more than 0 wins and fewer than 14 top 10s?
SELECT MIN(top_5) FROM table_name_66 WHERE wins > 0 AND driver = "frank kimmel" AND top_10 < 14
sql_create_context
CREATE TABLE table_52628 ( "Week" text, "Opponent" text, "Result" text, "Game site" text, "Time" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- I want to know the time which has attendance of 66,772
SELECT "Time" FROM table_52628 WHERE "Attendance" = '66,772'
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT diagnoses.long_title FROM diagnoses WHERE diagnoses.icd9_code = "2254"
mimicsql_data
CREATE TABLE activity ( actid number, activity_name text ) CREATE TABLE faculty_participates_in ( facid number, actid number ) CREATE TABLE faculty ( facid number, lname text, fname text, rank text, sex text, phone number, room text, building text ) CREATE TABLE studen...
SELECT activity_name FROM activity
spider
CREATE TABLE table_134729_3 ( format VARCHAR, owner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What station owns Moody Bible Institute
SELECT format FROM table_134729_3 WHERE owner = "Moody Bible Institute"
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_DIRE_CD text, MED_DIRE_NM text,...
SELECT t_kc22.CHA_ITEM_LEV FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '97296432367' AND t_kc22.SOC_SRT_DIRE_CD = '704404350'
css
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, C...
SELECT t_kc22.SOC_SRT_DIRE_NM, t_kc22.EACH_DOSAGE, t_kc22.USE_FRE FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '49113523818'
css
CREATE TABLE table_name_95 ( line VARCHAR, colour VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which line was green?
SELECT line FROM table_name_95 WHERE colour = "green"
sql_create_context
CREATE TABLE company ( company_id number, name text, headquarters text, industry text, sales_in_billion number, profits_in_billion number, assets_in_billion number, market_value_in_billion number ) CREATE TABLE employment ( company_id number, people_id number, year_working n...
SELECT headquarters, industry FROM company
spider
CREATE TABLE table_36632 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text ) -- Using valid SQLite, answer the following questions f...
SELECT "Tries for" FROM table_36632 WHERE "Points against" = '263'
wikisql
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ...
SELECT Score, COUNT(Score) AS "count" FROM Posts GROUP BY Score ORDER BY Score
sede
CREATE TABLE CHARACTERISTICS ( characteristic_id VARCHAR, characteristic_name VARCHAR ) CREATE TABLE product_characteristics ( product_id VARCHAR, characteristic_id VARCHAR ) CREATE TABLE products ( product_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t3.characteristic_name = "hot"
sql_create_context
CREATE TABLE Products_in_Events ( Product_ID VARCHAR ) CREATE TABLE Products ( Product_Name VARCHAR, Product_ID VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the names of products that are in at least two events.
SELECT T1.Product_Name FROM Products AS T1 JOIN Products_in_Events AS T2 ON T1.Product_ID = T2.Product_ID GROUP BY T1.Product_Name HAVING COUNT(*) >= 2
sql_create_context
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 78086) AND prescriptions.drug = 'metoprolol' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-6 month') ORDER BY prescriptions.startdate LIMIT 1
mimic_iii
CREATE TABLE table_38487 ( "Gloss" text, "Cholim" text, "Lungchang" text, "Rera" text, "Tikhak" text, "Yonguk" text, "Muklom" text, "Hakhun" text, "Halang" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Tikhak has a Yonguk of w...
SELECT "Tikhak" FROM table_38487 WHERE "Yonguk" = 'wu¹ti¹'
wikisql
CREATE TABLE table_train_106 ( "id" int, "gender" string, "pregnancy_or_lactation" bool, "mini_mental_state_examination_mmse" int, "uncontrolled_diabetes" bool, "blood_glucose" int, "rosen_modified_hachinski_ischemic_score" int, "body_mass_index_bmi" float, "age" float, "NOUSE" f...
SELECT * FROM table_train_106 WHERE rosen_modified_hachinski_ischemic_score >= 4
criteria2sql
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT All_Games, ACC_Percent FROM basketball_match ORDER BY ACC_Percent
nvbench
CREATE TABLE table_203_460 ( id number, "player" text, "played" number, "legs won" number, "legs lost" number, "lwat" number, "100+" number, "140+" number, "180s" number, "high checkout" number, "3-dart average" number ) -- Using valid SQLite, answer the following questions...
SELECT "legs lost" FROM table_203_460 WHERE "player" = 'james wade'
squall
CREATE TABLE table_45974 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the overall pick number for the player who was picked on round 8?
SELECT MIN("Overall") FROM table_45974 WHERE "Round" = '8'
wikisql
CREATE TABLE table_name_86 ( wins INTEGER, played VARCHAR, points VARCHAR, goals_against VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the average wins with a Points of 42-2, and Goals against of 67, and Played smaller than 44?
SELECT AVG(wins) FROM table_name_86 WHERE points = "42-2" AND goals_against = 67 AND played < 44
sql_create_context
CREATE TABLE table_23235767_4 ( year VARCHAR, score_in_the_final VARCHAR, surface VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of year for 6 3, 6 2 hard surface
SELECT COUNT(year) FROM table_23235767_4 WHERE score_in_the_final = "6–3, 6–2" AND surface = "Hard"
sql_create_context
CREATE TABLE body_builder ( body_builder_id number, people_id number, snatch number, clean_jerk number, total number ) CREATE TABLE people ( people_id number, name text, height number, weight number, birth_date text, birth_place text ) -- Using valid SQLite, answer the fol...
SELECT MIN(snatch) FROM body_builder
spider
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate n...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, COUNT(*) AS c1 FROM patient WHERE patient.patientunitstayid = (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'analgesics - oral analgesics' AND STRFTIME('%y', treatment.treatmenttime) <= '2103') GROUP BY patient.uniq...
eicu
CREATE TABLE table_62838 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score for king's cup 1996?
SELECT "Score" FROM table_62838 WHERE "Competition" = 'king''s cup 1996'
wikisql
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 Sex, SUM(Height) FROM people GROUP BY Sex ORDER BY SUM(Height) DESC
nvbench
CREATE TABLE table_name_97 ( interview INTEGER, state VARCHAR, swimsuit VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total for the state of new york and a swimsuit less than 9.394?
SELECT SUM(interview) FROM table_name_97 WHERE state = "new york" AND swimsuit < 9.394
sql_create_context
CREATE TABLE table_23285849_7 ( high_points VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had the most points in the game where the score was w 97 92 (ot)?
SELECT high_points FROM table_23285849_7 WHERE score = "W 97–92 (OT)"
sql_create_context
CREATE TABLE affected_region ( Region_id int, Storm_ID int, Number_city_affected real ) CREATE TABLE storm ( Storm_ID int, Name text, Dates_active text, Max_speed int, Damage_millions_USD real, Number_Deaths int ) CREATE TABLE region ( Region_id int, Region_code text, R...
SELECT Name, COUNT(*) FROM storm AS T1 JOIN affected_region AS T2 ON T1.Storm_ID = T2.Storm_ID GROUP BY T1.Storm_ID ORDER BY Name
nvbench
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, Crea...
SELECT YEAR(CreationDate) + (MONTH(CreationDate) / 12.0), COUNT(*) * 1.0 / (CASE WHEN YEAR(CreationDate) = YEAR(@maxdate) AND MONTH(CreationDate) = MONTH(@maxdate) THEN DAY(@maxdate) ELSE DAY(DATEADD(DD, -1, DATEADD(MM, DATEDIFF(MM, -1, CreationDate), 0))) END) FROM Posts WHERE ParentId IS NULL GROUP BY YEAR(CreationDa...
sede
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.admityear < "2103"
mimicsql_data
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREAT...
SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-26884')) AND intakeoutput.cellpath LIKE '%output%' AND D...
eicu