instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, ...
SELECT (SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'lung contu...
mimic_iii
CREATE TABLE table_43883 ( "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 Country, when Player is 'Jack Nicklaus'?
SELECT "Country" FROM table_43883 WHERE "Player" = 'jack nicklaus'
wikisql
CREATE TABLE table_11206787_5 ( capacity INTEGER, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the minimum capacity where airdrie united is?
SELECT MIN(capacity) FROM table_11206787_5 WHERE team = "Airdrie United"
sql_create_context
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, Crea...
SELECT Id, Body FROM Posts WHERE CommentCount = 0 AND AnswerCount = 0 AND Tags LIKE '%eclipse%'
sede
CREATE TABLE film_actor ( actor_id number, film_id number, last_update time ) CREATE TABLE category ( category_id number, name text, last_update time ) CREATE TABLE store ( store_id number, manager_staff_id number, address_id number, last_update time ) CREATE TABLE country ( ...
SELECT COUNT(*) FROM city AS T1 JOIN country AS T2 ON T1.country_id = T2.country_id WHERE T2.country = 'Australia'
spider
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
SELECT 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.person_info_XM = '孙丹红' AND hz_info.YLJGDM = '9381500' AND mzjzjlb.JZKSMC LIKE '%产%'
css
CREATE TABLE ftxmzjzjlb ( 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, MZZYZD...
SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb 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 AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '张...
css
CREATE TABLE Scientists ( SSN int, Name Char(30) ) CREATE TABLE AssignedTo ( Scientist int, Project char(4) ) CREATE TABLE Projects ( Code Char(4), Name Char(50), Hours int ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the ...
SELECT T2.Name, COUNT(T2.Name) FROM AssignedTo AS T1 JOIN Projects AS T2 ON T1.Project = T2.Code JOIN Scientists AS T3 ON T1.Scientist = T3.SSN WHERE T3.Name LIKE '%Smith%' GROUP BY T2.Name ORDER BY COUNT(T2.Name)
nvbench
CREATE TABLE table_47804 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" real, "Finish" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Player, when Year(s) Won is 1978 , 1985?
SELECT "Player" FROM table_47804 WHERE "Year(s) won" = '1978 , 1985'
wikisql
CREATE TABLE table_28243691_1 ( enrollment INTEGER, founded VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the highest number of students in attendance for the institution that started in 1923.
SELECT MAX(enrollment) FROM table_28243691_1 WHERE founded = 1923
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 jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE job_history ( EMPLO...
SELECT EMAIL, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMPLOYEE_ID
nvbench
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb...
css
CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE faculty_participates_in ( facid number, actid number ) CREATE TABLE participates_in ( stuid number, actid number ) CREATE TABL...
SELECT facid FROM faculty_participates_in INTERSECT SELECT advisor FROM student
spider
CREATE TABLE table_22831 ( "DMA" real, "Market" text, "Station" text, "Frequency" text, "Branding" text, "Format" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which branding has the format of southern country?
SELECT "Branding" FROM table_22831 WHERE "Format" = 'Southern Country'
wikisql
CREATE TABLE table_name_93 ( event VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the Event of sudesh peiris?
SELECT event FROM table_name_93 WHERE name = "sudesh peiris"
sql_create_context
CREATE TABLE table_42486 ( "Rank" real, "Province" text, "Population" real, "Area" real, "Density" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Density that has a Population larger than 290,458, and an Area of 91.6?
SELECT SUM("Density") FROM table_42486 WHERE "Population" > '290,458' AND "Area" = '91.6'
wikisql
CREATE TABLE table_61672 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What To par has a Place of t2, and a Country of united states?
SELECT "To par" FROM table_61672 WHERE "Place" = 't2' AND "Country" = 'united states'
wikisql
CREATE TABLE table_33913 ( "Year" real, "Championship" text, "Winning score" text, "Margin" text, "Runner(s)-up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Championship had a Winning score of 6 & 5?
SELECT "Championship" FROM table_33913 WHERE "Winning score" = '6 & 5'
wikisql
CREATE TABLE fzzmzjzjlb ( 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, MZZYZD...
SELECT * FROM hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i...
css
CREATE TABLE Participates_in ( stuid INTEGER, actid INTEGER ) CREATE TABLE Faculty_Participates_in ( FacID INTEGER, actid INTEGER ) CREATE TABLE Faculty ( FacID INTEGER, Lname VARCHAR(15), Fname VARCHAR(15), Rank VARCHAR(15), Sex VARCHAR(1), Phone INTEGER, Room VARCHAR(5), ...
SELECT Sex, COUNT(*) FROM Faculty GROUP BY Sex ORDER BY Sex
nvbench
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2053" AND prescriptions.route = "IVPCA"
mimicsql_data
CREATE TABLE table_63584 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the home team for the game with attendance larger than 59,064 and a record of ...
SELECT "Home" FROM table_63584 WHERE "Attendance" > '59,064' AND "Record" = '7-4-0'
wikisql
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
SELECT wdmzjzjlb.JZLSH FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '37451168' AND NOT wdmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2000-10-07') UNION SELECT bdmzjzjlb.JZLSH FROM hz_info JOIN...
css
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswer...
SELECT * FROM Posts INNER JOIN PostTags ON Posts.Id = PostTags.PostId INNER JOIN Tags ON PostTags.TagId = Tags.Id WHERE DATEDIFF(day, Posts.CreationDate, GETDATE()) < 60
sede
CREATE TABLE table_14736 ( "Unit" text, "Reactor type" text, "Net capacity" text, "Gross capacity" text, "Construction started" text, "Electricity grid" text, "Commercial operation" text, "Shutdown" text ) -- Using valid SQLite, answer the following questions for the tables provided ab...
SELECT "Reactor type" FROM table_14736 WHERE "Commercial operation" = '—' AND "Unit" = 'tianwan-7'
wikisql
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '魏初雪' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2004-09-03' AND '2009-03-08' AND t_kc22.MED_INV_ITEM_TYPE = '手术费'
css
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE hz_info ( KH text, KLX number...
SELECT jybgb.BBCJBW FROM jybgb WHERE jybgb.BGDH = '62752967258'
css
CREATE TABLE table_2679061_7 ( college_junior_club_team VARCHAR, pick__number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many teams got pick number 130?
SELECT COUNT(college_junior_club_team) FROM table_2679061_7 WHERE pick__number = 130
sql_create_context
CREATE TABLE table_name_62 ( population VARCHAR, official_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is saint-andr 's population?
SELECT population FROM table_name_62 WHERE official_name = "saint-andré"
sql_create_context
CREATE TABLE table_204_103 ( id number, "medal" text, "name" text, "sport" text, "event" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- in what sport did india win the most silver medals ?
SELECT "sport" FROM table_204_103 GROUP BY "sport" ORDER BY COUNT("medal") DESC LIMIT 1
squall
CREATE TABLE table_name_83 ( accreditation_status VARCHAR, product_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Accreditation Status, when the Product Name is LG RCS-e Client?
SELECT accreditation_status FROM table_name_83 WHERE product_name = "lg rcs-e client"
sql_create_context
CREATE TABLE table_11785 ( "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 is the highest crowd when fitzroy is the ho...
SELECT MAX("Crowd") FROM table_11785 WHERE "Home team" = 'fitzroy'
wikisql
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT * FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '1303547' AND gwyjzb.IN_HOSP_DATE BETWEEN '2003-02-21' AND '2005-09-08' UNION SELECT * FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '1303547' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2003-02-21' AND '2005-09-08' EXCEPT SELECT * FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '130354...
css
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test...
SELECT COUNT(*) = 0 FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE course.department = 'CHE'...
advising
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "1" AND diagnoses.short_title = "Pseudomonas infect NOS"
mimicsql_data
CREATE TABLE table_100 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What college did Calvin McCarty play at?
SELECT "College" FROM table_100 WHERE "Player" = 'Calvin McCarty'
wikisql
CREATE TABLE table_2655016_4 ( nick_prod__number INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest Nick production number?
SELECT MIN(nick_prod__number) FROM table_2655016_4
sql_create_context
CREATE TABLE table_18155 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Results" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many elections have resulted in retired democratic hold?
SELECT COUNT("Party") FROM table_18155 WHERE "Results" = 'Retired Democratic hold'
wikisql
CREATE TABLE Customers ( customer_id INTEGER, payment_method VARCHAR(15), customer_name VARCHAR(80), date_became_customer DATETIME, other_customer_details VARCHAR(255) ) CREATE TABLE Customer_Addresses ( customer_id INTEGER, address_id INTEGER, date_address_from DATETIME, address_ty...
SELECT date_became_customer, COUNT(date_became_customer) FROM Customers WHERE customer_id BETWEEN 10 AND 20 ORDER BY COUNT(date_became_customer) DESC
nvbench
CREATE TABLE ship ( ship_id number, name text, type text, built_year number, class text, flag text ) CREATE TABLE captain ( captain_id number, name text, ship_id number, age text, class text, rank text ) -- Using valid SQLite, answer the following questions for the tab...
SELECT rank FROM captain GROUP BY rank ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_42451 ( "Year" real, "Team" text, "Chassis" text, "Engine" text, "Rank" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which engine has a chassis of dallara, is ranked 6th, and has 384 points?
SELECT "Engine" FROM table_42451 WHERE "Chassis" = 'dallara' AND "Rank" = '6th' AND "Points" = '384'
wikisql
CREATE TABLE table_44340 ( "Team" text, "Tries for" text, "Tries against" text, "Try diff" text, "Points for" text, "Points against" text, "Points diff" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Points for number of the team...
SELECT "Points for" FROM table_44340 WHERE "Tries against" = '10'
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 intakeoutput ( in...
SELECT COUNT(DISTINCT patient.patientunitstayid) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-18714') AND DATETIME(patient.unitadmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')
eicu
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime...
SELECT lab.labname FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '003-39001')) AND DATETIME(lab.labresulttime, 'start of year') = DATETIME(CURRENT_TIME(), ...
eicu
CREATE TABLE table_204_749 ( id number, "courthouse" text, "city" text, "street address" text, "jurisdiction" text, "dates of use" text, "named for" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- where is the location -lrb- city -rrb- of t...
SELECT "city" FROM table_204_749 ORDER BY id DESC LIMIT 1
squall
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, a...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.wardid = 888 AND DATETIME(patient.unitadmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')
eicu
CREATE TABLE table_80303 ( "Year" text, "Winner" text, "Country" text, "Score" text, "Margin" text, "Runner(s)-up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the runner-up when the year was 2008?
SELECT "Runner(s)-up" FROM table_80303 WHERE "Year" = '2008'
wikisql
CREATE TABLE table_name_77 ( date_of_appointment VARCHAR, outgoing_manager VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was outgoing manager Zolt n Varga appointed?
SELECT date_of_appointment FROM table_name_77 WHERE outgoing_manager = "zoltán varga"
sql_create_context
CREATE TABLE table_15852257_1 ( races INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest value for race?
SELECT MAX(races) FROM table_15852257_1
sql_create_context
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE diagnoses_icd ( row_id n...
SELECT COUNT(DISTINCT admissions.hadm_id) FROM admissions WHERE admissions.subject_id = 72647 AND STRFTIME('%y', admissions.admittime) >= '2102'
mimic_iii
CREATE TABLE table_name_91 ( tries_against INTEGER, points_against VARCHAR, tries_for VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Tries against that have a Points against of 95 and Tries for larger than 20?
SELECT SUM(tries_against) FROM table_name_91 WHERE points_against = 95 AND tries_for > 20
sql_create_context
CREATE TABLE drivers ( forename VARCHAR, surname VARCHAR, driverid VARCHAR ) CREATE TABLE laptimes ( driverid VARCHAR, milliseconds INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the forename and surname of all distinct drivers who once had...
SELECT DISTINCT T1.forename, T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds < 93000
sql_create_context
CREATE TABLE table_36379 ( "Game" real, "March" real, "Opponent" text, "Score" text, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Game has a March smaller than 12, and a Score of 10 1?
SELECT MIN("Game") FROM table_36379 WHERE "March" < '12' AND "Score" = '10–1'
wikisql
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_labitems ( row_id number, itemid numbe...
SELECT t2.drug FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 10425 AND diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.s...
mimic_iii
CREATE TABLE table_15621965_1 ( nationality VARCHAR, no VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the nationality of number 9
SELECT nationality FROM table_15621965_1 WHERE no = 9
sql_create_context
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_Home, School_ID FROM basketball_match GROUP BY ACC_Home, All_Home
nvbench
CREATE TABLE table_30065 ( "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. -- How ma...
SELECT COUNT("Location Attendance") FROM table_30065 WHERE "Date" = 'January 11'
wikisql
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost numb...
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 18841 AND admissions.admission_location = 'emergency room admit' AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY admissions.admittime LIMIT 1
mimic_iii
CREATE TABLE table_name_95 ( lost INTEGER, goals_scored VARCHAR, played VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average value for Lost, when the value for Goals Scored is greater than 20, and when the value for Played is less than 18?
SELECT AVG(lost) FROM table_name_95 WHERE goals_scored > 20 AND played < 18
sql_create_context
CREATE TABLE table_203_102 ( id number, "event" text, "performance" text, "athlete" text, "nation" text, "place" text, "date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- is the best time for the 100 m more or less than the time for the 11...
SELECT (SELECT "performance" FROM table_203_102 WHERE "event" = '100 m') > (SELECT "performance" FROM table_203_102 WHERE "event" = '110 m hurdles')
squall
CREATE TABLE table_4335 ( "Region" text, "Date" text, "Format" text, "Label" text, "Edition(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the format for worldwide region july 22, 2008
SELECT "Format" FROM table_4335 WHERE "Region" = 'worldwide' AND "Date" = 'july 22, 2008'
wikisql
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
SELECT * FROM Posts AS p JOIN PostTags AS pt ON p.Id = pt.PostId JOIN Tags AS t ON pt.TagId = t.Id WHERE t.TagName IN ('azure-active-directory', 'azure-ad-b2c', 'azure-ad-graph-api', 'adal', 'microsoft-account') AND p.PostTypeId = 1
sede
CREATE TABLE election ( election_id number, representative_id number, date text, votes number, vote_percent number, seats number, place number ) CREATE TABLE representative ( representative_id number, name text, state text, party text, lifespan text ) -- Using valid SQ...
SELECT MIN(vote_percent), MAX(vote_percent) FROM election
spider
CREATE TABLE table_name_59 ( upper_index_kcal__nm_3 VARCHAR, fuel_gas VARCHAR, lower_index_mj__nm_3 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Upper index Kcal/ Nm 3 of iso-butane, and a Lower index MJ/ Nm 3 smaller than 84.71?
SELECT COUNT(upper_index_kcal__nm_3) FROM table_name_59 WHERE fuel_gas = "iso-butane" AND lower_index_mj__nm_3 < 84.71
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 * FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '86686346' AND hz_info.YLJGDM = '4252595' AND zyjzjlb.JZKSMC LIKE '%针灸%'
css
CREATE TABLE musical ( Musical_ID int, Name text, Year int, Award text, Category text, Nominee text, Result text ) CREATE TABLE actor ( Actor_ID int, Name text, Musical_ID int, Character text, Duration text, age int ) -- Using valid SQLite, answer the following que...
SELECT Nominee, COUNT(Nominee) FROM musical WHERE Award = "Tony Award" OR Award = "Cleavant Derricks" GROUP BY Nominee ORDER BY COUNT(Nominee) DESC
nvbench
CREATE TABLE table_name_54 ( language VARCHAR, director VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Language Director of nagisa oshima use in his film?
SELECT language FROM table_name_54 WHERE director = "nagisa oshima"
sql_create_context
CREATE TABLE table_22043925_1 ( denomination VARCHAR, school VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is every denomination for the school Seymour college?
SELECT denomination FROM table_22043925_1 WHERE school = "Seymour College"
sql_create_context
CREATE TABLE table_78557 ( "Position" real, "Club" text, "Played" real, "Points" real, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real ) -- Using valid SQLite, answer the following questions for the tables provided above....
SELECT MIN("Wins") FROM table_78557 WHERE "Goal Difference" > '0' AND "Goals against" > '40' AND "Position" < '6' AND "Club" = 'sd indauchu'
wikisql
CREATE TABLE table_204_634 ( id number, "tour" number, "official title" text, "venue" text, "city" text, "date\nstart" text, "date\nfinish" text, "prize money\nusd" number, "report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- does...
SELECT (SELECT "prize money\nusd" FROM table_204_634 WHERE "official title" = 'malaysia open super series') > (SELECT "prize money\nusd" FROM table_204_634 WHERE "official title" = 'french super series')
squall
CREATE TABLE market ( Market_ID int, District text, Num_of_employees int, Num_of_shops real, Ranking int ) CREATE TABLE phone ( Name text, Phone_ID int, Memory_in_G int, Carrier text, Price real ) CREATE TABLE phone_market ( Market_ID int, Phone_ID text, Num_of_stoc...
SELECT Carrier, SUM(Memory_in_G) FROM phone GROUP BY Carrier
nvbench
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE l...
SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '017-88691') 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_203_363 ( id number, "city\n2010 census" text, "chinese" text, "built-up area" number, "urban area" number, "level" text, "administrative area" number, "province-level division" text, "remarks" text ) -- Using valid SQLite, answer the following questions for the ...
SELECT "city\n2010 census" FROM table_203_363 ORDER BY "built-up area" DESC LIMIT 1
squall
CREATE TABLE table_44485 ( "Team" text, "Tries for" text, "Tries against" text, "Try diff" text, "Points for" text, "Points against" text, "Points diff" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Tries Against, when Points Agains...
SELECT "Tries against" FROM table_44485 WHERE "Points against" = '213'
wikisql
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Na...
SELECT Title, Score, Id FROM Posts WHERE PostTypeId = 1 AND Title LIKE '%stat%' ORDER BY Score DESC
sede
CREATE TABLE table_name_84 ( opponent VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Opponent has a Time of 4:51?
SELECT opponent FROM table_name_84 WHERE time = "4:51"
sql_create_context
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 patient ( uniquep...
SELECT SUM(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 = '016-18150')) AND intakeoutput.cellpath LIKE '%ou...
eicu
CREATE TABLE table_name_11 ( type VARCHAR, moving_from VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the type of the player moving from belgrano?
SELECT type FROM table_name_11 WHERE moving_from = "belgrano"
sql_create_context
CREATE TABLE table_name_31 ( bluetooth VARCHAR, model VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Does the s35 model have bluetooth?
SELECT bluetooth FROM table_name_31 WHERE model = "s35"
sql_create_context
CREATE TABLE table_29141354_4 ( first_broadcast VARCHAR, jamie_and_johns_guest VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When id the episode broadcast with Mark Webber as Jamie and John's guest?
SELECT first_broadcast FROM table_29141354_4 WHERE jamie_and_johns_guest = "Mark Webber"
sql_create_context
CREATE TABLE table_16371 ( "No. in series" real, "No. in season" real, "Title" text, "Director" text, "Writer(s)" text, "Original air date" text, "Production code" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who's the writer for the episo...
SELECT "Writer(s)" FROM table_16371 WHERE "Production code" = '2395114'
wikisql
CREATE TABLE table_name_25 ( attendance VARCHAR, week VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the attendance for the game held on September 18, 1994, with a week less than 5?
SELECT attendance FROM table_name_25 WHERE week < 5 AND date = "september 18, 1994"
sql_create_context
CREATE TABLE table_name_21 ( other VARCHAR, christianity VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the other value associated with a Christianity value of 10.24%?
SELECT other FROM table_name_21 WHERE christianity = "10.24%"
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 t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_CD, MIN(t_kc24.PER_EXP) FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.MED_SER_ORG_NO = '8257985' GROUP BY t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_...
css
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistoryTypes ( Id numb...
SELECT Posts.Id AS "post_link", Posts.ViewCount, TagSynonyms.SourceTagName AS "Its tag...", TagSynonyms.TargetTagName AS "...is a synonym of" FROM TagSynonyms, Tags, PostTags, Posts WHERE Tags.TagName = TagSynonyms.SourceTagName AND PostTags.TagId = Tags.Id AND Posts.Id = PostTags.PostId ORDER BY Posts.ViewCount DESC, ...
sede
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 Height, Weight FROM people
nvbench
CREATE TABLE table_61106 ( "Year" real, "Award" text, "Category" text, "Nominated Work" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the result for the Outer Critics Circle award earlier than 2004?
SELECT "Result" FROM table_61106 WHERE "Award" = 'outer critics circle award' AND "Year" < '2004'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "V667" AND prescriptions.route = "TP"
mimicsql_data
CREATE TABLE table_35934 ( "Round" real, "Pick" real, "Player" text, "Position" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest round of Ed Smith, who had a pick higher than 261 and played halfback?
SELECT MAX("Round") FROM table_35934 WHERE "Pick" < '261' AND "Position" = 'halfback' AND "Player" = 'ed smith'
wikisql
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE ...
SELECT COUNT(*) > 0 FROM semester WHERE NOT semester IN (SELECT DISTINCT SEMESTERalias1.semester FROM course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias1 WHERE COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id AND COURSEalias0.department = 'ENDODONT' AND COURSEalias0.numb...
advising
CREATE TABLE table_name_29 ( listed VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date was the bridge located in McClain listed?
SELECT listed FROM table_name_29 WHERE location = "mcclain"
sql_create_context
CREATE TABLE table_19229 ( "Country/Territory" text, "Former pageant" text, "Last competed" real, "New pageant" text, "Franchise since" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many new pageants does Aruba have?
SELECT COUNT("New pageant") FROM table_19229 WHERE "Country/Territory" = 'Aruba'
wikisql
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT t_kc22.t_kc21_MED_SER_ORG_NO FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '尤修远' AND t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_NM = '拉莫三嗪片')
css
CREATE TABLE table_name_30 ( overall VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much Overall has a Name of bob anderson?
SELECT COUNT(overall) FROM table_name_30 WHERE name = "bob anderson"
sql_create_context
CREATE TABLE table_name_2 ( time VARCHAR, nfl_recap VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the time of the game that had an NFL recap and a result of W 22 16?
SELECT time FROM table_name_2 WHERE nfl_recap = "recap" AND result = "w 22–16"
sql_create_context
CREATE TABLE table_name_95 ( played INTEGER, position VARCHAR, drawn VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Played has a Drawn of 5, and a Team of palmeiras, and a Position smaller than 6?
SELECT MAX(played) FROM table_name_95 WHERE drawn = 5 AND team = "palmeiras" AND position < 6
sql_create_context
CREATE TABLE table_23474 ( "#" real, "Title" text, "Maneater" text, "Television Premiere" text, "DVD release" text, "Writer" text, "Director" text, "Producer" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many numbers have Charles S...
SELECT MIN("#") FROM table_23474 WHERE "Producer" = 'Charles Salmon' AND "Television Premiere" = 'January 27, 2007'
wikisql
CREATE TABLE table_27257896_2 ( working_force_of_hk VARCHAR, nepalese VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the nepalese is 37.1%, what is the working force of HK?
SELECT working_force_of_hk FROM table_27257896_2 WHERE nepalese = "37.1%"
sql_create_context
CREATE TABLE table_name_82 ( elected VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the 1st member elected in 1620/21?
SELECT 1 AS st_member FROM table_name_82 WHERE elected = "1620/21"
sql_create_context
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE month ( month_number int, ...
SELECT DISTINCT airline_code FROM airline WHERE airline_code = 'FF'
atis