instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_204_881 ( id number, "round" number, "date" text, "score" text, "opponent" text, "opponent's score" text, "result" text, "venue" text, "attendance" number, "best on ground" text, "team" text ) -- Using valid SQLite, answer the following questions for the ...
SELECT COUNT(*) FROM table_204_881 WHERE "attendance" > 20000
squall
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid numb...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', lab.labresulttime)) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-13920' AND patient.hospi...
eicu
CREATE TABLE table_47537 ( "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 lowest laps that Vittorio Iannuzzo completed?
SELECT MIN("Laps") FROM table_47537 WHERE "Rider" = 'vittorio iannuzzo'
wikisql
CREATE TABLE table_name_11 ( team VARCHAR, city VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the team name for Chungju?
SELECT team FROM table_name_11 WHERE city = "chungju"
sql_create_context
CREATE TABLE table_name_67 ( player VARCHAR, college VARCHAR, pick VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Pick 3 Player from East College?
SELECT player FROM table_name_67 WHERE college = "east" AND pick = 3
sql_create_context
CREATE TABLE table_11222744_2 ( format VARCHAR, title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- where title is beginning callanetics , what is the total of format ?
SELECT COUNT(format) FROM table_11222744_2 WHERE title = "Beginning Callanetics"
sql_create_context
CREATE TABLE table_test_13 ( "id" int, "systolic_blood_pressure_sbp" int, "tachycardia" int, "diastolic_blood_pressure_dbp" int, "total_cholesterol" int, "high_density_lipoprotein_cholesterol_hdl_c" int, "serum_creatinine" float, "alcohol_abuse" bool, "drug_abuse" bool, "body_mas...
SELECT * FROM table_test_13 WHERE total_cholesterol < 200
criteria2sql
CREATE TABLE Organisations ( organisation_id INTEGER, organisation_type VARCHAR(10), organisation_details VARCHAR(255) ) CREATE TABLE Grants ( grant_id INTEGER, organisation_id INTEGER, grant_amount DECIMAL(19,4), grant_start_date DATETIME, grant_end_date DATETIME, other_details VAR...
SELECT T2.organisation_details, T1.organisation_id FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisation_id GROUP BY T2.organisation_details
nvbench
CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number...
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'DALLAS' AND ground_service.city_code = city.city_code
atis
CREATE TABLE table_54815 ( "Marginal Ordinary Income Tax Rate" text, "Single" text, "Married Filing Jointly or Qualified Widow(er)" text, "Married Filing Separately" text, "Head of Household" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the h...
SELECT "Head of Household" FROM table_54815 WHERE "Married Filing Jointly or Qualified Widow(er)" = '$137,051–$208,850'
wikisql
CREATE TABLE table_28210383_1 ( no__episode__number_ VARCHAR, directed_by VARCHAR, written_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What numbered episode was directed by greg colton and written by patrick meighan?
SELECT no__episode__number_ FROM table_28210383_1 WHERE directed_by = "Greg Colton" AND written_by = "Patrick Meighan"
sql_create_context
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE charte...
SELECT transfers.wardid FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13536 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 table_59141 ( "Statistic" text, "Name" text, "Total" text, "School" text, "Opponent" text, "Stage" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had the statistic of most assists?
SELECT "Name" FROM table_59141 WHERE "Statistic" = 'most assists'
wikisql
CREATE TABLE table_name_80 ( swimming VARCHAR, tennis VARCHAR, indoor_track VARCHAR, soccer VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is th eswimming status for the school that has yes on indoor track, soccer and tennis?
SELECT swimming FROM table_name_80 WHERE indoor_track = "yes" AND soccer = "yes" AND tennis = "yes"
sql_create_context
CREATE TABLE table_14747043_1 ( class_aAAA VARCHAR, class_aAAAA VARCHAR, Weslaco VARCHAR, school_year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the class AAAA when class AAAAA was Weslaco in 1994-95
SELECT class_aAAA FROM table_14747043_1 WHERE class_aAAAA = Weslaco AND school_year = "1994-95"
sql_create_context
CREATE TABLE table_74921 ( "Race" text, "Class(es)" text, "Length/Duration" text, "Circuit" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the classes for the circuit that has the Mazda Raceway Laguna Seca race.
SELECT "Class(es)" FROM table_74921 WHERE "Circuit" = 'mazda raceway laguna seca'
wikisql
CREATE TABLE customers ( customer_id number, customer_address_id number, customer_status_code text, date_became_customer time, date_of_birth time, first_name text, last_name text, amount_outstanding number, email_address text, phone_number text, cell_mobile_phone_number text ...
SELECT SUM(T1.lesson_time) FROM lessons AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = "Rylan" AND T2.last_name = "Goodwin"
spider
CREATE TABLE table_15962 ( "Song" text, "Mobiles" real, "Northern Ireland" real, "Northern England" real, "Scotland" real, "Southern England" real, "Wales" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many votes did W...
SELECT MIN("Wales") FROM table_15962 WHERE "Northern England" = '6'
wikisql
CREATE TABLE table_name_3 ( date VARCHAR, runner_s__up VARCHAR, tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Date has a Runner(s)-up of bernhard langer, and a Tournament of at&t championship?
SELECT date FROM table_name_3 WHERE runner_s__up = "bernhard langer" AND tournament = "at&t championship"
sql_create_context
CREATE TABLE table_name_40 ( class VARCHAR, capacity VARCHAR, navigator VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What class has a capacity smaller than 3384 for Ferguson?
SELECT class FROM table_name_40 WHERE capacity < 3384 AND navigator = "ferguson"
sql_create_context
CREATE TABLE table_name_15 ( position VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position does John Carlson play?
SELECT position FROM table_name_15 WHERE player = "john carlson"
sql_create_context
CREATE TABLE Documents ( Document_ID INTEGER, Document_Type_Code CHAR(15), Project_ID INTEGER, Document_Date DATETIME, Document_Name VARCHAR(255), Document_Description VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Documents_with_Expenses ( Document_ID INTEGER, Budget_Type_...
SELECT Document_Date, COUNT(Document_Date) FROM Documents AS T1 JOIN Projects AS T2 ON T1.Project_ID = T2.Project_ID WHERE T2.Project_Details = 'Graph Database project' GROUP BY Document_Name ORDER BY Document_Date DESC
nvbench
CREATE TABLE table_4240 ( "Train number" real, "Train name" text, "Origin" text, "Destination" text, "Service" text, "Route/Via." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the route for the destination of guruvayur?
SELECT "Route/Via." FROM table_4240 WHERE "Destination" = 'Guruvayur'
wikisql
CREATE TABLE table_25999 ( "Province" text, "Mahmoud Ahmadinejad" real, "Mehdi Karroubi" real, "Mir-Hossein Mousavi" real, "Mohsen Rezaee" real, "Spoiled ballots" real, "Total votes" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List all th...
SELECT "Total votes" FROM table_25999 WHERE "Spoiled ballots" = '3072'
wikisql
CREATE TABLE Staff ( Staff_ID INTEGER, Tourist_Attraction_ID INTEGER, Name VARCHAR(40), Other_Details VARCHAR(255) ) CREATE TABLE Visitors ( Tourist_ID INTEGER, Tourist_Details VARCHAR(255) ) CREATE TABLE Ref_Attraction_Types ( Attraction_Type_Code CHAR(15), Attraction_Type_Description...
SELECT Visit_Date, COUNT(Visit_Date) FROM Visits
nvbench
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 ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Coun...
SELECT meter_700, meter_100 FROM swimmer ORDER BY meter_100
nvbench
CREATE TABLE table_name_93 ( player VARCHAR, total VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What player from South Africa had a total less than 284?
SELECT player FROM table_name_93 WHERE total < 284 AND country = "south africa"
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TAB...
SELECT vitalperiodic.systemicdiastolic FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-163354')) AND NOT vitalperiodic.systemicdiast...
eicu
CREATE TABLE table_23289934_1 ( no_in_season INTEGER, production_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the most number in season for production code 3abc12
SELECT MAX(no_in_season) FROM table_23289934_1 WHERE production_code = "3ABC12"
sql_create_context
CREATE TABLE table_203_475 ( id number, "stage" number, "date" text, "route" text, "terrain" text, "length" text, "winner" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which routes were at least 100 km ?
SELECT "route" FROM table_203_475 WHERE "length" >= 100
squall
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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 ) C...
SELECT diagnoses.long_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Jerry Deberry"
mimicsql_data
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, Mark...
SELECT p.Id AS "post_link", p.Score, p.ViewCount, p.FavoriteCount, ROUND(p.FavoriteCount * 100.0 / p.ViewCount, 2) AS "favorites_per_view_(%)" FROM Posts AS p WHERE p.PostTypeId = 1 AND p.Score > 10 AND p.ViewCount > 200 ORDER BY ROUND(p.FavoriteCount * 100.0 / p.ViewCount, 2) DESC, p.ViewCount DESC
sede
CREATE TABLE table_41843 ( "Class" text, "Wheels" real, "Date" text, "Builder" text, "No. built" real, "1919 nos." text, "LMS Class" text, "LMS nos." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the value for the item 'Class' w...
SELECT "Class" FROM table_41843 WHERE "Wheels" = '137'
wikisql
CREATE TABLE table_2850912_12 ( position VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position does allister brown play.
SELECT position FROM table_2850912_12 WHERE player = "Allister Brown"
sql_create_context
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), ...
SELECT JOB_ID, AVG(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID
nvbench
CREATE TABLE table_67979 ( "7:00" text, "7:30" text, "8:00" text, "8:30" text, "9:00" text, "9:30" text, "10:00" text, "10:30" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What 10:00 has a 8:00 of movies?
SELECT "10:00" FROM table_67979 WHERE "8:00" = 'movies'
wikisql
CREATE TABLE Behavior_Incident ( incident_id INTEGER, incident_type_code VARCHAR(10), student_id INTEGER, date_incident_start DATETIME, date_incident_end DATETIME, incident_summary VARCHAR(255), recommendations VARCHAR(255), other_details VARCHAR(255) ) CREATE TABLE Ref_Detention_Type (...
SELECT date_address_to, AVG(monthly_rental) FROM Student_Addresses ORDER BY monthly_rental DESC
nvbench
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 jybgb ( BBCJBW text, BBDM tex...
SELECT jybgb.SQKS, jybgb.SQKSMC FROM jybgb WHERE jybgb.BGDH = '66533580315'
css
CREATE TABLE table_20495 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Bills points" real, "Opponents" real, "Bills first downs" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the minimum number of p...
SELECT MIN("Opponents") FROM table_20495 WHERE "Opponent" = 'Baltimore Colts'
wikisql
CREATE TABLE table_name_36 ( high_points VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were the high points on june 20?
SELECT high_points FROM table_name_36 WHERE date = "june 20"
sql_create_context
CREATE TABLE table_name_73 ( time VARCHAR, lane VARCHAR, nationality VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Time has a Lane smaller than 2, and a Nationality of spain?
SELECT time FROM table_name_73 WHERE lane < 2 AND nationality = "spain"
sql_create_context
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'diagnosis' AND cost.eventid IN (SELECT diagnosis.diagnosisid FROM diagnosis WHERE diagnosis.diagnosisname = 'eye injury - bilateral')
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 jyjgzbb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE person_info...
css
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', admissions.admittime)) FROM admissions WHERE admissions.subject_id = 10811 AND admissions.dischtime IS NULL
mimic_iii
CREATE TABLE table_26336 ( "Player" text, "GP-GS" text, "Min Avg" text, "FG-FGA" text, "FG Pct" text, "3FG-FGA" text, "3FG Pct" text, "FT-FTA" text, "FT Pct" text, "Reb" real, "Ast" real, "Blk" real, "Stl" real, "Pts" real, "Avg Pts" text ) -- Using valid SQ...
SELECT COUNT("FT Pct") FROM table_26336 WHERE "3FG-FGA" = '1-20'
wikisql
CREATE TABLE table_name_25 ( crowd INTEGER, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the attendance when Hawthorn played as home team?
SELECT SUM(crowd) FROM table_name_25 WHERE home_team = "hawthorn"
sql_create_context
CREATE TABLE table_name_23 ( result VARCHAR, competition VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the result of the Europe/Africa Group I, play-off competition?
SELECT result FROM table_name_23 WHERE competition = "europe/africa group i, play-off"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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,...
SELECT mzjzjlb.JZKSBM, mzjzjlb.JZKSMC FROM mzjzjlb WHERE mzjzjlb.JZLSH = '46372324753'
css
CREATE TABLE table_name_23 ( opponent VARCHAR, edition VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent for the 2003 davis cup europe/africa group ii?
SELECT opponent FROM table_name_23 WHERE edition = "2003 davis cup europe/africa group ii"
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "59" AND prescriptions.formulary_drug_cd = "TACRSUSP"
mimicsql_data
CREATE TABLE table_49644 ( "Governorate" text, "Seats 2010" real, "Seats 2005" real, "In/de-creased by" real, "Percentage in/de-crease" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the average In/de-creased by which has a Governorate of al an...
SELECT AVG("In/de-creased by") FROM table_49644 WHERE "Governorate" = 'al anbar governorate' AND "Seats 2005" < '9'
wikisql
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_id varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, ins...
SELECT DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.start_time > '10:00' AND course.course_id = course_offering.course_id AND course.department = 'SM' AND course.number = 437 AND semester.semester = 'WN' AND se...
advising
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm...
SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 4 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd...
mimic_iii
CREATE TABLE table_58006 ( "Singular abbreviation" text, "Singular Word" text, "Plural abbreviation" text, "Plural Word" text, "Discipline" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The plural word of hands uses what singular word?
SELECT "Singular Word" FROM table_58006 WHERE "Plural Word" = 'hands'
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 d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE proce...
SELECT admissions.subject_id FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'malig neo main bronchus') AND DATETIME(diagnoses_icd.charttime, 'start of ...
mimic_iii
CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE offering_instructor ( ...
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND NOT COURSE_0.course_id IN (SELECT STUDENT_RECORDalias0.course_id FROM student_record AS STUDENT_RECORDalias0 WHERE STUDENT...
advising
CREATE TABLE table_69684 ( "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 calvin o'neal, and a Round smaller than 6 had what number total overall?
SELECT COUNT("Overall") FROM table_69684 WHERE "Name" = 'calvin o''neal' AND "Round" < '6'
wikisql
CREATE TABLE table_1957 ( "Player" text, "Country" text, "Year(s) won" text, "R1" real, "R2" real, "R3" real, "R4" real, "Total" real, "To par" text, "Finish" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many times did Fiji...
SELECT COUNT("R1") FROM table_1957 WHERE "Country" = 'Fiji'
wikisql
CREATE TABLE table_name_90 ( year INTEGER, award VARCHAR, nominated_work VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the earliest year with a Drama Desk award when the Mineola Twins was a nominated work?
SELECT MIN(year) FROM table_name_90 WHERE award = "drama desk award" AND nominated_work = "the mineola twins"
sql_create_context
CREATE TABLE table_203_416 ( id number, "school name" text, "city" text, "grades" text, "establishment" number, "charter" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the first public middle school established in hawaii ?
SELECT "school name" FROM table_203_416 ORDER BY "establishment" LIMIT 1
squall
CREATE TABLE procedures ( 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 diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "NEWBORN" AND demographic.admission_location = "CLINIC REFERRAL/PREMATURE"
mimicsql_data
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABL...
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 = 'chf nos') AND DATE...
mimic_iii
CREATE TABLE table_name_27 ( term_expires VARCHAR, appointing_governor VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the expiring term for Daryl Hecht when the appointing governor is Tom Vilsack?
SELECT term_expires FROM table_name_27 WHERE appointing_governor = "tom vilsack" AND name = "daryl hecht"
sql_create_context
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_fro...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILA...
atis
CREATE TABLE table_name_62 ( opponent VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent on October 14, 1984?
SELECT opponent FROM table_name_62 WHERE date = "october 14, 1984"
sql_create_context
CREATE TABLE document_locations ( document_id number, location_code text, date_in_location_from time, date_in_locaton_to time ) CREATE TABLE ref_document_types ( document_type_code text, document_type_name text, document_type_description text ) CREATE TABLE ref_locations ( location_cod...
SELECT document_type_code FROM ref_document_types WHERE document_type_name = "Paper"
spider
CREATE TABLE table_21455 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What i...
SELECT "Record" FROM table_21455 WHERE "Date" = 'January 19'
wikisql
CREATE TABLE table_name_91 ( parentheses VARCHAR, dots VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the value for parentheses with a dots value of 0.\dot{6}?
SELECT parentheses FROM table_name_91 WHERE dots = "0.\dot{6}"
sql_create_context
CREATE TABLE train ( Train_ID int, Name text, Time text, Service text ) CREATE TABLE train_station ( Train_ID int, Station_ID int ) CREATE TABLE station ( Station_ID int, Name text, Annual_entry_exit real, Annual_interchanges real, Total_Passengers real, Location text, ...
SELECT Location, SUM(Total_Passengers) FROM station GROUP BY Location ORDER BY Location DESC
nvbench
CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE writes ( paperid int, ...
SELECT DISTINCT paper.paperid FROM author, paper, writes WHERE author.authorname = 'Su-In Lee' AND paper.year < 2012 AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
scholar
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.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.admityear < "2115"
mimicsql_data
CREATE TABLE table_name_67 ( top_division_debut VARCHAR, tournaments VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Top Division Debut, when Tournaments is '12', and when Name is 'Yamamotoyama'?
SELECT top_division_debut FROM table_name_67 WHERE tournaments = 12 AND name = "yamamotoyama"
sql_create_context
CREATE TABLE table_35918 ( "Year" real, "Location" text, "Gold" text, "Silver" text, "Bronze" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the earliest year that Park Jung-Ah won the gold?
SELECT MIN("Year") FROM table_35918 WHERE "Gold" = 'park jung-ah'
wikisql
CREATE TABLE table_name_48 ( college_junior_club_team__league_ VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What college or club team did Steve Jones play for?
SELECT college_junior_club_team__league_ FROM table_name_48 WHERE player = "steve jones"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Cyclic neutropenia" AND lab.flag = "delta"
mimicsql_data
CREATE TABLE table_203_88 ( id number, "language" text, "number" number, "percentage (%)" number, "males" number, "females" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which language had the most number of people speaking it .
SELECT "language" FROM table_203_88 ORDER BY "number" DESC LIMIT 1
squall
CREATE TABLE department ( dept_name text, building text, budget number ) CREATE TABLE prereq ( course_id text, prereq_id text ) CREATE TABLE student ( id text, name text, dept_name text, tot_cred number ) CREATE TABLE instructor ( id text, name text, dept_name text, ...
SELECT COUNT(DISTINCT s_id) FROM advisor
spider
CREATE TABLE table_name_68 ( status VARCHAR, against VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the status when the against is 11?
SELECT status FROM table_name_68 WHERE against = 11
sql_create_context
CREATE TABLE table_70083 ( "Date of Issue" text, "Theme" text, "Denomination" text, "Printer" text, "Quantity" text, "Design" text, "Perforation" text, "First Day Cover Cancellation" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which d...
SELECT "Design" FROM table_70083 WHERE "Theme" = 'alpine skiing'
wikisql
CREATE TABLE table_name_8 ( crowd INTEGER, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the attendance when Fitzroy played as the away team?
SELECT AVG(crowd) FROM table_name_8 WHERE away_team = "fitzroy"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SNF" AND demographic.diagnosis = "ANGIOEDEMA"
mimicsql_data
CREATE TABLE table_name_91 ( draw INTEGER, performer VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many draws did gary o'shaughnessy have?
SELECT SUM(draw) FROM table_name_91 WHERE performer = "gary o'shaughnessy"
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 regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END...
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY SUM(MANAGER_ID) DESC
nvbench
CREATE TABLE jybgb_jyjgzbb ( JYZBLSH number, YLJGDM text, jyjgzbb_id number ) 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...
SELECT * FROM jyjgzbb WHERE jyjgzbb.JCZBMC = (SELECT jyjgzbb.JCZBMC FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '83775208631') AND jyjgzbb.JCZBJGDW = (SELECT jyjgzbb.JCZBJGDW FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '83775208631') AND jyjgzbb.JCZBJGDL <= (SELECT jyjgzbb.JCZBJGDL FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '83775208631')
css
CREATE TABLE table_26117 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Attendance" real, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is every date with a record of 30 34 12?
SELECT "Date" FROM table_26117 WHERE "Record" = '30–34–12'
wikisql
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 COUNT(*) > 0 FROM admissions WHERE admissions.subject_id = 18677 AND admissions.admission_location = 'emergency room admit' AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')
mimic_iii
CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE time_zone ( time_zone_code tex...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'COLU...
atis
CREATE TABLE table_name_87 ( water_depth VARCHAR, location VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the water depth in the Gulf of Mexico named Discoverer Clear Leader?
SELECT water_depth FROM table_name_87 WHERE location = "gulf of mexico" AND name = "discoverer clear leader"
sql_create_context
CREATE TABLE table_33754 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the attendance of the game on December 13, 1970?
SELECT COUNT("Attendance") FROM table_33754 WHERE "Date" = 'december 13, 1970' AND "Week" > '13'
wikisql
CREATE TABLE table_17323092_7 ( high_points VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had the high points on the date February 10?
SELECT high_points FROM table_17323092_7 WHERE date = "February 10"
sql_create_context
CREATE TABLE table_35285 ( "Date" text, "Opponents" text, "Venue" text, "Result" text, "Score F\u2013A" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Score F A of 3 0, and a Date of 31 july 2007 had what opponents?
SELECT "Opponents" FROM table_35285 WHERE "Score F\u2013A" = '3–0' AND "Date" = '31 july 2007'
wikisql
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM txmzjzjlb JOIN jybgb JOIN jyjgzbb ON txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE txmzjzjlb.JZZDSM = '结膜炎' AND jyjgzbb.JCZBMC = '超敏甲状...
css
CREATE TABLE teachers ( lastname text, firstname text, classroom number ) CREATE TABLE list ( lastname text, firstname text, grade number, classroom number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the first names of students study...
SELECT DISTINCT firstname FROM list WHERE classroom = 107
spider
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
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 = '006-232560')) AND intakeoutput.cellpath LIKE '%output%' AND ...
eicu
CREATE TABLE table_66032 ( "Pick" real, "Player" text, "Country of origin*" text, "PBA team" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Richard Bachmann's PBA team?
SELECT "PBA team" FROM table_66032 WHERE "Player" = 'richard bachmann'
wikisql
CREATE TABLE table_32652 ( "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 largest crowd when the home team sco...
SELECT MAX("Crowd") FROM table_32652 WHERE "Home team score" = '14.12 (96)'
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 Products ( product_id INTEGER, product_details VARCHAR(255) ) CREATE TABLE Customer_Addresses ( custome...
SELECT date_became_customer, COUNT(date_became_customer) FROM Customers WHERE customer_id BETWEEN 10 AND 20 ORDER BY COUNT(date_became_customer)
nvbench
CREATE TABLE table_27067379_1 ( position VARCHAR, building VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many positions does building Costanera Center Torre 1 have?
SELECT COUNT(position) FROM table_27067379_1 WHERE building = "Costanera Center Torre 1"
sql_create_context
CREATE TABLE table_204_121 ( id number, "year" text, "game" text, "developer" text, "setting" text, "platform" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what game is listed before dodgy dealer in 1984 ?
SELECT "game" FROM table_204_121 WHERE id = (SELECT id FROM table_204_121 WHERE "game" = 'dodgy dealer') - 1
squall
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int,...
SELECT DISTINCT instructor.name 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_offering.course_id INNER JOIN offering_instructor ON offering_instr...
advising