instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_4 ( date VARCHAR, opponent VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the date when the opponent was Sheffield Scimitars and the venue was Home?
SELECT date FROM table_name_4 WHERE opponent = "sheffield scimitars" AND venue = "home"
sql_create_context
CREATE TABLE table_65989 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Rank has a Silver of 1, and a Gold of 0, and a Nation of austria?
SELECT "Rank" FROM table_65989 WHERE "Silver" = '1' AND "Gold" = '0' AND "Nation" = 'austria'
wikisql
CREATE TABLE table_name_49 ( highest_point VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest amount of points for rank 95?
SELECT highest_point FROM table_name_49 WHERE rank = 95
sql_create_context
CREATE TABLE order_items ( order_item_id number, order_id number, product_id number, order_quantity text ) CREATE TABLE customers ( customer_id number, payment_method_code text, customer_number text, customer_name text, customer_address text, customer_phone text, customer_em...
SELECT T2.customer_name, T3.city, T1.date_from, T1.date_to FROM customer_address_history AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id JOIN addresses AS T3 ON T1.address_id = T3.address_id
spider
CREATE TABLE table_1176371_1 ( t20_matches INTEGER, name_of_ground VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the maximum t20 on green lane?
SELECT MAX(t20_matches) FROM table_1176371_1 WHERE name_of_ground = "Green Lane"
sql_create_context
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConce...
SELECT q.OwnerUserId AS "user_link", COUNT(DISTINCT q.Id) AS "count" FROM Posts AS q INNER JOIN Posts AS a ON q.Id = a.ParentId WHERE q.OwnerUserId = a.OwnerUserId AND a.Score > 0 GROUP BY q.OwnerUserId ORDER BY 'count' DESC
sede
CREATE TABLE table_1753 ( "DVD Title" text, "No. of Discs" real, "Year" text, "No. of Episodes" real, "Region 1" text, "Region 2" text, "Region 4" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the largest number of episodes for a 19...
SELECT MAX("No. of Episodes") FROM table_1753 WHERE "Year" = '1989'
wikisql
CREATE TABLE table_30683 ( "No. in series" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (million)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many millions of U.S. viewers watched the...
SELECT "U.S. viewers (million)" FROM table_30683 WHERE "Title" = 'New Beginnings'
wikisql
CREATE TABLE College ( cName varchar(20), state varchar(2), enr numeric(5,0) ) CREATE TABLE Player ( pID numeric(5,0), pName varchar(20), yCard varchar(3), HS numeric(5,0) ) CREATE TABLE Tryout ( pID numeric(5,0), cName varchar(20), pPos varchar(8), decision varchar(3) ) ...
SELECT state, MIN(enr) FROM College GROUP BY state
nvbench
CREATE TABLE table_23394920_1 ( station_type VARCHAR, callsign VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When dwhr-tv is the call sign how many station types are there?
SELECT COUNT(station_type) FROM table_23394920_1 WHERE callsign = "DWHR-TV"
sql_create_context
CREATE TABLE hz_info_mzjzjlb ( JZLSH number, YLJGDM number, mzjzjlb_id number ) 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 ...
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 = '8883529' AND DATEDIFF(zyjzjlb.CYSJ, zyjzjlb.RYSJ) > 22
css
CREATE TABLE table_name_32 ( wins INTEGER, points INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Wins, when Points is less than '19'?
SELECT AVG(wins) FROM table_name_32 WHERE points < 19
sql_create_context
CREATE TABLE table_201_10 ( id number, "#" number, "name" text, "office" text, "political party" text, "occupation" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many mayors were in office for a total of 9 years ?
SELECT COUNT("name") FROM table_201_10 WHERE "office" - "office" = 9
squall
CREATE TABLE table_name_74 ( loss VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who got the loss for the game ending in a record of 55-41?
SELECT loss FROM table_name_74 WHERE record = "55-41"
sql_create_context
CREATE TABLE table_name_45 ( venue VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which venue has 1st as the result?
SELECT venue FROM table_name_45 WHERE result = "1st"
sql_create_context
CREATE TABLE table_name_13 ( year INTEGER, mintage INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the average year for a coin that had a mintage smaller than 10,000?
SELECT AVG(year) FROM table_name_13 WHERE mintage < 10 OFFSET 000
sql_create_context
CREATE TABLE table_2249087_1 ( south_american_rank INTEGER, nation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the south american rank for venezuela
SELECT MIN(south_american_rank) FROM table_2249087_1 WHERE nation = "Venezuela"
sql_create_context
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT All_Road, All_Games_Percent FROM basketball_match ORDER BY All_Road DESC
nvbench
CREATE TABLE table_name_4 ( score VARCHAR, date VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For the game on 13 December 1975 with Halifax Town as the away team what was the score?
SELECT score FROM table_name_4 WHERE date = "13 december 1975" AND away_team = "halifax town"
sql_create_context
CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE ...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare AS FARE_0, fare AS FARE_1, fare_basis AS FARE_BASIS_0, fare_basis AS FARE_BASIS_1, fare_b...
atis
CREATE TABLE table_7828 ( "Country" text, "2010" real, "2011" real, "2012" real, "2013" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest number of participants in 2010 when there were 0 participants in 2012?
SELECT MIN("2010") FROM table_7828 WHERE "2012" < '0'
wikisql
CREATE TABLE table_20539 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Replaced by" text, "Date of appointment" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the date of appointment for th...
SELECT "Date of appointment" FROM table_20539 WHERE "Outgoing manager" = 'Wim Jansen'
wikisql
CREATE TABLE table_27614571_1 ( song_choice VARCHAR, theme VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was Barreto's song choice when the theme was samba?
SELECT song_choice FROM table_27614571_1 WHERE theme = "Samba"
sql_create_context
CREATE TABLE CLASS ( CLASS_CODE varchar(5), CRS_CODE varchar(10), CLASS_SECTION varchar(2), CLASS_TIME varchar(20), CLASS_ROOM varchar(8), PROF_NUM int ) CREATE TABLE DEPARTMENT ( DEPT_CODE varchar(10), DEPT_NAME varchar(30), SCHOOL_CODE varchar(8), EMP_NUM int, DEPT_ADDRESS...
SELECT DEPT_CODE, SUM(T1.CRS_CREDIT) FROM COURSE AS T1 JOIN CLASS AS T2 ON T1.CRS_CODE = T2.CRS_CODE GROUP BY T1.DEPT_CODE ORDER BY DEPT_CODE
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 zyjzjlb ( CYBQDM text, CYBQMC...
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.RYBH = '89963549' AND NOT mzjzjlb.JZLSH IN (SELECT zyjybgb.JZLSH FROM zyjybgb WHERE zyjybgb.BGRQ >= '2015-03-17' UNION SELECT mzjybgb.JZLSH FROM mzjybgb WHERE mzjybgb...
css
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '7821897' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 2 UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID...
css
CREATE TABLE table_1653 ( "Season" text, "Series" text, "Team Name" text, "Races" real, "Poles" real, "Wins" real, "Points" real, "Final Placing" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the max points you when when you pl...
SELECT MAX("Points") FROM table_1653 WHERE "Final Placing" = '9th'
wikisql
CREATE TABLE table_59667 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the finish for Lanny Wadkins of the United States?
SELECT "Finish" FROM table_59667 WHERE "Country" = 'united states' AND "Player" = 'lanny wadkins'
wikisql
CREATE TABLE table_72167 ( "Year" real, "Champion" text, "Score" text, "Runner-Up" text, "Location" text, "Semi-Finalist #1" text, "Semi-Finalist #2" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the scores of all games when Miami were...
SELECT "Score" FROM table_72167 WHERE "Semi-Finalist #1" = 'Miami'
wikisql
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT COUNT(*) FROM mzb WHERE mzb.MED_TYPE = '3592608' AND mzb.IN_HOSP_DAYS BETWEEN '2007-09-27' AND '2018-09-20'
css
CREATE TABLE table_name_31 ( category VARCHAR, outcome VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What category was the nominated in after 2008?
SELECT category FROM table_name_31 WHERE outcome = "nominated" AND year > 2008
sql_create_context
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE admissions ( ro...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'open reduct mandible fx') AND DATETIME(procedures_ic...
mimic_iii
CREATE TABLE table_27465 ( "June 10-11" text, "March 27-29" text, "January 15-16" text, "November 3" text, "August 21-22" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many times does November 3rd occur when January 15, 1991 does?
SELECT COUNT("November 3") FROM table_27465 WHERE "January 15-16" = 'January 15, 1991'
wikisql
CREATE TABLE table_31800 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Venue" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which date has a week larger than 14?
SELECT "Date" FROM table_31800 WHERE "Week" > '14'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE medication ( medicationid ...
SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-76924')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput.ce...
eicu
CREATE TABLE table_name_54 ( overall INTEGER, college VARCHAR, pick__number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the overall number of the player from Utah with a pick # higher than 7?
SELECT SUM(overall) FROM table_name_54 WHERE college = "utah" AND pick__number < 7
sql_create_context
CREATE TABLE table_name_83 ( score VARCHAR, december VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score for the Dec 11 game?
SELECT score FROM table_name_83 WHERE december = 11
sql_create_context
CREATE TABLE table_6350 ( "Country" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total when bronze has a silver larger than 2?
SELECT COUNT("Bronze") FROM table_6350 WHERE "Silver" > '2'
wikisql
CREATE TABLE table_16581695_3 ( no_in_season VARCHAR, production_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many seasons have a production code of 204?
SELECT COUNT(no_in_season) FROM table_16581695_3 WHERE production_code = 204
sql_create_context
CREATE TABLE table_21378 ( "Official Name" text, "Status" text, "Area km 2" text, "Population" real, "Census Ranking" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Petersville's census ranking?
SELECT "Census Ranking" FROM table_21378 WHERE "Official Name" = 'Petersville'
wikisql
CREATE TABLE table_37217 ( "Player" text, "Position" text, "Date of Birth (Age)" text, "Caps" real, "Club/province" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Club or province has a caps larger than 15 and has Chris Cusiter playing for the...
SELECT "Club/province" FROM table_37217 WHERE "Caps" > '15' AND "Player" = 'chris cusiter'
wikisql
CREATE TABLE table_65614 ( "Wimmera FL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Byes have an Against larger than 1018, and a Wimmera FL of horsham diggers?
SELECT MIN("Byes") FROM table_65614 WHERE "Against" > '1018' AND "Wimmera FL" = 'horsham diggers'
wikisql
CREATE TABLE table_203_764 ( id number, "name" text, "date" number, "nation" text, "displacement" text, "speed" text, "number" number, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many tons does the te class displace ?
SELECT "displacement" FROM table_203_764 WHERE "name" = 'te-class'
squall
CREATE TABLE table_77874 ( "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. -- When the Home team score was 15.18 (108), what's...
SELECT MIN("Crowd") FROM table_77874 WHERE "Home team score" = '15.18 (108)'
wikisql
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 icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
SELECT labevents.charttime FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'calcium, total') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 24894 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admitt...
mimic_iii
CREATE TABLE table_204_796 ( id number, "network name" text, "flagship" text, "programming type" text, "owner" text, "affiliates" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- tell me the number of stations tv azteca owns .
SELECT COUNT("network name") FROM table_204_796 WHERE "owner" = 'tv azteca'
squall
CREATE TABLE table_name_2 ( place VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What place has the score of 67-74=141?
SELECT place FROM table_name_2 WHERE score = 67 - 74 = 141
sql_create_context
CREATE TABLE table_176524_2 ( census_ranking VARCHAR, official_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the census ranking for the Perth parish?
SELECT census_ranking FROM table_176524_2 WHERE official_name = "Perth"
sql_create_context
CREATE TABLE table_10100 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the home team on March 5, 2008?
SELECT "Home" FROM table_10100 WHERE "Date" = 'march 5, 2008'
wikisql
CREATE TABLE table_12962773_5 ( player VARCHAR, no VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many player with no being 12
SELECT COUNT(player) FROM table_12962773_5 WHERE no = 12
sql_create_context
CREATE TABLE table_12045 ( "Driver" text, "Car #" real, "Make" text, "Points" real, "Laps" real, "Winnings" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which driver has a # smaller than 40, less than 151 points, and Winnings of $84,400?
SELECT "Make" FROM table_12045 WHERE "Car #" < '40' AND "Points" < '151' AND "Winnings" = '$84,400'
wikisql
CREATE TABLE Employees ( Employee_ID INTEGER, Role_Code CHAR(15), Employee_Name VARCHAR(255), Gender_MFU CHAR(1), Date_of_Birth DATETIME, Other_Details VARCHAR(255) ) CREATE TABLE Roles ( Role_Code CHAR(15), Role_Name VARCHAR(255), Role_Description VARCHAR(255) ) CREATE TABLE Docum...
SELECT Date_in_Location_From, COUNT(Date_in_Location_From) FROM Document_Locations GROUP BY Date_in_Location_From
nvbench
CREATE TABLE table_64729 ( "Draw" real, "Artist" text, "Song" text, "Points" real, "Place" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many places have an Artist of august , and a Draw smaller than 6?
SELECT COUNT("Place") FROM table_64729 WHERE "Artist" = 'augustė' AND "Draw" < '6'
wikisql
CREATE TABLE table_79596 ( "Game" text, "Date" text, "Opponent" text, "Score" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date was game 3?
SELECT "Date" FROM table_79596 WHERE "Game" = '3'
wikisql
CREATE TABLE table_240936_2 ( region_4__australia_ VARCHAR, region_1__us_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the region 4 (Aus) date associated with a region 1 (US) date of January 16, 2007?
SELECT region_4__australia_ FROM table_240936_2 WHERE region_1__us_ = "January 16, 2007"
sql_create_context
CREATE TABLE table_name_84 ( react INTEGER, mark VARCHAR, heat VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest React that has a 7.61 Mark and a heat bigger than 1?
SELECT MAX(react) FROM table_name_84 WHERE mark = "7.61" AND heat > 1
sql_create_context
CREATE TABLE table_1160660_1 ( date_founded VARCHAR, acronym VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was USF founded?
SELECT date_founded FROM table_1160660_1 WHERE acronym = "USF"
sql_create_context
CREATE TABLE table_64562 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Replaced by" text, "Date of appointment" text, "Position in table" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is t...
SELECT "Position in table" FROM table_64562 WHERE "Team" = 'hartlepool united'
wikisql
CREATE TABLE table_17065 ( "Player" text, "Position" text, "School" text, "Hometown" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the position of the player from Butler High School?
SELECT "Position" FROM table_17065 WHERE "School" = 'Butler High School'
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 demographic.age, demographic.religion FROM demographic WHERE demographic.subject_id = "84129"
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 COUNT(*) FROM medication WHERE medication.drugname = 'multivitamins'
eicu
CREATE TABLE table_52794 ( "Analog Channel" text, "Digital Channel" text, "Call sign" text, "Name" text, "Network" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which analog channel is Fox on?
SELECT "Analog Channel" FROM table_52794 WHERE "Network" = 'fox'
wikisql
CREATE TABLE table_204_373 ( id number, "wager" text, "winner" text, "loser" text, "location" text, "date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- first opponent to defeat mocho cota in mexico city
SELECT "winner" FROM table_204_373 WHERE "loser" = 'mocho cota' AND "location" = 'mexico city' ORDER BY "date" LIMIT 1
squall
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 COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.MED_SER_ORG_NO = '7787217' AND t_kc22.SOC_SRT_DIRE_CD = '3265'
css
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 demographic.admittime, prescriptions.drug_dose FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.subject_id = "74032"
mimicsql_data
CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text, ZYLBDM text, ZYMC text ) CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH ...
(SELECT jybgb.BBCJBW 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 person_info.XM = '韩安和' AND j...
css
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date...
SELECT JOB_ID, AVG(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID DESC
nvbench
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '35540831' AND NOT zyjzjlb.JZLSH IN (SELECT zyjybgb.JZLSH FROM zyjybgb WHERE zyjybgb.BGRQ >= '2012-12-15' UNION SELECT mzjybgb.JZLSH FROM mzjybgb WHERE mzjybgb...
css
CREATE TABLE table_51528 ( "Feb 2010" text, "Mar 2010" text, "May 2010" real, "Jun 2010" real, "Jul 2010" real, "Aug 2010" real, "Sep 2010" real, "Oct 2010" real, "Nov 2010" real, "Dec 2010" real, "Jan 2011" real, "Feb 2011" real, "Mar 2011" real, "Apr 2011" real,...
SELECT MAX("Aug 2013") FROM table_51528 WHERE "Nov 2011" < '968' AND "Jul 2012" = '31' AND "Jun 2011" > '30'
wikisql
CREATE TABLE table_24626 ( "Round" real, "Date" text, "City and venue" text, "Winner" text, "Runner-up" text, "3rd placed" text, "4th placed" text, "Results" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many rounds were on July 10?...
SELECT COUNT("Round") FROM table_24626 WHERE "Date" = 'July 10'
wikisql
CREATE TABLE table_203_268 ( id number, "date" text, "name" text, "nationality" text, "tonnage\n(grt)" number, "fate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what country lost the most ships to u-502 ?
SELECT "nationality" FROM table_203_268 GROUP BY "nationality" ORDER BY COUNT("name") DESC LIMIT 1
squall
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-14065...
eicu
CREATE TABLE table_15822 ( "District" text, "Counties Represented" text, "Party" text, "First Elected" real, "Committee" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What district has counties represented by Baltimore county, a committee of health...
SELECT "District" FROM table_15822 WHERE "Counties Represented" = 'baltimore county' AND "Committee" = 'health and government operations' AND "First Elected" < '2002'
wikisql
CREATE TABLE table_203_333 ( id number, "kilometers" number, "name" text, "location" text, "intersecting routes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the number of routes that intersect highway 91 ?
SELECT COUNT("intersecting routes") FROM table_203_333
squall
CREATE TABLE table_33617 ( "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. -- Who is the home side when the away side scores 1...
SELECT "Home team" FROM table_33617 WHERE "Away team score" = '11.15 (81)'
wikisql
CREATE TABLE status ( station_id INTEGER, bikes_available INTEGER, docks_available INTEGER, time TEXT ) CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT ) CREATE TABLE weather ( date TEXT, ...
SELECT date, COUNT(date) FROM weather ORDER BY COUNT(date)
nvbench
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Kurt Buczek"
mimicsql_data
CREATE TABLE exhibition_record ( Exhibition_ID int, Date text, Attendance int ) CREATE TABLE artist ( Artist_ID int, Name text, Country text, Year_Join int, Age int ) CREATE TABLE exhibition ( Exhibition_ID int, Year int, Theme text, Artist_ID int, Ticket_Price real...
SELECT T1.Date, T1.Attendance FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.Exhibition_ID = T2.Exhibition_ID WHERE T2.Year = 2004
nvbench
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE ReviewT...
SELECT Id AS "post_link", Tags FROM Posts WHERE LENGTH(Body) < 100 AND PostTypeId = 1 AND ClosedDate IS NULL AND DeletionDate IS NULL AND CommunityOwnedDate IS NULL AND AnswerCount = 0 AND CommentCount > 0 AND FavoriteCount > 0
sede
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 gwyjzb.MED_SER_ORG_NO FROM gwyjzb WHERE gwyjzb.PERSON_ID = '18716926' GROUP BY gwyjzb.MED_SER_ORG_NO ORDER BY COUNT(*) DESC UNION SELECT fgwyjzb.MED_SER_ORG_NO FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '18716926' GROUP BY fgwyjzb.MED_SER_ORG_NO ORDER BY COUNT(*) DESC
css
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT zyjzjlb.CYKSDM, zyjzjlb.CYKSMC FROM zyjzjlb WHERE zyjzjlb.JZLSH = '58630087217'
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 T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name DESC
nvbench
CREATE TABLE table_74082 ( "Club" text, "Played" text, "Won" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Points" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which club lost exactly...
SELECT "Club" FROM table_74082 WHERE "Lost" = '7'
wikisql
CREATE TABLE table_name_32 ( tie_no VARCHAR, date VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Tie no, when Date is '18 Nov 1989', and when Home Team is 'Doncaster Rovers'?
SELECT tie_no FROM table_name_32 WHERE date = "18 nov 1989" AND home_team = "doncaster rovers"
sql_create_context
CREATE TABLE table_67152 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On August 22, how many people came to the game?
SELECT "Attendance" FROM table_67152 WHERE "Date" = 'august 22'
wikisql
CREATE TABLE table_1342270_42 ( first_elected INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the latest year any of the incumbents were first elected?
SELECT MAX(first_elected) FROM table_1342270_42
sql_create_context
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id n...
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 = 'oth spf gastrt w h...
mimic_iii
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT jyjgzbb.JCZBMC, jyjgzbb.JCZBJGDW, AVG(jyjgzbb.JCZBJGDL) FROM jyjgzbb JOIN jybgb_jyjgzbb JOIN jybgb ON jybgb_jyjgzbb.JYZBLSH = jyjgzbb.JYZBLSH AND jybgb_jyjgzbb.jyjgzbb_id = jyjgzbb.jyjgzbb_id AND jybgb_jyjgzbb.YLJGDM = jybgb.YLJGDM WHERE jybgb.YLJGDM = '6821167' AND jyjgzbb.BGRQ BETWEEN '2004-12-07' AND '2018-11...
css
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 outputevents ( row_id number, subject_id number, ha...
SELECT t1.startdate FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'vial' AND admissions.subject_id = 88659 AND STRFTIME('%y-%m', prescriptions.startdate) >= '2104-04') AS t1 JOIN (SELECT admissions....
mimic_iii
CREATE TABLE table_20379 ( "N\u00b0" real, "Television service" text, "Country" text, "Language" text, "Content" text, "DAR" text, "HDTV" text, "PPV" text, "Package/Option" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the ppv ...
SELECT "PPV" FROM table_20379 WHERE "Package/Option" = 'Sky Famiglia' AND "DAR" = '16:9' AND "Television service" = 'MTV Dance'
wikisql
CREATE TABLE protein ( common_name text, protein_name text, divergence_from_human_lineage real, accession_number text, sequence_length real, sequence_identity_to_human_protein text, Institution_id text ) CREATE TABLE building ( building_id text, Name text, Street_address text, ...
SELECT Institution, COUNT(*) FROM Institution AS T1 JOIN protein AS T2 ON T1.Institution_id = T2.Institution_id GROUP BY T1.Institution_id ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_48174 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the record when the round is before 3 and t...
SELECT "Record" FROM table_48174 WHERE "Round" < '3' AND "Time" = '4:59'
wikisql
CREATE TABLE Subjects ( subject_id INTEGER, subject_name VARCHAR(120) ) CREATE TABLE Students ( student_id INTEGER, date_of_registration DATETIME, date_of_latest_logon DATETIME, login_name VARCHAR(40), password VARCHAR(10), personal_name VARCHAR(40), middle_name VARCHAR(40), fam...
SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Pass" GROUP BY date_of_enrolment
nvbench
CREATE TABLE table_name_43 ( date VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was 11-8 the record?
SELECT date FROM table_name_43 WHERE record = "11-8"
sql_create_context
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT wdmzjzjlb.JZLSH FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '27848867' AND NOT wdmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2004-10-16') UNION SELECT bdmzjzjlb.JZLSH FROM hz_info JOIN...
css
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "LEFT COLON CANCER" AND demographic.age < "67"
mimicsql_data
CREATE TABLE table_name_67 ( share INTEGER, viewers__m_ VARCHAR, timeslot_rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest share for a timeslot ranking less than 4 and fewer viewers than 8.78 million?
SELECT MIN(share) FROM table_name_67 WHERE viewers__m_ < 8.78 AND timeslot_rank < 4
sql_create_context
CREATE TABLE table_41299 ( "Date" text, "Tournament" text, "Surface" text, "Partnering" text, "Opponent in the final" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What surface was played on with a score of 6 4, 6 3 and on 4 May 1...
SELECT "Surface" FROM table_41299 WHERE "Score" = '6–4, 6–3' AND "Date" = '4 may 1992'
wikisql
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId...
SELECT Questions.Score AS QuestionScore, AVG(Answers.Score) AS AnswerScore FROM Posts AS Questions INNER JOIN PostTags ON Questions.Id = PostTags.PostId INNER JOIN Tags ON PostTags.TagId = Tags.Id INNER JOIN Posts AS Answers ON Answers.Id = Questions.AcceptedAnswerId WHERE Questions.Score BETWEEN 1 AND 20 AND Tags.TagN...
sede
CREATE TABLE table_47681 ( "Rider" text, "Manufacturer" text, "Laps" text, "Time/Retired" text, "Grid" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE MANUFACTURER WITH 24 LAPS, AND +1.965 TIME/RETIRED?
SELECT "Manufacturer" FROM table_47681 WHERE "Laps" = '24' AND "Time/Retired" = '+1.965'
wikisql