instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) 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 jobs ( JOB_ID varchar(...
SELECT LAST_NAME, MANAGER_ID FROM employees
nvbench
CREATE TABLE table_1459 ( "Institution" text, "Location" text, "Nickname" text, "Enrollment" real, "Established" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the enrollment for the Cavaliers?
SELECT MAX("Enrollment") FROM table_1459 WHERE "Nickname" = 'Cavaliers'
wikisql
CREATE TABLE table_55510 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many grids had more than 61 laps?
SELECT SUM("Grid") FROM table_55510 WHERE "Laps" > '61'
wikisql
CREATE TABLE table_name_23 ( length VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the length of the race on August 15?
SELECT length FROM table_name_23 WHERE date = "august 15"
sql_create_context
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT MED_SER_ORG_NO FROM t_kc21 WHERE PERSON_NM = '秦雅惠' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE SOC_SRT_DIRE_NM = '多糖铁复合物胶囊')
css
CREATE TABLE table_55044 ( "Tournament" text, "1980" text, "1981" text, "1982" text, "1983" text, "1984" text, "1985" text, "1986" text, "1987" text, "1988" text, "1989" text, "1990" text, "1991" text, "1992" text, "1993" text, "1994" text, "1995" text...
SELECT "1988" FROM table_55044 WHERE "1987" = '1r'
wikisql
CREATE TABLE flight ( id int, Vehicle_Flight_number text, Date text, Pilot text, Velocity real, Altitude real, airport_id int, company_id int ) CREATE TABLE operate_company ( id int, name text, Type text, Principal_activities text, Incorporated_in text, Group_Equ...
SELECT T1.name, T1.id FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id
nvbench
CREATE TABLE aircraft ( aid number, name text, distance number ) CREATE TABLE certificate ( eid number, aid number ) CREATE TABLE employee ( eid number, name text, salary number ) CREATE TABLE flight ( flno number, origin text, destination text, distance number, de...
SELECT T2.name FROM flight AS T1 JOIN aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid HAVING COUNT(*) >= 2
spider
CREATE TABLE table_15417 ( "Season" text, "Games" real, "Lost" real, "Tied" real, "Points" real, "Goals for" real, "Goals against" real, "Standing" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the most games for standing of 5th, l...
SELECT MAX("Games") FROM table_15417 WHERE "Standing" = '5th, lebel' AND "Goals against" > '220' AND "Lost" > '52'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE medication ( medicationid n...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'therapeutic antibacterials - vancomycin' AND DATETIME(treatment.treatment...
eicu
CREATE TABLE table_name_65 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What shows for 2002 when 2006 is Grand Slam Tournaments?
SELECT 2002 FROM table_name_65 WHERE 2006 = "grand slam tournaments"
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 inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number...
SELECT COUNT(DISTINCT 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 = 'other apnea of newborn') AND DATETIME(diagnoses_icd.chartt...
mimic_iii
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND prescriptions.drug_type = "MAIN"
mimicsql_data
CREATE TABLE table_29494395_3 ( originalair_date VARCHAR, director VARCHAR, writer VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the original air date when the director is Rowan Woods and the writer is Peter Duncan?
SELECT originalair_date FROM table_29494395_3 WHERE director = "Rowan Woods" AND writer = "Peter Duncan"
sql_create_context
CREATE TABLE table_17120964_7 ( man_of_the_match VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the man of the match when they lost 2-4?
SELECT man_of_the_match FROM table_17120964_7 WHERE result = "Lost 2-4"
sql_create_context
CREATE TABLE endowment ( endowment_id int, School_id int, donator_name text, amount real ) CREATE TABLE School ( School_id text, School_name text, Location text, Mascot text, Enrollment int, IHSAA_Class text, IHSAA_Football_Class text, County text ) CREATE TABLE budget ...
SELECT County, COUNT(*) FROM School GROUP BY County
nvbench
CREATE TABLE table_name_13 ( leading_scorer VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the leading scorer for april 12, 2008
SELECT leading_scorer FROM table_name_13 WHERE date = "april 12, 2008"
sql_create_context
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit te...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.wardid = 8 AND DATETIME(transfers.intime) <= DATETIME(CURRENT_TIME(), '-2 year'))
mimic_iii
CREATE TABLE zzmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
SELECT COUNT(*) FROM zzmzjzjlb WHERE zzmzjzjlb.ZZYSGH = '21581460' AND zzmzjzjlb.JZKSRQ BETWEEN '2002-10-01' AND '2016-07-05' UNION SELECT COUNT(*) FROM fzzmzjzjlb WHERE fzzmzjzjlb.ZZYSGH = '21581460' AND fzzmzjzjlb.JZKSRQ BETWEEN '2002-10-01' AND '2016-07-05'
css
CREATE TABLE table_name_44 ( game INTEGER, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest game number with a record of 16-7-2?
SELECT MIN(game) FROM table_name_44 WHERE record = "16-7-2"
sql_create_context
CREATE TABLE table_26943 ( "Name" text, "Position" text, "Period" text, "Appearances\u00b9" real, "Goals\u00b9" real, "Nationality\u00b2" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What positions correspond to the name Thierry Morin?
SELECT "Position" FROM table_26943 WHERE "Name" = 'Thierry Morin'
wikisql
CREATE TABLE table_204_828 ( id number, "whitworth size (in)" number, "core diameter (in)" number, "threads per inch" number, "pitch (in)" number, "tapping drill size" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the total of the first...
SELECT SUM("core diameter (in)") FROM table_204_828 WHERE id <= 2
squall
CREATE TABLE table_14003020_5 ( average INTEGER, highest VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the minimum average with highest being 2363
SELECT MIN(average) FROM table_14003020_5 WHERE highest = 2363
sql_create_context
CREATE TABLE table_72636 ( "Rank" real, "Country/Territory" text, "Miss World" real, "1st Runner-up" real, "2nd Runner-up" real, "3rd Runner-up" real, "4th Runner-up" real, "5th Runner-up" real, "6th Runner-up" real, "Semifinalists" real, "Total" real ) -- Using valid SQLit...
SELECT "Total" FROM table_72636 WHERE "5th Runner-up" = '2' AND "3rd Runner-up" = '0'
wikisql
CREATE TABLE table_name_44 ( industry INTEGER, agriculture INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Industry, when Agriculture is greater than 11?
SELECT AVG(industry) FROM table_name_44 WHERE agriculture > 11
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "58" AND lab.fluid = "Urine"
mimicsql_data
CREATE TABLE table_204_940 ( id number, "year" number, "tournaments\nplayed" number, "cuts\nmade" number, "wins" number, "2nd" number, "3rd" number, "top 10s" number, "best\nfinish" text, "earnings\n(\u20ac)" number, "money\nlist rank" number, "scoring\naverage" number, ...
SELECT "year" FROM table_204_940 ORDER BY "scoring\naverage" LIMIT 1
squall
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "27" AND diagnoses.long_title = "Tietze's disease"
mimicsql_data
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 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', intakeoutput.intakeoutputtime)) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid =...
eicu
CREATE TABLE table_75838 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest Total with a Rank that is smaller than 4 and a Nation of tunisia (tun) w...
SELECT MAX("Total") FROM table_75838 WHERE "Rank" < '4' AND "Nation" = 'tunisia (tun)' AND "Gold" < '2'
wikisql
CREATE TABLE table_45187 ( "Date" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" text, "Competition" text, "Man of the Match" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the attendance of the match on the 2nd wit...
SELECT "Attendance" FROM table_45187 WHERE "Opponent" = 'slough jets' AND "Date" = '2nd'
wikisql
CREATE TABLE table_39806 ( "Airline" text, "ICAO" text, "IATA" text, "Callsign" text, "Commenced operations" real, "Fleet size" real, "Headquarters" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which ICAO has a Commenced operations larger ...
SELECT "ICAO" FROM table_39806 WHERE "Commenced operations" > '2011'
wikisql
CREATE TABLE table_204_652 ( id number, "title" text, "year" number, "director" text, "country" text, "genre" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the total number of lesbian , gay , bisexual , or transgender ...
SELECT COUNT("title") FROM table_204_652
squall
CREATE TABLE table_44018 ( "Team" text, "Driver" text, "Class" text, "Chassis" text, "Rounds" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many rounds did Nil Montserrat drive in?
SELECT "Rounds" FROM table_44018 WHERE "Driver" = 'nil montserrat'
wikisql
CREATE TABLE table_name_45 ( date VARCHAR, winner VARCHAR, competition_round VARCHAR, venue VARCHAR, season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date did Universitario win the Torneo Apertura round after 2003 at Estadio Alejandr...
SELECT date FROM table_name_45 WHERE venue = "estadio alejandro villanueva" AND season > 2003 AND competition_round = "torneo apertura" AND winner = "universitario"
sql_create_context
CREATE TABLE table_71104 ( "Date" text, "Time" text, "Score" text, "Set 1" text, "Set 2" text, "Set 3" text, "Total" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Set 3 has a Time of 10:00, and a Set 2 of 25 19?
SELECT "Set 3" FROM table_71104 WHERE "Time" = '10:00' AND "Set 2" = '25–19'
wikisql
CREATE TABLE table_14961 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the least attendance for 52-37 record
SELECT MIN("Attendance") FROM table_14961 WHERE "Record" = '52-37'
wikisql
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE cost ( row_id number, ...
SELECT chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13536)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial...
mimic_iii
CREATE TABLE table_name_88 ( total_goals INTEGER, league_cup_goals VARCHAR, playoff_apps VARCHAR, fa_cup_apps VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many total goals did the squad with 2 playoff apps, 2 FA Cup Apps, and 0 League Cup goals...
SELECT SUM(total_goals) FROM table_name_88 WHERE playoff_apps = "2" AND fa_cup_apps = "2" AND league_cup_goals < 0
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 countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0),...
SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(DEPARTMENT_ID) DESC
nvbench
CREATE TABLE table_2093995_1 ( stations VARCHAR, parking VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which station has park & ride lot parking?
SELECT stations FROM table_2093995_1 WHERE parking = "Park & Ride Lot"
sql_create_context
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE...
SELECT c.Id AS "comment_link" FROM Comments AS c WHERE c.Text LIKE '%racias%' AND LENGTH(c.Text) < 20 ORDER BY c.CreationDate LIMIT 1000
sede
CREATE TABLE table_45042 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country was the player with the score line 69-71-72-69=281 from?
SELECT "Country" FROM table_45042 WHERE "Score" = '69-71-72-69=281'
wikisql
CREATE TABLE weekly_weather ( station_id int, day_of_week text, high_temperature int, low_temperature int, precipitation real, wind_speed_mph int ) CREATE TABLE station ( id int, network_name text, services text, local_authority text ) CREATE TABLE route ( train_id int, ...
SELECT day_of_week, AVG(high_temperature) FROM weekly_weather GROUP BY day_of_week ORDER BY AVG(high_temperature)
nvbench
CREATE TABLE table_61573 ( "Name" text, "Type" text, "R.A. ( J2000 )" text, "Dec. ( J2000 )" text, "Redshift (km/ s )" text, "Apparent Magnitude" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Name has Apparent Magnitude smaller than 11.4,...
SELECT "Name" FROM table_61573 WHERE "Apparent Magnitude" < '11.4' AND "R.A. ( J2000 )" = '04h17m35.8s'
wikisql
CREATE TABLE table_204_159 ( id number, "name" text, "nation" text, "position" text, "league apps" number, "league goals" number, "fa cup apps" number, "fa cup goals" number, "total apps" number, "total goals" number ) -- Using valid SQLite, answer the following questions for t...
SELECT MIN("total apps") FROM table_204_159
squall
CREATE TABLE table_36599 ( "Date" text, "Home Team" text, "Score" text, "Visiting Team" text, "Stadium" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score on April 6, 2008?
SELECT "Score" FROM table_36599 WHERE "Date" = 'april 6, 2008'
wikisql
CREATE TABLE table_11981 ( "Airing date" text, "English title (Chinese title)" text, "Number of episodes" real, "HD format" text, "Highest average point ratings" real, "Genre" text, "Official website" text ) -- Using valid SQLite, answer the following questions for the tables provided abov...
SELECT SUM("Highest average point ratings") FROM table_11981 WHERE "Genre" = 'modern suspense' AND "Number of episodes" = '21'
wikisql
CREATE TABLE table_name_93 ( fis_nordic_world_ski_championships VARCHAR, winter_olympics VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the FIS Nordic World Ski Championship years when the winter Olympics took place in 1968?
SELECT fis_nordic_world_ski_championships FROM table_name_93 WHERE winter_olympics = 1968
sql_create_context
CREATE TABLE SECTION ( building VARCHAR, room_number VARCHAR, semester VARCHAR, year VARCHAR, course_id VARCHAR ) CREATE TABLE course ( course_id VARCHAR, dept_name VARCHAR, title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find t...
SELECT T2.building, T2.room_number, T2.semester, T2.year FROM course AS T1 JOIN SECTION AS T2 ON T1.course_id = T2.course_id WHERE T1.dept_name = 'Psychology' ORDER BY T1.title
sql_create_context
CREATE TABLE DEPARTMENT ( DEPT_CODE varchar(10), DEPT_NAME varchar(30), SCHOOL_CODE varchar(8), EMP_NUM int, DEPT_ADDRESS varchar(20), DEPT_EXTENSION varchar(4) ) CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ...
SELECT STU_FNAME, SUM(STU_GPA) FROM STUDENT WHERE STU_GPA < (SELECT AVG(STU_GPA) FROM STUDENT) GROUP BY STU_FNAME
nvbench
CREATE TABLE table_49210 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Series" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What i...
SELECT "High rebounds" FROM table_49210 WHERE "Location Attendance" = 'madison square garden unknown' AND "Date" = 'may 18'
wikisql
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 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 NOT mzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2006-11-17')
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. -- Give me a histogram for ...
SELECT Name, COUNT(*) FROM Projects AS T1 JOIN AssignedTo AS T2 ON T1.Code = T2.Project WHERE T1.Hours > 300 GROUP BY T1.Name
nvbench
CREATE TABLE table_name_85 ( game VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What game was in 2005?
SELECT game FROM table_name_85 WHERE year = 2005
sql_create_context
CREATE TABLE table_48969 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the high scorer in the ...
SELECT "High points" FROM table_48969 WHERE "Team" = 'toronto'
wikisql
CREATE TABLE table_1341598_44 ( incumbent VARCHAR, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What incumbent won the district of texas 22?
SELECT incumbent FROM table_1341598_44 WHERE district = "Texas 22"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND diagnoses.short_title = "Acute respiratry failure"
mimicsql_data
CREATE TABLE table_name_51 ( lijsttrekker VARCHAR, year VARCHAR, chair VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Lijsttrekker, when Year is after 1990, and when Chair is 'Ingrid Van Engelshoven'?
SELECT lijsttrekker FROM table_name_51 WHERE year > 1990 AND chair = "ingrid van engelshoven"
sql_create_context
CREATE TABLE table_15630 ( "Season" text, "Games" real, "Lost" real, "Tied" text, "Points" real, "Goals for" real, "Goals against" real, "Standing" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many goals have Lost larger than 35, a...
SELECT COUNT("Goals for") FROM table_15630 WHERE "Lost" > '35' AND "Games" < '80'
wikisql
CREATE TABLE Department_Stores ( dept_store_id INTEGER, dept_store_chain_id INTEGER, store_name VARCHAR(80), store_address VARCHAR(255), store_phone VARCHAR(80), store_email VARCHAR(80) ) CREATE TABLE Customer_Addresses ( customer_id INTEGER, address_id INTEGER, date_from DATETIME, ...
SELECT product_type_code, AVG(product_price) FROM Product_Suppliers AS T1 JOIN Products AS T2 ON T1.product_id = T2.product_id WHERE T1.supplier_id = 3 GROUP BY product_type_code ORDER BY product_type_code DESC
nvbench
CREATE TABLE train_station ( Train_ID int, Station_ID int ) CREATE TABLE train ( Train_ID int, Name text, Time text, Service text ) CREATE TABLE station ( Station_ID int, Name text, Annual_entry_exit real, Annual_interchanges real, Total_Passengers real, Location text, ...
SELECT Location, SUM(Number_of_Platforms) FROM station GROUP BY Location
nvbench
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.diagnosis = "COLANGITIS" AND demographic.age < "85"
mimicsql_data
CREATE TABLE table_79309 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were the notes in 2011?
SELECT "Notes" FROM table_79309 WHERE "Year" = '2011'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE patient ( uniquepid text, ...
SELECT (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-161415' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1) AND NOT patient.admissionweight IS NULL O...
eicu
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 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 hz_info_mzjzjlb ( JZLSH number, YLJGDM number, mzjzjlb_id number ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, ...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM...
css
CREATE TABLE table_19851 ( "Category" text, "Type" text, "Attribute" text, "Description" text, "Bubbles" text, "Cancelable" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the attributes when the type is 'DOMNodeRemoved'?
SELECT "Attribute" FROM table_19851 WHERE "Type" = 'DOMNodeRemoved'
wikisql
CREATE TABLE table_65238 ( "Title" text, "Series" text, "Characters" text, "Production Num." real, "Release date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest production number for the LT series with the Dumb Patrol title?
SELECT MIN("Production Num.") FROM table_65238 WHERE "Series" = 'lt' AND "Title" = 'dumb patrol'
wikisql
CREATE TABLE table_204_394 ( id number, "year" number, "album" text, "label" text, "peak chart\npositions\nus" number, "peak chart\npositions\nus r&b" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- first album released
SELECT "album" FROM table_204_394 ORDER BY "year" LIMIT 1
squall
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 diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Jane Dillard"
mimicsql_data
CREATE TABLE table_22666 ( "Doctor" text, "Season" text, "Story no." text, "Serial" text, "Number of episodes" text, "Total footage remaining from missing episodes (mm:ss)" text, "Missing episodes with recovered footage" text, "Country/Territory" text, "Source" text, "Format" tex...
SELECT "Story no." FROM table_22666 WHERE "Total footage (mm:ss)" = '00:02'
wikisql
CREATE TABLE table_204_420 ( id number, "month" text, "song" text, "artist" text, "aggregate points" number, "total downloads" number, "year-end chart" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what artist previous to july made blue ?...
SELECT "artist" FROM table_204_420 WHERE "month" < 7 AND "song" = '"blue"'
squall
CREATE TABLE jybgb_jyjgzbb ( JYZBLSH number, YLJGDM text, jyjgzbb_id number ) 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 tex...
SELECT person_info.XM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE jybgb.BGDH = '99312004581'
css
CREATE TABLE table_34625 ( "Award" text, "Year" real, "Category" text, "Work" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many years have an Award of press award?
SELECT COUNT("Year") FROM table_34625 WHERE "Award" = 'press award'
wikisql
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit 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.long_title = "Family history of other specified malignant neoplasm" AND prescriptions.drug_type = "BASE"
mimicsql_data
CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text...
SELECT mzjzjlb.JZZDBM, mzjzjlb.JZZDSM FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '83460162'
css
CREATE TABLE table_name_1 ( morse_taper_number INTEGER, d__max_ VARCHAR, b__max_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the total of the Morse Taper number when the D (max) is 20 and the B (max) greater than 94?
SELECT SUM(morse_taper_number) FROM table_name_1 WHERE d__max_ = 20 AND b__max_ > 94
sql_create_context
CREATE TABLE table_58824 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What player has t7 as the place, with tje United States as the country?
SELECT "Player" FROM table_58824 WHERE "Place" = 't7' AND "Country" = 'united states'
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2065" AND procedures.icd9_code = "9604"
mimicsql_data
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 person_info_hz_info ( RYBH text, ...
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb...
css
CREATE TABLE table_name_44 ( results VARCHAR, choreographer VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Result of the dance Choreographed by Kelly Aykers?
SELECT results FROM table_name_44 WHERE choreographer = "kelly aykers"
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 d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses_icd ( row_...
SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'total protein, body fluid') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27392) AND STRFTIME('%y', labevents.charttime) = '2105'
mimic_iii
CREATE TABLE table_name_57 ( winning_score VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Winning score in 1956?
SELECT winning_score FROM table_name_57 WHERE year = 1956
sql_create_context
CREATE TABLE trust ( source_u_id integer, target_u_id integer, trust integer ) CREATE TABLE review ( a_id integer, u_id integer, i_id integer, rating integer, rank integer ) CREATE TABLE useracct ( u_id integer, name varchar(128) ) CREATE TABLE item ( i_id integer, tit...
SELECT name, COUNT(*) FROM useracct AS T1 JOIN review AS T2 ON T1.u_id = T2.u_id GROUP BY T2.u_id ORDER BY name
nvbench
CREATE TABLE table_14047 ( "Polling firm" text, "Dates" text, "Prog. Cons." text, "New Democratic" text, "Liberal" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which firm conducted a poll in August 2006?
SELECT "Polling firm" FROM table_14047 WHERE "Dates" = 'august 2006'
wikisql
CREATE TABLE table_33994 ( "Artist" text, "Title" text, "Release date" text, "Format" text, "Cat. #" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the category number that was released in November 2007?
SELECT "Cat. #" FROM table_33994 WHERE "Release date" = 'november 2007'
wikisql
CREATE TABLE table_name_80 ( declination___j2000__ VARCHAR, ngc_number INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the declination with NGC number larger than 5750
SELECT declination___j2000__ FROM table_name_80 WHERE ngc_number > 5750
sql_create_context
CREATE TABLE table_name_21 ( round INTEGER, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the lowest round for Paul Hubbard?
SELECT MIN(round) FROM table_name_21 WHERE name = "paul hubbard"
sql_create_context
CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TA...
SELECT DISTINCT ground_service.transport_type FROM airport, airport_service, city AS CITY_0, city AS CITY_1, ground_service WHERE airport.airport_code = airport_service.airport_code AND CITY_0.city_name = 'DALLAS' AND CITY_1.city_code = airport_service.city_code AND CITY_1.city_name = 'DALLAS' AND ground_service.airpor...
atis
CREATE TABLE table_24725 ( "Year" real, "Film" text, "Budget" text, "Domestic Box Office" text, "Foreign Box Office" text, "Total" text, "US DVD sales" text, "Total (with DVD sales)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What wa...
SELECT "Budget" FROM table_24725 WHERE "Film" = 'Thirteen Ghosts'
wikisql
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE regions ( REGION_...
SELECT LAST_NAME, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE table_1342149_11 ( result VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of the election when Tic Forrester ran as an incumbent?
SELECT result FROM table_1342149_11 WHERE incumbent = "Tic Forrester"
sql_create_context
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate re...
SELECT Sex, COUNT(*) FROM people WHERE Weight > 85 GROUP BY Sex ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_42428 ( "Year" real, "Venue" text, "Winning team" text, "Score" text, "USA Captain" text, "Europe Captain" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the USA's captain was Beth Daniel, who was the winning team?
SELECT "Winning team" FROM table_42428 WHERE "USA Captain" = 'beth daniel'
wikisql
CREATE TABLE table_61864 ( "Pick" real, "Player" text, "Team" text, "Position" text, "Hometown/School" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT PLAYER HAS THE OAKLAND ATHLETICS?
SELECT "Player" FROM table_61864 WHERE "Team" = 'oakland athletics'
wikisql
CREATE TABLE mzb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
SELECT qtb.OUT_DIAG_DOC_CD, qtb.OUT_DIAG_DOC_NM FROM qtb WHERE qtb.PERSON_NM = '谢婉慧' AND qtb.IN_HOSP_DATE BETWEEN '2000-07-26' AND '2013-12-31' GROUP BY qtb.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT gyb.OUT_DIAG_DOC_CD, gyb.OUT_DIAG_DOC_NM FROM gyb WHERE gyb.PERSON_NM = '谢婉慧' AND gyb.IN_HOSP_DATE BETW...
css
CREATE TABLE table_59661 ( "Name" text, "Residence" text, "Party" text, "Years in Assembly" text, "Years in Senate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Party has Years in Senate of , and Years in Assembly of 2012 present?
SELECT "Party" FROM table_59661 WHERE "Years in Senate" = '—' AND "Years in Assembly" = '2012–present'
wikisql
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE icustays ( row_id number, ...
SELECT MAX(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 4469)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arter...
mimic_iii
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 lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "51221"
mimicsql_data