instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_91 ( home VARCHAR, visitor VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the home team that played against the Boston Bruins on January 11?
SELECT home FROM table_name_91 WHERE visitor = "boston bruins" AND date = "january 11"
sql_create_context
CREATE TABLE table_55197 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the tournament when antonia xenia tout na...
SELECT "Tournament" FROM table_55197 WHERE "Opponents" = 'antonia xenia tout nataša zorić'
wikisql
CREATE TABLE table_73715 ( "Name" text, "Municipal district" text, "Population (2011)" real, "Population (2006)" real, "Change (%)" text, "Land area (km\u00b2)" text, "Population density (per km 2 )" text ) -- Using valid SQLite, answer the following questions for the tables provided above...
SELECT "Population density (per km 2 )" FROM table_73715 WHERE "Name" = 'Buffalo Lake'
wikisql
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, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, ...
SELECT COUNT(DISTINCT t1.subject_id) 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_icd_diagnoses WHERE d_icd_diagnoses.short_title =...
mimic_iii
CREATE TABLE table_45010 ( "Fin. Pos" text, "Car No." text, "Driver" text, "Team" text, "Laps" text, "Time/Retired" text, "Grid" text, "Laps Led" text, "Points" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the grid of Budd...
SELECT "Grid" FROM table_45010 WHERE "Driver" = 'buddy rice'
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 mzjzjlb.JZZDBM, mzjzjlb.JZZDSM FROM mzjzjlb WHERE mzjzjlb.JZLSH = '54031732875'
css
CREATE TABLE table_name_65 ( frequency_mhz INTEGER, call_sign VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Frequency MHz is the highest one that has a Call sign of k241an?
SELECT MAX(frequency_mhz) FROM table_name_65 WHERE call_sign = "k241an"
sql_create_context
CREATE TABLE book_club ( book_club_id int, Year int, Author_or_Editor text, Book_Title text, Publisher text, Category text, Result text ) CREATE TABLE culture_company ( Company_name text, Type text, Incorporated_in text, Group_Equity_Shareholding real, book_club_id text,...
SELECT Category, COUNT(*) FROM book_club GROUP BY Category
nvbench
CREATE TABLE table_45131 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the rider when the grid is 21?
SELECT "Rider" FROM table_45131 WHERE "Grid" = '21'
wikisql
CREATE TABLE table_21501518_1 ( week__number VARCHAR, theme VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which week is the theme First Solo
SELECT week__number FROM table_21501518_1 WHERE theme = "First Solo"
sql_create_context
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type t...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, 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_i...
mimic_iii
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT * FROM t_kc21 WHERE t_kc21.PERSON_NM = '凤乐和' AND t_kc21.MED_SER_ORG_NO = '2365508' AND t_kc21.MED_ORG_DEPT_NM LIKE '%科学%'
css
CREATE TABLE table_80182 ( "Year" text, "Start" text, "Qual" text, "Rank" text, "Finish" text, "Laps" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What ranking that had a start of 19?
SELECT "Rank" FROM table_80182 WHERE "Start" = '19'
wikisql
CREATE TABLE table_203_58 ( id number, "airline" text, "airline (in russian)" text, "licence #" number, "icao" text, "iata" text, "domestic code" text, "callsign" text, "photo" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is t...
SELECT "domestic code" FROM table_203_58 WHERE id = 1
squall
CREATE TABLE table_930 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Stadium" text, "Record" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the stadium with record being 1 1
SELECT "Stadium" FROM table_930 WHERE "Record" = '1–1'
wikisql
CREATE TABLE table_61827 ( "School" text, "Location" text, "Nickname(s)" text, "Colors" text, "Years Member" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Years Member has a School of cairo high school?
SELECT "Years Member" FROM table_61827 WHERE "School" = 'cairo high school'
wikisql
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 prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.charttime = "2144-12-08 03:27:00"
mimicsql_data
CREATE TABLE table_name_20 ( position VARCHAR, played VARCHAR, points VARCHAR, lost VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of positions having points over 2, more than 4 losses, and under 10 matches played?
SELECT COUNT(position) FROM table_name_20 WHERE points > 2 AND lost > 4 AND played < 10
sql_create_context
CREATE TABLE table_53518 ( "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 date did a home team score 16.15 (111)
SELECT "Date" FROM table_53518 WHERE "Home team score" = '16.15 (111)'
wikisql
CREATE TABLE table_36002 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Score has an Attendance of 23 january 1999, and a Tie # of 6?
SELECT "Score" FROM table_36002 WHERE "Attendance" = '23 january 1999' AND "Tie no" = '6'
wikisql
CREATE TABLE table_name_10 ( provider VARCHAR, up__up_to_kbit_s_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the provider when up (up to kbit/s) is 1180?
SELECT provider FROM table_name_10 WHERE up__up_to_kbit_s_ = 1180
sql_create_context
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
SELECT REF_SLT_FLG FROM t_kc24 WHERE MED_CLINIC_ID = '01329710561'
css
CREATE TABLE table_13564702_3 ( tries_against VARCHAR, played VARCHAR, points_against VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the tries against for played 22 and points against of 183
SELECT tries_against FROM table_13564702_3 WHERE played = "22" AND points_against = "183"
sql_create_context
CREATE TABLE table_1140088_6 ( race_name VARCHAR, circuit VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What race was held at Oulton Park?
SELECT race_name FROM table_1140088_6 WHERE circuit = "Oulton Park"
sql_create_context
CREATE TABLE club ( club_id number, club_name text, region text, start_year number ) CREATE TABLE match_result ( rank number, club_id number, gold number, big_silver number, small_silver number, bronze number, points number ) CREATE TABLE coach ( coach_id number, co...
SELECT player_name FROM player WHERE NOT player_id IN (SELECT player_id FROM player_coach)
spider
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '51519970' AND MED_SER_ORG_NO = '2900289' AND NOT IN_DIAG_DIS_NM LIKE '%喉%'
css
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
SELECT Headquarter, MAX(Revenue) FROM Manufacturers GROUP BY Headquarter ORDER BY MAX(Revenue) DESC
nvbench
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 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', icustays.intime)) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 65582) AND icustays.outtime IS NULL
mimic_iii
CREATE TABLE table_5766 ( "Opposition" text, "Score" text, "Venue" text, "City" text, "Year" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Opposition has a City of taunton?
SELECT "Opposition" FROM table_5766 WHERE "City" = 'taunton'
wikisql
CREATE TABLE table_33264 ( "Game Name" text, "Price" text, "Top Prize" text, "Launch Date" text, "Odds of Winning" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the launch date odds of winning 1 in 4.44?
SELECT "Launch Date" FROM table_33264 WHERE "Odds of Winning" = '1 in 4.44'
wikisql
CREATE TABLE table_23248910_6 ( location_attendance VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What location and it's attendance was the game against the cavaliers?
SELECT location_attendance FROM table_23248910_6 WHERE team = "Cavaliers"
sql_create_context
CREATE TABLE table_74587 ( "Tournament" text, "1940" text, "1941" text, "1942" text, "1943" text, "1944" text, "1945" text, "1946 1" text, "1947 1" text, "1948" text, "1949" text, "1950" text, "1951" text, "1952" text, "1953" text, "1954" text, "Career...
SELECT "Tournament" FROM table_74587 WHERE "1954" = 'a' AND "1942" = 'nh'
wikisql
CREATE TABLE table_65627 ( "Club" text, "Total points" text, "Bonus points" text, "Match points" text, "Games" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Diff" text ) -- Using valid SQLite, answer the following questions for the tables provided ...
SELECT "Drawn" FROM table_65627 WHERE "Points for" = '416' AND "Points against" = '533'
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "1" AND diagnoses.icd9_code = "5789"
mimicsql_data
CREATE TABLE table_74838 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Region has a Catalog of kem 072?
SELECT "Region" FROM table_74838 WHERE "Catalog" = 'kem 072'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2115.0" AND procedures.icd9_code = "4041"
mimicsql_data
CREATE TABLE table_74281 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What player is draft pick 17?
SELECT "Player" FROM table_74281 WHERE "Pick #" = '17'
wikisql
CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE field ( fieldid int ) CREATE TABLE paperda...
SELECT DISTINCT paper.paperid FROM author, paper, writes WHERE author.authorname = 'james fogarty' AND paper.year = 2015 AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
scholar
CREATE TABLE table_69271 ( "Player" text, "AFL debut" text, "Games" text, "Goals" text, "Kicks" text, "Handballs" text, "Disposals" text, "Marks" text, "Tackles" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the games with mark...
SELECT "Games" FROM table_69271 WHERE "Marks" = '21'
wikisql
CREATE TABLE table_5586 ( "Game" real, "February" real, "Opponent" text, "Score" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the February number of the game played against the St. Louis Blues with a game number less than 58...
SELECT AVG("February") FROM table_5586 WHERE "Opponent" = 'st. louis blues' AND "Game" < '58'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "DEAD/EXPIRED" AND diagnoses.icd9_code = "4254"
mimicsql_data
CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT ) CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases INTEGER, Drink TEXT ) CREATE TABLE appellations ( No...
SELECT Year, AVG(MAX(Score)) FROM wine ORDER BY AVG(MAX(Score))
nvbench
CREATE TABLE zyjzjlb_jybgb ( YLJGDM_ZYJZJLB text, BGDH number, YLJGDM 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 COUNT(hz_info.RYBH) FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE zyjzjlb.YLJGDM = '6930782' AND DATEDIFF(zyjzjlb.CYSJ, zyjzjlb.RYSJ) > 23
css
CREATE TABLE table_name_92 ( score VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the score for october 9
SELECT score FROM table_name_92 WHERE date = "october 9"
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 demographic ...
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 = "Unspecified gastritis and gastroduodenitis, without mention of hemorrhage" AND prescription...
mimicsql_data
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Hepatitis, unspecified"
mimicsql_data
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.MED_ORG_DEPT_NM, AVG(t_kc21.IN_HOSP_DAYS) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '3701034' GROUP BY t_kc21.MED_ORG_DEPT_CD ORDER BY AVG(t_kc21.IN_HOSP_DAYS)
css
CREATE TABLE table_2668374_11 ( first_elected VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was William Kennedy first elected?
SELECT first_elected FROM table_2668374_11 WHERE incumbent = "William Kennedy"
sql_create_context
CREATE TABLE table_72841 ( "Game" real, "Date" text, "Opponent" 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. -- Wh...
SELECT "High assists" FROM table_72841 WHERE "Score" = '79-88'
wikisql
CREATE TABLE table_name_39 ( score INTEGER, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the total score of Danny Edwards?
SELECT SUM(score) FROM table_name_39 WHERE player = "danny edwards"
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 COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT intakeoutput.patientunitstayid FROM intakeoutput WHERE intakeoutput.celllabel = 'enteral free water flushes' AND intakeoutput.cellpath LIKE '%input%' AND DATETIME(intakeoutput.intakeoutputtime, 'start of year') = DATETIME(C...
eicu
CREATE TABLE Customers ( customer_id VARCHAR, customer_first_name VARCHAR, customer_last_name VARCHAR, customer_phone VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show ids, first names, last names, and phones for all customers.
SELECT customer_id, customer_first_name, customer_last_name, customer_phone FROM Customers
sql_create_context
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 inputevents_cv ( row_id number, subject_id number, ...
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 TRACK ( UnitPrice VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the distinct unit prices of all tracks?
SELECT DISTINCT (UnitPrice) FROM TRACK
sql_create_context
CREATE TABLE table_75732 ( "Institution" text, "Location" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Team Nickname" text, "Primary conference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the location of the Univ...
SELECT "Location" FROM table_75732 WHERE "Founded" > '1890' AND "Institution" = 'university of montana'
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.short_title = "Blood in stool"
mimicsql_data
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 prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13473) AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-4 year')
mimic_iii
CREATE TABLE table_58582 ( "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 team played st kilda at their home with a c...
SELECT "Away team" FROM table_58582 WHERE "Crowd" > '12,528' AND "Home team" = 'st kilda'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtim...
SELECT AVG(t1.c1) FROM (SELECT COUNT(DISTINCT diagnosis.patientunitstayid) AS c1 FROM diagnosis WHERE diagnosis.diagnosisname = 'external ear injury - right' AND STRFTIME('%y', diagnosis.diagnosistime) >= '2105' GROUP BY STRFTIME('%y', diagnosis.diagnosistime)) AS t1
eicu
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, SUM(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(SALARY)
nvbench
CREATE TABLE table_6502 ( "Pos." real, "Matches" real, "Wins" real, "Loses" real, "Results" text, "Points" real, "Diff." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many wins had Matches greater than 5?
SELECT SUM("Wins") FROM table_6502 WHERE "Matches" > '5'
wikisql
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location...
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 = 8098) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND inputeve...
mimic_iii
CREATE TABLE railway_manage ( Railway_ID int, Manager_ID int, From_Year text ) CREATE TABLE manager ( Manager_ID int, Name text, Country text, Working_year_starts text, Age int, Level int ) CREATE TABLE train ( Train_ID int, Train_Num text, Name text, From text, ...
SELECT Builder, COUNT(*) FROM railway GROUP BY Builder ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_42966 ( "Year" real, "Drivers" text, "Races" real, "Wins" real, "Poles" real, "Fast laps" real, "Points" real, "D.C." text, "T.C." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest number of points ...
SELECT MIN("Points") FROM table_42966 WHERE "Races" > '16'
wikisql
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Code DESC
nvbench
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE student_record ( student_id int, course_id int, semest...
SELECT DISTINCT course.department, course.name, course.number, program_course.workload FROM course INNER JOIN student_record ON student_record.course_id = course.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE program_course.workload = (SELECT MAX(PROGRAM_COURSEalias1.workload) ...
advising
CREATE TABLE table_79313 ( "Area" text, "State/ Province" text, "CSA/CMA 2009 population" real, "Projected 2025 population" text, "Projected increase 2009-2025" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the CSA/CMA Population in IA-IL?
SELECT MAX("CSA/CMA 2009 population") FROM table_79313 WHERE "State/ Province" = 'ia-il'
wikisql
CREATE TABLE table_8034 ( "Date" text, "H/A/N" text, "Opponent" text, "Score" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the H/A/N for the game that ended in a score of 108-102?
SELECT "H/A/N" FROM table_8034 WHERE "Score" = '108-102'
wikisql
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), ...
SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
nvbench
CREATE TABLE table_name_47 ( time VARCHAR, heat VARCHAR, lane VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the time of lane 3 in heat 5?
SELECT time FROM table_name_47 WHERE heat = 5 AND lane = 3
sql_create_context
CREATE TABLE table_204_349 ( id number, "year" number, "conservative\ncouncillors" number, "labour\ncouncillors" number, "independent\ncouncillors" number, "liberal\ncouncillors" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the next ...
SELECT MIN("year") FROM table_204_349 WHERE "year" > 1967
squall
CREATE TABLE table_name_73 ( opponent VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What opponent has a record of 86-62?
SELECT opponent FROM table_name_73 WHERE record = "86-62"
sql_create_context
CREATE TABLE table_name_37 ( origin VARCHAR, versions VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is the origin of the tth version?
SELECT origin FROM table_name_37 WHERE versions = "tth"
sql_create_context
CREATE TABLE table_204_688 ( id number, "name" text, "red vs. blue" text, "couples team" text, "status" text, "weight" text, "total votes" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- give the number of people eliminated in week 1 ?
SELECT COUNT(*) FROM table_204_688 WHERE "status" = 'eliminated week 1'
squall
CREATE TABLE table_21523 ( "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 w...
SELECT "Score" FROM table_21523 WHERE "High points" = 'Andre Miller (17)'
wikisql
CREATE TABLE diagnoses ( 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Septic shock" AND lab."CATEGORY" = "Blood Gas"
mimicsql_data
CREATE TABLE table_75874 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What day was the game that had the Cavaliers as visiting team and the Knicks as the...
SELECT "Date" FROM table_75874 WHERE "Visitor" = 'cavaliers' AND "Home" = 'knicks'
wikisql
CREATE TABLE table_38399 ( "Team 1" text, "Agg." text, "Team 2" text, "1st leg" text, "2nd leg" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 1st leg of team 1 Lyon?
SELECT "1st leg" FROM table_38399 WHERE "Team 1" = 'lyon'
wikisql
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE admissions ( row_id number, subject_id number, ...
SELECT COUNT(DISTINCT t1.subject_id) 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 FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'contr abd a...
mimic_iii
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) ...
SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE area.area LIKE '%compu...
advising
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 WHERE demographic.age < "85" AND demographic.admityear < "2190"
mimicsql_data
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate n...
SELECT MAX(vitalperiodic.heartrate) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-18150')) AND NOT vitalperiodic.heartrate IS NULL...
eicu
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 microlab.culturesite FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-3355' AND patient.hospitaldischargetime IS NULL)) ORDER BY microla...
eicu
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 T2.Name, COUNT(*) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE microlab ( microlabid number, ...
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-50099')) AND medication.drugname = 'furosemide 80 mg po tabs' AND DATE...
eicu
CREATE TABLE table_36950 ( "Round" real, "Pick" real, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Round has a College of stanford?
SELECT "Round" FROM table_36950 WHERE "College" = 'stanford'
wikisql
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 demographic.expire_flag, procedures.icd9_code FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "8440"
mimicsql_data
CREATE TABLE gas_station ( Station_ID int, Open_Year int, Location text, Manager_Name text, Vice_Manager_Name text, Representative_Name text ) CREATE TABLE company ( Company_ID int, Rank int, Company text, Headquarters text, Main_Industry text, Sales_billion real, Pr...
SELECT Manager_Name, COUNT(Manager_Name) FROM gas_station GROUP BY Manager_Name
nvbench
CREATE TABLE table_27622417_1 ( original_us_air_date VARCHAR, prod_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- when was the premiere of the episode whose production code is 415?
SELECT original_us_air_date FROM table_27622417_1 WHERE prod_code = "415"
sql_create_context
CREATE TABLE table_12913 ( "Elector" text, "Nationality" text, "Order" text, "Title" text, "Elevated" text, "Elevator" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Elector has an Order of cardinal-priest, and a Nationality of french?
SELECT "Elector" FROM table_12913 WHERE "Order" = 'cardinal-priest' AND "Nationality" = 'french'
wikisql
CREATE TABLE table_name_48 ( days_held VARCHAR, reign VARCHAR, defenses VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the days held the champion with a reign larger than 3 and 1 defense has?
SELECT days_held FROM table_name_48 WHERE reign > 3 AND defenses = 1
sql_create_context
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location ...
SELECT DISTINCT airline.airline_code FROM airline, 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 = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.c...
atis
CREATE TABLE table_44178 ( "Pos." text, "Class" text, "Entrant" text, "Drivers" text, "Laps" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the highest amount of laps when the class was v8 and the entrant was diet-coke racing?
SELECT MAX("Laps") FROM table_44178 WHERE "Class" = 'v8' AND "Entrant" = 'diet-coke racing'
wikisql
CREATE TABLE table_23015396_1 ( year VARCHAR, driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of year for mark martin
SELECT COUNT(year) FROM table_23015396_1 WHERE driver = "Mark Martin"
sql_create_context
CREATE TABLE Ref_Product_Categories ( product_category_code VARCHAR(15), product_category_description VARCHAR(80), unit_of_measure VARCHAR(20) ) CREATE TABLE Ref_Characteristic_Types ( characteristic_type_code VARCHAR(15), characteristic_type_description VARCHAR(80) ) CREATE TABLE Ref_Colors ( ...
SELECT product_category_description, COUNT(product_category_description) FROM Ref_Product_Categories AS T1 JOIN Products AS T2 ON T1.product_category_code = T2.product_category_code WHERE T2.product_description LIKE '%t%' GROUP BY product_category_description ORDER BY COUNT(product_category_description)
nvbench
CREATE TABLE table_name_49 ( first_prize___ INTEGER, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the top first place prize in 1997?
SELECT MAX(first_prize___) AS $__ FROM table_name_49 WHERE year = 1997
sql_create_context
CREATE TABLE table_22597626_2 ( year INTEGER, outcome VARCHAR, championship VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In the US Open championship and the outcome is runner-up, what is the minimum year?
SELECT MIN(year) FROM table_22597626_2 WHERE outcome = "Runner-up" AND championship = "US Open"
sql_create_context
CREATE TABLE table_name_23 ( score VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was Jim Furyk's score?
SELECT score FROM table_name_23 WHERE player = "jim furyk"
sql_create_context
CREATE TABLE table_21517 ( "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. -- Who ha...
SELECT "High points" FROM table_21517 WHERE "Date" = 'December 17'
wikisql
CREATE TABLE table_204_245 ( id number, "#" number, "wrestlers" text, "reign" number, "date" text, "days\nheld" number, "location" text, "event" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many days did ultimo gl...
SELECT "days\nheld" FROM table_204_245 WHERE "wrestlers" = 'ultimo gladiador and ultimo vampiro'
squall