instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_57838 ( "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 was the home score when the away team score...
SELECT "Home team" FROM table_57838 WHERE "Away team score" = '16.11 (107)'
wikisql
CREATE TABLE table_16579 ( "#" real, "Episode" text, "Rating" text, "Share" real, "Rating/Share (18-49)" text, "Viewers (millions)" text, "Rank (timeslot)" real, "Rank (night)" real, "Rank (week)" text ) -- Using valid SQLite, answer the following questions for the tables provided ...
SELECT MIN("Rank (night)") FROM table_16579 WHERE "Viewers (millions)" = '5.25'
wikisql
CREATE TABLE table_name_30 ( year INTEGER, reg_season VARCHAR, division VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Year is the highest one that has a Reg Season of 3rd, western, and a Division larger than 2?
SELECT MAX(year) FROM table_name_30 WHERE reg_season = "3rd, western" AND division > 2
sql_create_context
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE days ( days_code varchar, ...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CINCINNATI' AND date_day.day_number = 23 AND date_day.month_number = 4 AN...
atis
CREATE TABLE table_9931 ( "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's the average round for the OT position from tulane college with an overall over 38?...
SELECT AVG("Round") FROM table_9931 WHERE "Position" = 'ot' AND "College" = 'tulane' AND "Overall" > '38'
wikisql
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) 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 ) ...
SELECT t3.drug FROM (SELECT t2.drug, 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 WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_...
mimic_iii
CREATE TABLE table_73921 ( "Outcome" text, "No." text, "Date" text, "Championship" text, "Surface" text, "Opponent in the final" text, "Score in the final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The score in the final is 2 6, 6 2, 6 ...
SELECT "Surface" FROM table_73921 WHERE "Score in the final" = '2–6, 6–2, 6–0'
wikisql
CREATE TABLE table_46640 ( "Tournament" text, "Surface" text, "Week" text, "Winners" text, "Finalists" text, "Semifinalists" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Tournament, when Week is November 23?
SELECT "Tournament" FROM table_46640 WHERE "Week" = 'november 23'
wikisql
CREATE TABLE table_63502 ( "Iteration" text, "Year" real, "Dates" text, "Location" text, "Theme" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Location of the 'My Pacific' Theme?
SELECT "Location" FROM table_63502 WHERE "Theme" = 'my pacific'
wikisql
CREATE TABLE Sportsinfo ( StuID VARCHAR ) CREATE TABLE Student ( StuID VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show student ids who don't have any sports.
SELECT StuID FROM Student EXCEPT SELECT StuID FROM Sportsinfo
sql_create_context
CREATE TABLE table_46089 ( "Year" real, "Dates" text, "Champion" text, "Country" text, "Winning score" text, "To par" text, "Margin of victory" text, "Tournament location" text, "Purse ( $ )" text, "Winner's share ($)" text ) -- Using valid SQLite, answer the following question...
SELECT "Tournament location" FROM table_46089 WHERE "Country" = 'south korea'
wikisql
CREATE TABLE table_15972 ( "Formula" text, "Notation" text, "T c (K)" real, "No. of Cu-O planes in unit cell" real, "Crystal structure" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the crystal structure for the formula yba 2 cu 3 o 7?
SELECT "Crystal structure" FROM table_15972 WHERE "Formula" = 'YBa 2 Cu 3 O 7'
wikisql
CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_...
SELECT DISTINCT aircraft.aircraft_code FROM aircraft, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, equipment_sequence, flight WHERE (((((flight.arrival_time < 41 OR flight.time_elapsed >= 60) AND flight.departure_time > flight.arrival_time) ...
atis
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 WHERE demographic.marital_status = "MARRIED" AND demographic.admityear < "2194"
mimicsql_data
CREATE TABLE table_40341 ( "Venue" text, "Location" text, "Capacity" text, "Owner" text, "Environment" text, "Year Built" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was transamerica field built in?
SELECT "Year Built" FROM table_40341 WHERE "Venue" = 'transamerica field'
wikisql
CREATE TABLE table_16381914_1 ( affiliation VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What affiliation is Erie, Pennsylvania?
SELECT affiliation FROM table_16381914_1 WHERE location = "Erie, Pennsylvania"
sql_create_context
CREATE TABLE table_204_498 ( id number, "location" text, "building" text, "year" number, "km" number, "monument" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which location has the most km ?
SELECT "location" FROM table_204_498 ORDER BY "km" DESC LIMIT 1
squall
CREATE TABLE table_name_79 ( drawn INTEGER, goals_for VARCHAR, lost VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For entries with lost larger than 21 and goals for smaller than 36, what is the average drawn?
SELECT AVG(drawn) FROM table_name_79 WHERE goals_for < 36 AND lost > 21
sql_create_context
CREATE TABLE table_25981 ( "Season" real, "Series" text, "Team" text, "Races" real, "Wins" real, "Poles" real, "F/Laps" real, "Podiums" real, "Points" text, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many seaso...
SELECT COUNT("Season") FROM table_25981 WHERE "Team" = 'Motopark'
wikisql
CREATE TABLE table_name_16 ( dubose_porter VARCHAR, roy_barnes VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the DuBose Porter with Roy Barnes at 54%?
SELECT dubose_porter FROM table_name_16 WHERE roy_barnes = "54%"
sql_create_context
CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress ...
WITH closed_cte AS (SELECT t.TagName AS tag, COUNT(q.Id) AS totalcount, COUNT(q.ClosedDate) AS closedcount, ROUND(COUNT(q.ClosedDate) * 100.0 / COUNT(q.Id), 2) AS percentage FROM Posts AS q INNER JOIN PostTags AS pt ON q.Id = pt.PostId INNER JOIN Tags AS t ON pt.TagId = t.Id WHERE q.PostTypeId = 1 GROUP BY t.TagName) S...
sede
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 HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history)
nvbench
CREATE TABLE table_462 ( "Name" text, "Pennant" text, "Builder" text, "Laid Down" text, "Launched" text, "Commissioned" text, "Fate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the pennant for 4 may 1943?
SELECT "Pennant" FROM table_462 WHERE "Laid Down" = '4 May 1943'
wikisql
CREATE TABLE table_1341522_36 ( status VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many districts are respresented by Alex McMillan?
SELECT COUNT(status) FROM table_1341522_36 WHERE incumbent = "Alex McMillan"
sql_create_context
CREATE TABLE table_38752 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Ground" text, "Crowd" real, "Date" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the home team score...
SELECT "Home team score" FROM table_38752 WHERE "Home team" = 'essendon'
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 demographic.dod, demographic.admittime FROM demographic WHERE demographic.subject_id = "15898"
mimicsql_data
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_500, ID FROM swimmer ORDER BY meter_500 DESC
nvbench
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 jyjgzbb.JCZBMC, jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM jybgb JOIN jyjgzbb ON jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE jybgb.JZLSH = '42183982937' AND jyjgzbb.JCRXM LIKE '尤%'
css
CREATE TABLE table_name_53 ( grid VARCHAR, laps VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What grid features 6 laps?
SELECT grid FROM table_name_53 WHERE laps = 6
sql_create_context
CREATE TABLE table_29554 ( "Season" text, "Points per Game" text, "Total Yards per Game" text, "Rushing Yards per Game" text, "Passing Yards per Game" text, "Sacks" text, "Interceptions" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is...
SELECT "Passing Yards per Game" FROM table_29554 WHERE "Rushing Yards per Game" = '113.6'
wikisql
CREATE TABLE tweets ( id number, uid number, text text, createdate time ) CREATE TABLE user_profiles ( uid number, name text, email text, partitionid number, followers number ) CREATE TABLE follows ( f1 number, f2 number ) -- Using valid SQLite, answer the following quest...
SELECT COUNT(DISTINCT uid) FROM tweets
spider
CREATE TABLE table_69979 ( "Name" text, "Date of Execution" text, "Crime" text, "Method" text, "Race" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How was the native american executed in July 1836?
SELECT "Method" FROM table_69979 WHERE "Race" = 'native american' AND "Date of Execution" = 'july 1836'
wikisql
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 cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 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 ...
mimic_iii
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), ...
SELECT HIRE_DATE, SALARY FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY HIRE_DATE DESC
nvbench
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE lab ( labid number, pa...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT medication.patientunitstayid FROM medication WHERE medication.drugname = 'sodium chloride 0.9%')
eicu
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc21_t_kc22.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '朱高翰' AND t_kc21.MED_SER_ORG_NO = '2154200' AND t_kc21.IN_HOSP_DATE BETWEEN '2020-01-25' AND '2021-09-15')
css
CREATE TABLE table_name_86 ( interview INTEGER, state VARCHAR, average VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest interview of Texas, with an average larger than 9.531?
SELECT MIN(interview) FROM table_name_86 WHERE state = "texas" AND average > 9.531
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 WHERE demographic.expire_flag = "0" AND demographic.dob_year < "2126"
mimicsql_data
CREATE TABLE table_name_56 ( median_household_income VARCHAR, median_family_income VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Median household income associated with a median family income of $46,616?
SELECT median_household_income FROM table_name_56 WHERE median_family_income = "$46,616"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2166" AND procedures.long_title = "Exteriorization of small intestine"
mimicsql_data
CREATE TABLE table_71533 ( "name" text, "type" text, "elevation" text, "USGS Map" text, "GNIS ID" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which name has a USGS Map of clear lake?
SELECT "name" FROM table_71533 WHERE "USGS Map" = 'clear lake'
wikisql
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT zyjybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE person_info.XM = '何阳夏' ...
css
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.PERSON_NM = '沈清妍' AND gwyjzb.MED_SER_ORG_NO = '6343102' AND gwyjzb.MED_ORG_DEPT_NM LIKE '%产前诊断%' UNION SELECT * FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '沈清妍' AND fgwyjzb.MED_SER_ORG_NO = '6343102' AND fgwyjzb.MED_ORG_DEPT_NM LIKE '%产前诊断%'
css
CREATE TABLE table_28753 ( "Episode number (Production number)" text, "Title" text, "Original air date" text, "Total viewers on FX" text, "Total viewers on FX+" text, "Total viewers" text, "Rank on channel" text ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT "Total viewers on FX+" FROM table_28753 WHERE "Total viewers" = '583,000'
wikisql
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, ...
SELECT DATEADD(month, DATEDIFF(month, 0, CreationDate), 0) AS "month", COUNT(q.Id) AS NumQuests FROM Posts AS q INNER JOIN PostTags AS pt ON q.Id = pt.PostId INNER JOIN Tags AS t ON t.Id = pt.TagId WHERE q.PostTypeId = 1 AND q.CreationDate >= '2016-01-01 00:00:00' AND t.TagName IN (@Tag1) GROUP BY DATEADD(month, DATEDI...
sede
CREATE TABLE table_73716 ( "Year" text, "Superintendent" text, "Middlesex Principal" text, "Gorham Principal" text, "Middle School Principal" text, "High School Principal" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many years was lynn mu...
SELECT COUNT("Year") FROM table_73716 WHERE "High School Principal" = 'Lynn Muscarella' AND "Superintendent" = 'Charlie Wiltse'
wikisql
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_typ...
SELECT (SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8016)) AND DATETIME(inputevents_cv.charttime, 'start of month') = DATETIME(CURRENT...
mimic_iii
CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT ) CREATE TABLE status ( station_id INTEGER, bikes_available INTEGER, docks_available INTEGER, time TEXT ) CREATE TABLE weather ( date TEXT, ...
SELECT date, COUNT(date) FROM weather WHERE max_temperature_f >= 80 GROUP BY date
nvbench
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Routine circumcision" AND prescriptions.route = "NG"
mimicsql_data
CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text, ZYLBDM text, ZYMC text ) CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH ...
SELECT JZZTDM, JZZTMC FROM mzjzjlb WHERE JZLSH = '01573441264'
css
CREATE TABLE student ( ID varchar(5), name varchar(20), dept_name varchar(20), tot_cred numeric(3,0) ) CREATE TABLE time_slot ( time_slot_id varchar(4), day varchar(1), start_hr numeric(2), start_min numeric(2), end_hr numeric(2), end_min numeric(2) ) CREATE TABLE prereq ( ...
SELECT dept_name, COUNT(*) FROM student GROUP BY dept_name ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_26323 ( "Episode number Production number" text, "Title" text, "Original airing" text, "Rating" text, "Share" real, "Rating/share (18\u201349)" text, "Total viewers (in millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above....
SELECT "Total viewers (in millions)" FROM table_26323 WHERE "Rating" = '9.1'
wikisql
CREATE TABLE table_75802 ( "Name" text, "Novelty" text, "Status" text, "Authors" text, "Location" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Status of the dinosaur, whose notes are, 'n coelurosauria'?
SELECT "Status" FROM table_75802 WHERE "Notes" = 'n coelurosauria'
wikisql
CREATE TABLE table_5188 ( "Maryland Counties" text, "Fall 05" real, "Fall 06" real, "Fall 07" real, "Fall 08" real, "Fall 09" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of all values in Fall 09 in Allegany county with Fall 07...
SELECT SUM("Fall 09") FROM table_5188 WHERE "Maryland Counties" = 'allegany' AND "Fall 07" < '751'
wikisql
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE procedures_icd ( row_id number, subject_id nu...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'tromethamine') AS t1 JOIN (SELECT admissions.subject_id, prescrip...
mimic_iii
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE procedures_icd ( r...
SELECT (SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19175)) AND STRFTIME('%y-%m-%d', inputevents_cv.charttime) = '2105-11-04') - (SELE...
mimic_iii
CREATE TABLE table_76804 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the attendance when the Cincinnati Bengals were the opponents?
SELECT "Attendance" FROM table_76804 WHERE "Opponent" = 'cincinnati bengals'
wikisql
CREATE TABLE table_51492 ( "Games" text, "Gold" text, "Silver" text, "Bronze" text, "Total" text, "Rank" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many golds were there in a game that has 17 bronze and a total of 31?
SELECT "Gold" FROM table_51492 WHERE "Bronze" = '17' AND "Total" = '31'
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ...
SELECT demographic.admittime, procedures.icd9_code FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "2560"
mimicsql_data
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 admissions ( row_id number, subject_id number, hadm_id number, admittime time, dis...
SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FR...
mimic_iii
CREATE TABLE table_3456 ( "Year" real, "Starts" real, "Wins" real, "Top 5" real, "Top 10" real, "Poles" real, "Avg. Start" text, "Avg. Finish" text, "Winnings" text, "Position" text, "Team(s)" text ) -- Using valid SQLite, answer the following questions for the tables provi...
SELECT "Top 10" FROM table_3456 WHERE "Team(s)" = '#10 Phil Parsons Racing' AND "Avg. Finish" = '22.9'
wikisql
CREATE TABLE table_name_65 ( score VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score on August 19?
SELECT score FROM table_name_65 WHERE date = "august 19"
sql_create_context
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 transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
SELECT transfers.wardid FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 81783 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND NOT transfers.wardid IS NULL ORDER BY transfers.intime DESC LIMIT 1
mimic_iii
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 (SELECT COUNT(*) FROM hz_info JOIN mzjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM AND p...
css
CREATE TABLE table_name_16 ( engine VARCHAR, tire VARCHAR, sponsor VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the engine of the goodyear tire and Herdez as a sponsor?
SELECT engine FROM table_name_16 WHERE tire = "goodyear" AND sponsor = "herdez"
sql_create_context
CREATE TABLE table_78578 ( "Rider" text, "Bike" text, "Laps" real, "Time" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the time of Troy Bayliss with less than 8 grids?
SELECT "Time" FROM table_78578 WHERE "Grid" < '8' AND "Rider" = 'troy bayliss'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, ic...
SELECT MAX(vitalperiodic.sao2) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-13127')) AND NOT vitalperiodic.sao2 IS NULL AND DATET...
eicu
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 instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE cour...
SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%Other%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_c...
advising
CREATE TABLE table_name_71 ( date VARCHAR, event VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Date for the Event ept copenhagen?
SELECT date FROM table_name_71 WHERE event = "ept copenhagen"
sql_create_context
CREATE TABLE table_7587 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did the Chargers play the Denver Broncos before Week 10?
SELECT "Date" FROM table_7587 WHERE "Week" < '10' AND "Opponent" = 'denver broncos'
wikisql
CREATE TABLE table_name_95 ( result VARCHAR, game_site VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of the game played at Jeppesen Stadium?
SELECT result FROM table_name_95 WHERE game_site = "jeppesen stadium"
sql_create_context
CREATE TABLE staff ( staff_id number, staff_gender text, staff_name text ) CREATE TABLE order_items ( order_item_id number, order_id number, product_id number ) CREATE TABLE customer_addresses ( customer_id number, address_id number, date_from time, date_to time ) CREATE TABLE...
SELECT product_id, product_name FROM products WHERE product_price < 600 OR product_price > 900
spider
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 JOB_ID, AVG(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY AVG(MANAGER_ID) DESC
nvbench
CREATE TABLE farm_competition ( competition_id number, year number, theme text, host_city_id number, hosts text ) CREATE TABLE competition_record ( competition_id number, farm_id number, rank number ) CREATE TABLE city ( city_id number, official_name text, status text, ...
SELECT official_name, status FROM city ORDER BY population DESC LIMIT 1
spider
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 jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE departments ( DEP...
SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history)
nvbench
CREATE TABLE table_67200 ( "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 score with a place of t6 for the player k.j. choi?
SELECT "Score" FROM table_67200 WHERE "Place" = 't6' AND "Player" = 'k.j. choi'
wikisql
CREATE TABLE campuses ( id number, campus text, location text, county text, year number ) CREATE TABLE enrollments ( campus number, year number, totalenrollment_ay number, fte_ay number ) CREATE TABLE discipline_enrollments ( campus number, discipline number, year numbe...
SELECT t1.campusfee FROM csu_fees AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t2.campus = "San Francisco State University" AND t1.year = 2000
spider
CREATE TABLE table_75339 ( "Station" text, "Services" text, "Local authority" text, "Zone 2007" text, "Zone 2008" text, "Zone 2010" text, "Zone 2013" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Services have a Local authority of chi...
SELECT "Services" FROM table_75339 WHERE "Local authority" = 'chiltern' AND "Zone 2010" = '9'
wikisql
CREATE TABLE table_204_25 ( id number, "rank" number, "mountain peak" text, "mountain range" text, "elevation" text, "prominence" text, "isolation" text, "location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which is taller , mount h...
SELECT "mountain peak" FROM table_204_25 WHERE "mountain peak" IN ('mount humphreys', 'mount kaweah') ORDER BY "elevation" DESC LIMIT 1
squall
CREATE TABLE Ref_Payment_Methods ( payment_method_code CHAR(10), payment_method_description VARCHAR(80) ) CREATE TABLE Services ( Service_ID INTEGER, Service_Type_Code CHAR(15), Workshop_Group_ID INTEGER, Product_Description VARCHAR(255), Product_Name VARCHAR(255), Product_Price DECIMAL...
SELECT payment_method_code, COUNT(*) FROM Invoices GROUP BY payment_method_code ORDER BY COUNT(*)
nvbench
CREATE TABLE table_name_28 ( place VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Place has a Player of tony jacklin?
SELECT place FROM table_name_28 WHERE player = "tony jacklin"
sql_create_context
CREATE TABLE table_name_49 ( overall VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was petter ronnquist picked?
SELECT overall FROM table_name_49 WHERE player = "petter ronnquist"
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugst...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.wardid = 508 AND STRFTIME('%y', patient.unitadmittime) >= '2102'
eicu
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 mzjzjlb.JZZDBM, mzjzjlb.JZZDSM FROM hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLS...
css
CREATE TABLE table_55855 ( "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 Home team with a crowd relevant to f...
SELECT "Crowd" FROM table_55855 WHERE "Home team" = 'footscray'
wikisql
CREATE TABLE table_24603 ( "Week" real, "Date" text, "Opponent" text, "Location" text, "Final Score" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the final score when the game was @ roughriders?
SELECT "Final Score" FROM table_24603 WHERE "Opponent" = '@ Roughriders'
wikisql
CREATE TABLE table_1557974_1 ( ring_name VARCHAR, current_rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which ring names are currently ranked f0 j ry 3 west?
SELECT ring_name FROM table_1557974_1 WHERE current_rank = "f0 Jūryō 3 West"
sql_create_context
CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year 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, ...
SELECT Country, COUNT(*) FROM stadium GROUP BY Country ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
SELECT COUNT(*), at.TagName FROM PostTags AS a JOIN PostTags AS b ON (a.PostId = b.PostId) JOIN Tags AS at ON (a.TagId = at.Id) JOIN Tags AS bt ON (b.TagId = bt.Id) WHERE bt.TagName = 'homework' AND at.TagName != 'homework' GROUP BY at.TagName ORDER BY 1 DESC
sede
CREATE TABLE table_44162 ( "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 sum of round 3?
SELECT SUM("Overall") FROM table_44162 WHERE "Round" = '3'
wikisql
CREATE TABLE table_77471 ( "Team" text, "Athletes" text, "Run 1" text, "Run 2" text, "Run 3" text, "Run 4" text, "Final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Run 4 has a Run 1 of 1:25.82?
SELECT "Run 4" FROM table_77471 WHERE "Run 1" = '1:25.82'
wikisql
CREATE TABLE table_23408094_14 ( span_of_years_led INTEGER, tournament_at_which_lead_began VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Of the players whose lead began at the australian championships, what was the shortest span of years led?
SELECT MIN(span_of_years_led) FROM table_23408094_14 WHERE tournament_at_which_lead_began = "Australian Championships"
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 jybgb.BBCJBW FROM hz_info JOIN txmzjzjlb JOIN jybgb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '53751020' AND jybgb.BGRQ BETWEEN '2000-10-30' AND '200...
css
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 qtb.OUT_DIAG_DIS_CD, qtb.OUT_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_NM = '郑丽容' AND qtb.MED_SER_ORG_NO = '5352405' AND qtb.OUT_DIAG_DOC_NM LIKE '沈%' UNION SELECT gyb.OUT_DIAG_DIS_CD, gyb.OUT_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_NM = '郑丽容' AND gyb.MED_SER_ORG_NO = '5352405' AND gyb.OUT_DIAG_DOC_NM LIKE '沈%' UNION ...
css
CREATE TABLE table_train_63 ( "id" int, "immune_suppression" bool, "leukocyte_count" int, "need_hemodialysis" bool, "head_injury" bool, "periodic_paralysis" bool, "renal_disease" bool, "glasgow_come_score_gcs" int, "sepsis" bool, "pancreatitis" bool, "enteral_feeding" bool, ...
SELECT * FROM table_train_63 WHERE head_injury = 1 AND glasgow_come_score_gcs <= 5
criteria2sql
CREATE TABLE table_204_524 ( id number, "season" text, "tier" number, "division" text, "place" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which division were they in the most ?
SELECT "division" FROM table_204_524 GROUP BY "division" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE table_200_1 ( id number, "year" number, "title" text, "role" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the name of the movie where mischa barton plays the role of ms. monica ?
SELECT "title" FROM table_200_1 WHERE "role" = 'ms. monica'
squall
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT Headquarter, AVG(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter
nvbench
CREATE TABLE table_name_61 ( production_company VARCHAR, producer_s_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For which production company did Sam Mccarthy produce?
SELECT production_company FROM table_name_61 WHERE producer_s_ = "sam mccarthy"
sql_create_context
CREATE TABLE Courses ( course_id INTEGER, author_id INTEGER, subject_id INTEGER, course_name VARCHAR(120), course_description VARCHAR(255) ) CREATE TABLE Students ( student_id INTEGER, date_of_registration DATETIME, date_of_latest_logon DATETIME, login_name VARCHAR(40), password...
SELECT login_name, author_id FROM Course_Authors_and_Tutors ORDER BY personal_name
nvbench