instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE STUDENT ( STU_NUM int, STU_LNAME varchar(15), STU_FNAME varchar(15), STU_INIT varchar(1), STU_DOB datetime, STU_HRS int, STU_CLASS varchar(2), STU_GPA float(8), STU_TRANSFER numeric, DEPT_CODE varchar(18), STU_PHONE varchar(4), PROF_NUM int ) CREATE TABLE EN...
SELECT CRS_CODE, COUNT(*) FROM CLASS GROUP BY CRS_CODE
nvbench
CREATE TABLE Customers ( Customer_ID VARCHAR(100), Address_ID INTEGER, Customer_Name VARCHAR(255), Customer_Phone VARCHAR(255), Customer_Email_Address VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Customer_Orders ( Order_ID INTEGER, Customer_ID INTEGER, Store_ID INTEGER, ...
SELECT Service_Type_Description, COUNT(Service_Type_Description) FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Price > 100 GROUP BY Service_Type_Description ORDER BY COUNT(Service_Type_Description) DESC
nvbench
CREATE TABLE table_name_85 ( copies_sold VARCHAR, oricon_position VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many copies were sold where the position is lager than 1 in 1988?
SELECT copies_sold FROM table_name_85 WHERE oricon_position > 1 AND year = 1988
sql_create_context
CREATE TABLE table_name_49 ( visitor VARCHAR, home VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the Visitor when the Home team was Anaheim on the Date of April 12?
SELECT visitor FROM table_name_49 WHERE home = "anaheim" AND date = "april 12"
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 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 WHERE demographic.admission_type = "EMERGENCY" AND demographic.dob_year < "2064"
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 COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '31811112' AND t_kc22.STA_DATE BETWEEN '2014-10-25' AND '2015-12-28' AND t_kc22.SOC_SRT_DIRE_CD = '445109937'
css
CREATE TABLE table_8563 ( "Placement" real, "Name" text, "Event" text, "Final" text, "Year" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the lowest placement with a final of 23.92?
SELECT MIN("Placement") FROM table_8563 WHERE "Final" = '23.92'
wikisql
CREATE TABLE table_23296 ( "#" real, "Player" text, "Age" real, "Australian Open" real, "French Open" real, "Wimbledon" real, "US Open" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who won the French Open in 1999?
SELECT "Player" FROM table_23296 WHERE "French Open" = '1999'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, ...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND 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...
css
CREATE TABLE table_23936 ( "County" text, "Obama%" text, "Obama#" real, "McCain%" text, "McCain#" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people voted for Obama in the county where McCain got 72.75% of the votes?
SELECT MIN("Obama#") FROM table_23936 WHERE "McCain%" = '72.75%'
wikisql
CREATE TABLE ftxmzjzjlb ( 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, MZZYZD...
SELECT (SELECT COUNT(*) FROM person_info JOIN hz_info JOIN txmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE person_info.XM = '马璇珠' AND txmzjzjlb.JZKSRQ BETWEEN '2021-08-25' AND '2021-09-05' UNION SELECT COUNT(*) FROM p...
css
CREATE TABLE table_name_80 ( home_team VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What home team has blackpool as the away team?
SELECT home_team FROM table_name_80 WHERE away_team = "blackpool"
sql_create_context
CREATE TABLE table_34129 ( "Year" real, "Division" real, "League" text, "Regular Season" text, "Playoffs" text, "Open Cup" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Year is the lowest one that has a Regular Season of 5th, atlantic, an...
SELECT MIN("Year") FROM table_34129 WHERE "Regular Season" = '5th, atlantic' AND "Division" > '4'
wikisql
CREATE TABLE table_55207 ( "Year" real, "Category" text, "Character" text, "For The Show" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For 2006 what category has the Show of kasautii zindagii kay?
SELECT "Category" FROM table_55207 WHERE "For The Show" = 'kasautii zindagii kay' AND "Year" = '2006'
wikisql
CREATE TABLE table_name_98 ( team_1 VARCHAR, team_2 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the team 1 when Ulisses is team 2?
SELECT team_1 FROM table_name_98 WHERE team_2 = "ulisses"
sql_create_context
CREATE TABLE table_43712 ( "Date" text, "Venue" text, "Opponents" text, "Score" text, "Comp" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where was the game played when the score was 1-4?
SELECT "Venue" FROM table_43712 WHERE "Score" = '1-4'
wikisql
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) 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, ...
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 = 4758)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial ...
mimic_iii
CREATE TABLE table_2897457_3 ( college_junior_club_team VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which college/junior/club team has jim mathieson as the player?
SELECT college_junior_club_team FROM table_2897457_3 WHERE player = "Jim Mathieson"
sql_create_context
CREATE TABLE table_name_56 ( location_attendance VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On December 3, where was the game held and how many were in attendance?
SELECT location_attendance FROM table_name_56 WHERE date = "december 3"
sql_create_context
CREATE TABLE table_name_95 ( transfer_window VARCHAR, ends INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which transfer window ends after 2006?
SELECT transfer_window FROM table_name_95 WHERE ends > 2006
sql_create_context
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 departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE...
SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(SALARY) DESC
nvbench
CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments ...
SELECT DISTINCT number FROM course WHERE (description LIKE '%Dance Laboratory%' OR name LIKE '%Dance Laboratory%') AND department = 'EECS'
advising
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
SELECT COUNT(*) FROM Posts AS p INNER JOIN Posts AS a ON a.ParentId = p.Id WHERE p.Title = 'Site statistics'
sede
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 d_icd_diagnoses ( ...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15447 AND admissions.dischtime IS NULL)) AND transfers...
mimic_iii
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 demographic ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Abn react-procedure NOS"
mimicsql_data
CREATE TABLE table_203_354 ( id number, "party" text, "candidate(s)" text, "votes" number, "percentage" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the number of parties that had more than 3 candidates in their party ?
SELECT COUNT("party") FROM table_203_354 WHERE "candidate(s)" > 3
squall
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 jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON 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 AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jy...
css
CREATE TABLE table_name_40 ( tyres VARCHAR, chassis VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What tyres were used with the mp4/14 chassis?
SELECT tyres FROM table_name_40 WHERE chassis = "mp4/14"
sql_create_context
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE i...
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-13750')) AND DATETIME(medication.drugstarttime, 'start of ...
eicu
CREATE TABLE table_71644 ( "Year" real, "English title" text, "Original title" text, "Country" text, "Director(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the English title of the film directed by Fernando Meirelles?
SELECT "English title" FROM table_71644 WHERE "Director(s)" = 'fernando meirelles'
wikisql
CREATE TABLE table_name_87 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2010 when the 2009 is 1r, and a 2008 is 1r?
SELECT 2010 FROM table_name_87 WHERE 2009 = "1r" AND 2008 = "1r"
sql_create_context
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE regions ( REGION_...
SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY SUM(EMPLOYEE_ID)
nvbench
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text,...
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT inputevents_cv.itemid 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 = 462)) AND STRFTIME('%y-%m-%d', input...
mimic_iii
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuo...
SELECT admissions.dischtime FROM admissions WHERE admissions.subject_id = 3929 AND DATETIME(admissions.dischtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY admissions.dischtime DESC LIMIT 1
mimic_iii
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.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T1.Code
nvbench
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code tex...
SELECT t1.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication GROUP BY medication.drugname) AS t1 WHERE t1.c1 <= 3
eicu
CREATE TABLE table_name_6 ( constructor VARCHAR, grid INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the constructor for the driver with grid less than 2?
SELECT constructor FROM table_name_6 WHERE grid < 2
sql_create_context
CREATE TABLE table_23565 ( "English Name" text, "Simplified" text, "Traditional" text, "Pinyin" text, "Foochow" text, "Area" real, "Population" real, "Density" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the pinyin for ci - ng-g ...
SELECT "Pinyin" FROM table_23565 WHERE "Foochow" = 'Ciá-ìng-gâing'
wikisql
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE jybgb ( BBCJBW text, BBDM tex...
SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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.JZLSH = jybgb.JZLSH_MZJZJLB ...
css
CREATE TABLE host ( host_id number, name text, nationality text, age text ) CREATE TABLE party ( party_id number, party_theme text, location text, first_year text, last_year text, number_of_hosts number ) CREATE TABLE party_host ( party_id number, host_id number, is...
SELECT name FROM host WHERE NOT host_id IN (SELECT host_id FROM party_host)
spider
CREATE TABLE table_38187 ( "Game" text, "Date" text, "Home Team" text, "Result" text, "Road Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what team played on may 20 on the home side
SELECT "Home Team" FROM table_38187 WHERE "Date" = 'may 20'
wikisql
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE labevents ( row_id number, ...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', admissions.admittime)) FROM admissions WHERE admissions.subject_id = 2518 AND admissions.dischtime IS NULL
mimic_iii
CREATE TABLE table_203_460 ( id number, "player" text, "played" number, "legs won" number, "legs lost" number, "lwat" number, "100+" number, "140+" number, "180s" number, "high checkout" number, "3-dart average" number ) -- Using valid SQLite, answer the following questions...
SELECT "player" FROM table_203_460 WHERE "player" IN ('andy smith', 'kevin painter') AND "3-dart average" = 96.71
squall
CREATE TABLE table_68356 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( \u00a3 )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the to par for score of 69-73-68-70=280
SELECT "To par" FROM table_68356 WHERE "Score" = '69-73-68-70=280'
wikisql
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
SELECT Id, Title, Body, Tags FROM Posts WHERE Id < 500000 AND Score >= 8
sede
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 d_icd_diagnoses ( row_id number, icd9_code text, sh...
SELECT admissions.dischtime FROM admissions WHERE admissions.subject_id = 95088 AND DATETIME(admissions.dischtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY admissions.dischtime DESC LIMIT 1
mimic_iii
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CRE...
SELECT DATEADD(MONTH, DATEDIFF(MONTH, 0, CreationDate), 0) AS "month", CAST(COUNT(CASE WHEN (NOT Posts.ClosedDate IS NULL AND PostHistory.PostHistoryTypeId = 10 AND PostHistory.Comment IN ('1', '101')) THEN 1 ELSE NULL END) AS FLOAT) * 100 / COUNT(CASE WHEN PostHistory.PostHistoryTypeId = 1 THEN 1 ELSE NULL END) AS "Du...
sede
CREATE TABLE table_name_55 ( bronze VARCHAR, silver VARCHAR, gold VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What bronze has tatiana ryabkina as the silver, anne margrethe hausken as the gold?
SELECT bronze FROM table_name_55 WHERE silver = "tatiana ryabkina" AND gold = "anne margrethe hausken"
sql_create_context
CREATE TABLE table_21498 ( "Season" text, "Games" real, "GS" real, "Points" text, "Rebounds" text, "Assists" text, "Blocks" text, "Steals" text, "Turnovers" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the steals for season 20...
SELECT "Steals" FROM table_21498 WHERE "Season" = '2007/2008'
wikisql
CREATE TABLE table_204_251 ( id number, "community" text, "area" text, "location" text, "population" number, "date established" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- total population of millbrook first nation
SELECT "population" FROM table_204_251 WHERE "community" = 'millbrook 27'
squall
CREATE TABLE table_33927 ( "Model Number" text, "Stepping" text, "Frequency" text, "L2 Cache" text, "Multi 1" text, "V Core" text, "Socket" text, "Release Date" text, "Part Number(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Wh...
SELECT "Part Number(s)" FROM table_33927 WHERE "Model Number" = 'athlon x2 4850e'
wikisql
CREATE TABLE table_31928 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponent in the final" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the surface made of in the contest where...
SELECT "Surface" FROM table_31928 WHERE "Partner" = 'paula ormaechea'
wikisql
CREATE TABLE table_18248 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the incumbent that is listed with the candidates listed as marily...
SELECT "Incumbent" FROM table_18248 WHERE "Candidates" = 'Marilyn Lloyd (D) 57.4% Harold W. Coker (R) 42.6%'
wikisql
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 * FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jy...
css
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '水高翰' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2000-01-07' AND '2004-02-14' AND t_kc22.MED_INV_ITEM_TYPE = '手术费'
css
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(Price)) FROM wine ORDER BY AVG(MAX(Price))
nvbench
CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE swimme...
SELECT meter_400, meter_100 FROM swimmer
nvbench
CREATE TABLE table_21731 ( "Series #" real, "Episode #" real, "Title" text, "Directed by" text, "Written by" text, "U.S. viewers (million)" text, "Original airdate" text, "Production Code" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- W...
SELECT "Original airdate" FROM table_21731 WHERE "U.S. viewers (million)" = '3.73'
wikisql
CREATE TABLE table_23215145_2 ( team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2006-2007 points minimum is the team is Overmach Parma?
SELECT MIN(2006 AS _07_points) FROM table_23215145_2 WHERE team = "Overmach Parma"
sql_create_context
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time )...
SELECT COUNT(DISTINCT patient.patientunitstayid) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-69449') AND STRFTIME('%y', patient.unitadmittime) = '2105'
eicu
CREATE TABLE table_28725 ( "No." real, "#" real, "Title" text, "Directed by" text, "Written by" text, "U.S. air date" text, "Production code" text, "U.S. viewers (million)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many million ...
SELECT "U.S. viewers (million)" FROM table_28725 WHERE "Production code" = '3X6004'
wikisql
CREATE TABLE table_75354 ( "Call sign" text, "Frequency MHz" real, "City of license" text, "ERP W" real, "Class" text, "FCC info" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the FCC info of the translator with an Irmo, South Carolina ...
SELECT "FCC info" FROM table_75354 WHERE "City of license" = 'irmo, south carolina'
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "METO25"
mimicsql_data
CREATE TABLE table_name_9 ( opponent VARCHAR, home_away VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the opponent which has a home/away of home and date of july 27
SELECT opponent FROM table_name_9 WHERE home_away = "home" AND date = "july 27"
sql_create_context
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 SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '4227077' AND t_kc22.STA_DATE BETWEEN '2013-03-08' AND '2021-05-12' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE table_28027307_1 ( directed_by VARCHAR, production_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who directed the episode with the production code of 6AKY11?
SELECT directed_by FROM table_28027307_1 WHERE production_code = "6AKY11"
sql_create_context
CREATE TABLE table_name_48 ( sr INTEGER, average VARCHAR, balls_faced VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which average S.R. has an Average of 39.13 and Balls Faced larger than 318?
SELECT AVG(sr) FROM table_name_48 WHERE average = 39.13 AND balls_faced > 318
sql_create_context
CREATE TABLE table_name_8 ( score VARCHAR, home VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Score when the Home team is Chicago Black Hawks and the Record is 3-3?
SELECT score FROM table_name_8 WHERE home = "chicago black hawks" AND record = "3-3"
sql_create_context
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
SELECT DISTINCT program_course.workload FROM course, program_course WHERE course.department = 'EECS' AND course.number = 201 AND program_course.course_id = course.course_id
advising
CREATE TABLE table_203_35 ( id number, "pos" text, "rider" text, "manufacturer" text, "time/retired" text, "points" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the difference between marcellino lucchi 's points and max biaggi 's poi...
SELECT (SELECT "points" FROM table_203_35 WHERE "rider" = 'max biaggi') - (SELECT "points" FROM table_203_35 WHERE "rider" = 'marcellino lucchi')
squall
CREATE TABLE table_76367 ( "Poll source" text, "Dates administered" text, "Arlen Specter*" text, "Pat Toomey" text, "Tom Ridge*" text, "Peg Luksik" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Poll source has a Peg Luksik of 9%, and Date...
SELECT "Poll source" FROM table_76367 WHERE "Peg Luksik" = '9%' AND "Dates administered" = 'may 12, 2010'
wikisql
CREATE TABLE Documents_with_Expenses ( Document_ID INTEGER, Budget_Type_Code CHAR(15), Document_Details VARCHAR(255) ) CREATE TABLE Accounts ( Account_ID INTEGER, Statement_ID INTEGER, Account_Details VARCHAR(255) ) CREATE TABLE Documents ( Document_ID INTEGER, Document_Type_Code CHAR(...
SELECT Statement_Details, AVG(Account_Details) FROM Accounts AS T1 JOIN Statements AS T2 ON T1.Statement_ID = T2.Statement_ID GROUP BY Statement_Details ORDER BY Statement_Details
nvbench
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT t_kc21.IN_DIAG_DIS_CD, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '5333311' GROUP BY t_kc21.IN_DIAG_DIS_CD
css
CREATE TABLE table_name_66 ( round VARCHAR, overall VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many rounds have an Overall larger than 17, and a Position of quarterback?
SELECT COUNT(round) FROM table_name_66 WHERE overall > 17 AND position = "quarterback"
sql_create_context
CREATE TABLE table_73917 ( "Outcome" text, "No." text, "Date" text, "Championship" text, "Surface" text, "Opponent in the final" text, "Score in the final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where the outcome is Winner and surfac...
SELECT "No." FROM table_73917 WHERE "Outcome" = 'Winner' AND "Surface" = 'Hard (i)'
wikisql
CREATE TABLE film_market_estimation ( estimation_id number, low_estimate number, high_estimate number, film_id number, type text, market_id number, year number ) CREATE TABLE film ( film_id number, title text, studio text, director text, gross_in_dollar number ) CREATE ...
SELECT DISTINCT director FROM film
spider
CREATE TABLE table_47981 ( "Match" text, "Date" text, "Location" text, "Lineup" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result for the match with entry Match Reports?
SELECT "Result" FROM table_47981 WHERE "Match" = 'match reports'
wikisql
CREATE TABLE table_74210 ( "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. -- How ma...
SELECT COUNT("High points") FROM table_74210 WHERE "High assists" = 'A. Webb (7)'
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Neonatal thrombocytopen" AND lab.flag = "delta"
mimicsql_data
CREATE TABLE table_21618 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the series number directed by richard thorpe written by dee...
SELECT MAX("Series #") FROM table_21618 WHERE "Directed by" = 'Richard Thorpe' AND "Written by" = 'Dee Johnson'
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "GASTROINTESTINAL BLEED" AND demographic.admityear < "2124"
mimicsql_data
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 PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE varchar(50), PROF_EXTENSION varchar(4), ...
SELECT SCHOOL_CODE, COUNT(*) FROM DEPARTMENT AS T1 JOIN PROFESSOR AS T2 ON T1.DEPT_CODE = T2.DEPT_CODE GROUP BY T1.SCHOOL_CODE ORDER BY SCHOOL_CODE DESC
nvbench
CREATE TABLE table_78659 ( "Season" real, "Average Attendance Home" real, "Highest Attendance Home" text, "Average Attendance Away" real, "Highest Attendance Away" text, "Division / Section" text, "Level" text, "Average Attendance League" real ) -- Using valid SQLite, answer the follow...
SELECT SUM("Season") FROM table_78659 WHERE "Average Attendance League" = '2.456'
wikisql
CREATE TABLE table_52273 ( "Year" real, "Theme" text, "Artist" text, "Issue Price" real, "Special Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the special notes value for years under 2009?
SELECT "Special Notes" FROM table_52273 WHERE "Year" < '2009'
wikisql
CREATE TABLE product ( product_name VARCHAR, product_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List all the distinct product names ordered by product id?
SELECT DISTINCT product_name FROM product ORDER BY product_id
sql_create_context
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time...
SELECT MIN(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 52456) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'lipase') AND DATETIME(labevents.charttime, 'start of month') = DATETIME(CUR...
mimic_iii
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), ...
SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY SUM(EMPLOYEE_ID) DESC
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Encephalopathy NOS"
mimicsql_data
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text...
SELECT meter_400, meter_100 FROM swimmer ORDER BY meter_100 DESC
nvbench
CREATE TABLE table_name_86 ( listed VARCHAR, county VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the listed for the bridge at Daniel in Sublette county?
SELECT listed FROM table_name_86 WHERE county = "sublette" AND location = "daniel"
sql_create_context
CREATE TABLE table_name_30 ( manner_of_departure VARCHAR, date_of_vacancy VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the manner of departure for the vacancy date of 20 September 2009?
SELECT manner_of_departure FROM table_name_30 WHERE date_of_vacancy = "20 september 2009"
sql_create_context
CREATE TABLE table_6206 ( "Speaker" text, "Party" text, "City" text, "County" text, "Term" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what city is brule in
SELECT "City" FROM table_6206 WHERE "County" = 'brule'
wikisql
CREATE TABLE Courses ( course_id INTEGER, author_id INTEGER, subject_id INTEGER, course_name VARCHAR(120), course_description VARCHAR(255) ) CREATE TABLE Student_Course_Enrolment ( registration_id INTEGER, student_id INTEGER, course_id INTEGER, date_of_enrolment DATETIME, date_o...
SELECT middle_name, author_id FROM Course_Authors_and_Tutors ORDER BY personal_name
nvbench
CREATE TABLE table_27887723_1 ( race_name VARCHAR, uci_rating VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what race name had a uci rating of cn?
SELECT race_name FROM table_27887723_1 WHERE uci_rating = "CN"
sql_create_context
CREATE TABLE table_45203 ( "Name" text, "Category" text, "Eliminated" text, "Date" text, "Special Guest" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date was elimination on final night?
SELECT "Date" FROM table_45203 WHERE "Eliminated" = 'final night'
wikisql
CREATE TABLE table_name_74 ( place VARCHAR, country VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where did Bob Murphy of the United States place?
SELECT place FROM table_name_74 WHERE country = "united states" AND player = "bob murphy"
sql_create_context
CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE has_allergy ( stuid number, allergy text ) CREATE TABLE allergy_type ( allergy text, allergytype text ) -- Using valid SQLite...
SELECT stuid FROM student EXCEPT SELECT stuid FROM has_allergy
spider
CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname var...
SELECT DISTINCT course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (course.number = 698 OR course.number = 442) AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 INNER JOIN course AS COURSEalias1 ON ...
advising
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.icd9_code = "E9300" AND prescriptions.drug_type = "MAIN"
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 demographic.diagnosis FROM demographic WHERE demographic.subject_id = "3343"
mimicsql_data