instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_39816 ( "Date" text, "Opponent" text, "Location" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On 10/20/1979*, who was the Opponent?
SELECT "Opponent" FROM table_39816 WHERE "Date" = '10/20/1979*'
wikisql
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 AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc21_t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_AGE >= 15)
css
CREATE TABLE table_name_22 ( entrant VARCHAR, points VARCHAR, year VARCHAR, chassis VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which entrant after 1987 had 12 points and a benetton b188 chassis?
SELECT entrant FROM table_name_22 WHERE year > 1987 AND chassis = "benetton b188" AND points = 12
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE 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.discharge_location = "SHORT TERM HOSPITAL" AND demographic.dob_year < "2078"
mimicsql_data
CREATE TABLE table_59376 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" real, "Finish" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest to par number for Justin Leonard when the total is less than 2...
SELECT MAX("To par") FROM table_59376 WHERE "Player" = 'justin leonard' AND "Total" < '297'
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 COUNT(*) FROM zyjzjlb WHERE zyjzjlb.YLJGDM = '9671953' AND zyjzjlb.JZKSMC = '风湿免疫科' AND zyjzjlb.RYDJSJ BETWEEN '2002-10-11' AND '2015-12-04'
css
CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, dire...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BAL...
atis
CREATE TABLE Timed_Status_of_Things ( thing_id INTEGER, Date_and_Date DATETIME, Status_of_Thing_Code CHAR(15) ) CREATE TABLE Customer_Event_Notes ( Customer_Event_Note_ID INTEGER, Customer_Event_ID INTEGER, service_type_code CHAR(15), resident_id INTEGER, property_id INTEGER, date_m...
SELECT T1.property_id, COUNT(*) FROM Properties AS T1 JOIN Residents AS T2 ON T1.property_id = T2.property_id GROUP BY T1.property_id
nvbench
CREATE TABLE table_name_23 ( nicd VARCHAR, type VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is NiCd, when Type is 'Capacity under 500mA constant Drain'?
SELECT nicd FROM table_name_23 WHERE type = "capacity under 500ma constant drain"
sql_create_context
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'diagnoses_icd' AND cost.event_id IN (SELECT diagnoses_icd.row_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'accident in place nec'))
mimic_iii
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH text, MZJZLSH text, KH text, KLX number, HZXM text, WDBZ number, RYDJSJ time, RYTJDM number, RYTJMC text, JZKSDM text, JZKSMC text, RZBQDM t...
SELECT JYLX FROM jybgb WHERE BGDH = '23063677904'
css
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 OUT_DIAG_DIS_CD, OUT_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_ID = '82924837' AND MED_SER_ORG_NO = '2605232' AND OUT_DIAG_DOC_NM LIKE '施%'
css
CREATE TABLE student ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many students are there?
SELECT COUNT(*) FROM student
sql_create_context
CREATE TABLE table_14478 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- in what year were 2 points scored?
SELECT MAX("Year") FROM table_14478 WHERE "Points" = '2'
wikisql
CREATE TABLE table_65704 ( "Score" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What score has 15.0% as the 2012?
SELECT "Score" FROM table_65704 WHERE "2012" = '15.0%'
wikisql
CREATE TABLE table_203_208 ( id number, "team" text, "location" text, "venue" text, "capacity" number, "position in 1993-94" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many venues did the league play during this particular season ?
SELECT COUNT(DISTINCT "venue") FROM table_203_208
squall
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25...
SELECT SALARY, MANAGER_ID FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history)
nvbench
CREATE TABLE table_71071 ( "Year" real, "Country" text, "Nominated work" text, "Award" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result for work made by Neil Finn?
SELECT "Result" FROM table_71071 WHERE "Nominated work" = 'neil finn'
wikisql
CREATE TABLE table_name_52 ( attribute VARCHAR, category VARCHAR, cancelable VARCHAR, bubbles VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When Cancelable of yes, bubble of yes and a Category of keyboard, what was the Attribute?
SELECT attribute FROM table_name_52 WHERE cancelable = "yes" AND bubbles = "yes" AND category = "keyboard"
sql_create_context
CREATE TABLE table_20938 ( "Number" real, "Name" text, "Kilometer" real, "Pavement" text, "Length (m)" real, "Average climb (%)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average climb for Tenbosse?
SELECT MIN("Average climb (%)") FROM table_20938 WHERE "Name" = 'Tenbosse'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime...
SELECT diagnosis.diagnosistime FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-1391')) AND diagnosis.diagnosisname = 'ventricular premature ...
eicu
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 swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text...
SELECT meter_600, meter_100 FROM swimmer ORDER BY meter_600
nvbench
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...
WITH Keyed AS (SELECT CAST(Posts.Score AS FLOAT) AS Score, POWER(ROUND(SQRT(LENGTH(Body)), 0), 2) AS PostLength FROM Posts WHERE PostTypeId = 1), Sized AS (SELECT PostLength, AVG(Score) AS MeanScore, COUNT(Score) AS ClusterSize FROM Keyed GROUP BY PostLength) SELECT PostLength, MeanScore, ClusterSize FROM Sized WHERE C...
sede
CREATE TABLE table_name_52 ( venue VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where was the away team st kilda?
SELECT venue FROM table_name_52 WHERE away_team = "st kilda"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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...
SELECT jybgb.BGRGH, jybgb.BGRXM FROM jybgb WHERE jybgb.JZLSH = '15125060354' GROUP BY jybgb.BGRGH HAVING COUNT(*) > 26
css
CREATE TABLE table_44217 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the game date for week 7?
SELECT "Date" FROM table_44217 WHERE "Week" = '7'
wikisql
CREATE TABLE table_11677100_18 ( school VARCHAR, hometown VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the school of the player from Lake Charles, LA?
SELECT school FROM table_11677100_18 WHERE hometown = "Lake Charles, LA"
sql_create_context
CREATE TABLE table_38621 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest number of points team vit r...
SELECT MAX("Points") FROM table_38621 WHERE "Team" = 'vitória' AND "Played" > '38'
wikisql
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) 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, H...
SELECT t_kc21.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_NM = '华俊誉'
css
CREATE TABLE table_204_940 ( id number, "year" number, "tournaments\nplayed" number, "cuts\nmade" number, "wins" number, "2nd" number, "3rd" number, "top 10s" number, "best\nfinish" text, "earnings\n(\u20ac)" number, "money\nlist rank" number, "scoring\naverage" number, ...
SELECT SUM("top 10s") FROM table_204_940
squall
CREATE TABLE table_40463 ( "Rank by average" text, "Place" text, "Perfect 40s" text, "Total" text, "Number of dances" text, "Season" text, "Average" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total with a 74 rank by average f...
SELECT "Total" FROM table_40463 WHERE "Rank by average" = '74' AND "Place" = '8th'
wikisql
CREATE TABLE table_75082 ( "Venue" text, "Home" text, "Guest" text, "Score" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the attendance of the game that had an away team of FK Mogren?
SELECT "Attendance" FROM table_75082 WHERE "Guest" = 'fk mogren'
wikisql
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationD...
SELECT Id, OwnerUserId, CreationDate, Score FROM Posts WHERE PostTypeId = 1 AND ClosedDate IS NULL AND CreationDate >= '2013-01-01' ORDER BY Id
sede
CREATE TABLE table_27733909_7 ( team VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the team for january 17
SELECT team FROM table_27733909_7 WHERE date = "January 17"
sql_create_context
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 COUNT(*) FROM jybgb WHERE jybgb.YLJGDM = '9692570' AND jybgb.BGRQ BETWEEN '2002-02-27' AND '2016-10-08'
css
CREATE TABLE table_name_18 ( win_percentage INTEGER, losses VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest win percentage when there were 23 losses?
SELECT MAX(win_percentage) FROM table_name_18 WHERE losses = 23
sql_create_context
CREATE TABLE table_46615 ( "Date" text, "Home" text, "Score" text, "Away" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the home team during the match where there were 2709 in attendance?
SELECT "Home" FROM table_46615 WHERE "Attendance" = '2709'
wikisql
CREATE TABLE table_204_889 ( id number, "date" text, "week (stage)" text, "song choice" text, "original artist" text, "theme" text, "result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many weeks was babou safe on the x factor
SELECT COUNT(DISTINCT "week (stage)") FROM table_204_889 WHERE "result" = 'safe'
squall
CREATE TABLE table_37831 ( "Year" real, "English title" text, "Original title" text, "Country" text, "Length" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many years have an Original title of ?
SELECT COUNT("Year") FROM table_37831 WHERE "Original title" = 'иваново детство'
wikisql
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
SELECT STRFTIME('%j', icustays.outtime) - STRFTIME('%j', icustays.intime) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28484) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1
mimic_iii
CREATE TABLE store_district ( Store_ID int, District_ID int ) CREATE TABLE district ( District_ID int, District_name text, Headquartered_City text, City_Population real, City_Area real ) CREATE TABLE product ( product_id int, product text, dimensions text, dpi real, pag...
SELECT Type, COUNT(*) FROM store GROUP BY Type ORDER BY COUNT(*)
nvbench
CREATE TABLE table_3037 ( "Character" text, "Original Berkeley Cast" text, "Original Broadway Cast" text, "Original 1st US Tour Cast" text, "Original UK Cast" text, "Original Tokyo / Seoul Tour Cast" text, "Original 3rd US Tour Cast" text ) -- Using valid SQLite, answer the following quest...
SELECT COUNT("Original 3rd US Tour Cast") FROM table_3037 WHERE "Original UK Cast" = 'Alyssa DiPalma'
wikisql
CREATE TABLE table_name_88 ( goals_for INTEGER, draw VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest goals for value with fewer than 5 draws and under 70 points?
SELECT MIN(goals_for) FROM table_name_88 WHERE draw < 5 AND points < 70
sql_create_context
CREATE TABLE table_name_19 ( iata VARCHAR, icao VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the IATA code for the airport with an ICAO code of HLLS?
SELECT iata FROM table_name_19 WHERE icao = "hlls"
sql_create_context
CREATE TABLE table_name_34 ( total_seats VARCHAR, party VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of seats of the Christian Democratic Union (CDU) party?
SELECT total_seats FROM table_name_34 WHERE party = "christian democratic union (cdu)"
sql_create_context
CREATE TABLE table_24479 ( "Season" text, "Mens 1st XI" text, "Mens 2nd XI" text, "Mens 3rd XI" text, "Ladies 1st XI" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 10th, south west district 1 is the mens 2nd xi what is the ladies 1st xi?
SELECT "Ladies 1st XI" FROM table_24479 WHERE "Mens 2nd XI" = '10th, South West District 1'
wikisql
CREATE TABLE table_41007 ( "Year" text, "Matches" real, "Wins" real, "Losses" real, "No Result" real, "Success Rate" text, "Away Wins" real, "Away Losses" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of Away Losses with...
SELECT SUM("Away Losses") FROM table_41007 WHERE "No Result" > '0' AND "Losses" > '6' AND "Matches" > '91'
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 diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "SINGLE" AND lab.label = "tacroFK"
mimicsql_data
CREATE TABLE table_73312 ( "Regional County Municipality (RCM)" text, "Population Canada 2011 Census" real, "Land Area" text, "Density (pop. per km2)" text, "Seat of RCM" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the land area of the RC...
SELECT "Land Area" FROM table_73312 WHERE "Density (pop. per km2)" = '21.1'
wikisql
CREATE TABLE table_name_51 ( score VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the score for tom watson?
SELECT score FROM table_name_51 WHERE player = "tom watson"
sql_create_context
CREATE TABLE table_46214 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the Record that has the Visitor of vancouver?
SELECT "Record" FROM table_46214 WHERE "Visitor" = 'vancouver'
wikisql
CREATE TABLE table_11902 ( "Week" text, "Date" text, "Opponent" text, "Result" text, "Kickoff [a ]" text, "Game site" text, "Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the result when the kickoff was...
SELECT "Result" FROM table_11902 WHERE "Kickoff [a ]" = '4:00' AND "Record" = '4-8'
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_DIRE_CD text, MED_DIRE_NM text,...
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '21348966' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 4552.52)
css
CREATE TABLE table_55656 ( "Player" text, "Pos." text, "From" real, "School/Country" text, "Rebs" real, "Asts" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the average rebs before 1972?
SELECT AVG("Rebs") FROM table_55656 WHERE "From" < '1972'
wikisql
CREATE TABLE table_10935205_1 ( title VARCHAR, us_airdate VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For the episode(s) aired in the U.S. on 4 april 2008, what were the names?
SELECT title FROM table_10935205_1 WHERE us_airdate = "4 April 2008"
sql_create_context
CREATE TABLE table_36193 ( "Round" real, "Pick" text, "Name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position does Martin Rucker play?
SELECT "Position" FROM table_36193 WHERE "Name" = 'martin rucker'
wikisql
CREATE TABLE table_name_75 ( built INTEGER, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average building year for Superb?
SELECT AVG(built) FROM table_name_75 WHERE name = "superb"
sql_create_context
CREATE TABLE table_27670 ( "Season" real, "Series" text, "Team Name" text, "Races" real, "Wins" real, "Points" text, "Final Placing" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the fewest amount of races in any season?
SELECT MIN("Races") FROM table_27670
wikisql
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE prescriptions ( row_id number, subject_id number,...
SELECT COUNT(*) > 0 FROM admissions WHERE admissions.subject_id = 63537 AND admissions.admission_location = 'emergency room admit' AND STRFTIME('%y', admissions.admittime) >= '2102'
mimic_iii
CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE ground_service ( city_code text, airport_code text, tr...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, date_day, days, flight WHERE ((CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DALLAS FORT WORTH'...
atis
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, ...
SELECT * FROM jybgb WHERE JZLSH = '21869177682'
css
CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate real ) CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight re...
SELECT Date_of_Birth, Weight FROM people ORDER BY Weight
nvbench
CREATE TABLE table_name_93 ( production_num INTEGER, title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many production numbers have a Title of bosko in dutch?
SELECT SUM(production_num) FROM table_name_93 WHERE title = "bosko in dutch"
sql_create_context
CREATE TABLE table_67787 ( "Year" text, "Tournaments played" real, "Cuts made" real, "Wins" real, "Top 10s" real, "Best finish" text, "Earnings ( $ )" text, "Money list rank" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What 2012 amoun...
SELECT "Earnings ( $ )" FROM table_67787 WHERE "Tournaments played" < '28' AND "Year" = '2012'
wikisql
CREATE TABLE table_name_87 ( position VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position does Ed Stokes hold?
SELECT position FROM table_name_87 WHERE player = "ed stokes"
sql_create_context
CREATE TABLE table_6638 ( "Series Ep." text, "Episode" real, "Segment A" text, "Segment B" text, "Segment C" text, "Segment D" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What segment A is associated with a Segment C of paint chip cards?
SELECT "Segment A" FROM table_6638 WHERE "Segment C" = 'paint chip cards'
wikisql
CREATE TABLE table_12123 ( "Player" text, "Height" real, "Position" text, "Year born (Age)" text, "Current Club" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the height of Patrick Femerling, of the Alba Berlin club?
SELECT COUNT("Height") FROM table_12123 WHERE "Current Club" = 'alba berlin' AND "Player" = 'patrick femerling'
wikisql
CREATE TABLE table_20297668_1 ( ply__uk VARCHAR, _nz VARCHAR, _au_ VARCHAR, wraps_per_inch__wpi_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the ply uk, nz, au for wraps per inch 7 wpi
SELECT ply__uk, _nz, _au_ FROM table_20297668_1 WHERE wraps_per_inch__wpi_ = "7 wpi"
sql_create_context
CREATE TABLE has_allergy ( stuid number, allergy text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE allergy_type ( allergy text, allergytype text ) -- Using valid SQLite...
SELECT allergytype FROM allergy_type GROUP BY allergytype ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_1952057_5 ( afc_championships VARCHAR, playoff_berths VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the playoff berth is 17, what is the AFC championship number?
SELECT afc_championships FROM table_1952057_5 WHERE playoff_berths = 17
sql_create_context
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 person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) FROM person_info JOIN hz_info JOIN zzmzjzjlb 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 WHERE zzmzjzjlb.JZZDBM = 'J44.682' GROUP BY person_info.JGDM UNION SELECT...
css
CREATE TABLE table_73006 ( "No. overall" real, "Title" text, "Director" text, "Writer" text, "Original air date" text, "Production code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did the episode first air that had a production code of ...
SELECT "Original air date" FROM table_73006 WHERE "Production code" = '102'
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 = "Abnormal loss of weight" AND lab.fluid = "Pleural"
mimicsql_data
CREATE TABLE table_204_510 ( id number, "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. -- which team is previous to cska moscow on team 1
SELECT "team 1" FROM table_204_510 WHERE id = (SELECT id FROM table_204_510 WHERE "team 1" = 'cska moscow') - 1
squall
CREATE TABLE table_name_7 ( division VARCHAR, team VARCHAR, apps VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of Division(s), when Team is Chongqing Lifan, and when Apps is greater than 9?
SELECT COUNT(division) FROM table_name_7 WHERE team = "chongqing lifan" AND apps > 9
sql_create_context
CREATE TABLE table_name_54 ( building VARCHAR, year VARCHAR, floors VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What building shows 2013 and has more than 20 floors?
SELECT building FROM table_name_54 WHERE year = 2013 AND floors > 20
sql_create_context
CREATE TABLE table_40983 ( "Date" text, "Opponent" text, "Location" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Date for the game at michie stadium west point, ny?
SELECT "Date" FROM table_40983 WHERE "Location" = 'michie stadium • west point, ny'
wikisql
CREATE TABLE table_name_71 ( stadium VARCHAR, final_score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where was the game played when the final score was 35-62?
SELECT stadium FROM table_name_71 WHERE final_score = "35-62"
sql_create_context
CREATE TABLE table_1756264_2 ( holding_companies INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the largest number of holding companies?
SELECT MAX(holding_companies) FROM table_1756264_2
sql_create_context
CREATE TABLE table_76822 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What player has money larger than 11,950 and is placed in t8 and has the score of 7...
SELECT "Player" FROM table_76822 WHERE "Money ( $ )" > '11,950' AND "Place" = 't8' AND "Score" = '73-68-69-72=282'
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "M" AND procedures.long_title = "Single internal mammary-coronary artery bypass"
mimicsql_data
CREATE TABLE table_24489942_10 ( points VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the points for thomas morgenstern
SELECT points FROM table_24489942_10 WHERE name = "Thomas Morgenstern"
sql_create_context
CREATE TABLE table_43979 ( "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's the total enrollment of p...
SELECT SUM("Enrollment") FROM table_43979 WHERE "Location" = 'buffalo, new york' AND "Affiliation" = 'public' AND "Founded" > '1846'
wikisql
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '韦云霞' AND t_kc22.STA_DATE BETWEEN '2016-02-20' AND '2016-12-15' AND t_kc22.SELF_PAY_PRO < 0.43
css
CREATE TABLE table_23183195_2 ( road_record VARCHAR, overall_record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the road record for the team with an overall record of 22-11?
SELECT road_record FROM table_23183195_2 WHERE overall_record = "22-11"
sql_create_context
CREATE TABLE table_name_75 ( result VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the result of the match in Bangkok?
SELECT result FROM table_name_75 WHERE venue = "bangkok"
sql_create_context
CREATE TABLE camera_lens ( id int, brand text, name text, focal_length_mm real, max_aperture real ) CREATE TABLE mountain ( id int, name text, Height real, Prominence real, Range text, Country text ) CREATE TABLE photos ( id int, camera_lens_id int, mountain_id ...
SELECT color, COUNT(color) FROM photos GROUP BY color ORDER BY COUNT(color) DESC
nvbench
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 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 = '42116254' AND NOT zyjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2019-05-06')
css
CREATE TABLE table_19614212_1 ( _percentage_same_sex_marriages VARCHAR, marriages_between_men VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many % same-sex marriages are marriages between men for 923?
SELECT COUNT(_percentage_same_sex_marriages) FROM table_19614212_1 WHERE marriages_between_men = 923
sql_create_context
CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar ) CREATE TABLE food_service ( meal_code text, meal_number int, ...
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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_n...
atis
CREATE TABLE table_4453 ( "Shipyard" text, "Laid down" text, "Launched" text, "Commissioned" text, "Fleet" text, "Status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which fleet launched on July 30, 1961?
SELECT "Fleet" FROM table_4453 WHERE "Launched" = 'july 30, 1961'
wikisql
CREATE TABLE table_name_25 ( opponent VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the opponent for game 5
SELECT opponent FROM table_name_25 WHERE game = 5
sql_create_context
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
SELECT wdmzjzjlb.CYKSDM, wdmzjzjlb.CYKSMC FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '58630087217' UNION SELECT bdmzjzjlb.CYKSDM, bdmzjzjlb.CYKSMC FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '58630087217'
css
CREATE TABLE Payments ( Payment_ID INTEGER, Settlement_ID INTEGER, Payment_Method_Code VARCHAR(255), Date_Payment_Made DATE, Amount_Payment INTEGER ) CREATE TABLE Claims ( Claim_ID INTEGER, Policy_ID INTEGER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed INTEGER,...
SELECT Date_Claim_Made, COUNT(Date_Claim_Made) FROM Claims WHERE Amount_Settled <= (SELECT AVG(Amount_Settled) FROM Claims)
nvbench
CREATE TABLE table_2941848_10 ( pregame_hosts VARCHAR, pregame_analysts VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the pregame host when the pregame analysts is Dave Campbell and the year is 2001?
SELECT pregame_hosts FROM table_2941848_10 WHERE pregame_analysts = "Dave Campbell" AND year = 2001
sql_create_context
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zo...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, airport_service AS AIRPORT_SERVICE_3, city AS CITY_0, city AS CITY_1, city AS CITY_2, city AS CITY_3, flight, flight_stop AS FLIGHT_STOP_0, flight_stop AS FLIGHT_STOP_1...
atis
CREATE TABLE table_66371 ( "Constituency number" text, "Name" text, "Reserved for ( SC / ST /None)" text, "District" text, "Number of electorates (2009)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the district with more than 1,246,756 el...
SELECT "District" FROM table_66371 WHERE "Number of electorates (2009)" > '1,246,756' AND "Constituency number" = '191'
wikisql
CREATE TABLE course ( course_id text, title text, dept_name text, credits number ) CREATE TABLE advisor ( s_id text, i_id text ) CREATE TABLE prereq ( course_id text, prereq_id text ) CREATE TABLE takes ( id text, course_id text, sec_id text, semester text, year nu...
SELECT T3.name FROM course AS T1 JOIN takes AS T2 ON T1.course_id = T2.course_id JOIN student AS T3 ON T2.id = T3.id WHERE T1.dept_name = 'Statistics'
spider
CREATE TABLE country ( Country_id int, Country_name text, Capital text, Official_native_language text ) CREATE TABLE player ( Player_ID int, Player text, Years_Played text, Total_WL text, Singles_WL text, Doubles_WL text, Team int ) CREATE TABLE match_season ( Season re...
SELECT Draft_Class, Draft_Pick_Number FROM match_season WHERE Position = "Defender" ORDER BY Draft_Class DESC
nvbench
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
SELECT diagnoses.short_title FROM diagnoses WHERE diagnoses.icd9_code = "04104"
mimicsql_data