instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_80 ( institution VARCHAR, affiliation VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Public Institution is in Black River Falls?
SELECT institution FROM table_name_80 WHERE affiliation = "public" AND location = "black river falls"
sql_create_context
CREATE TABLE table_12730 ( "Tie no" real, "Home team" text, "Score" text, "Away team" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest Attendance, when Home Team is 'Welling United'?
SELECT MIN("Attendance") FROM table_12730 WHERE "Home team" = 'welling united'
wikisql
CREATE TABLE table_name_41 ( away_team VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which team played Footscray?
SELECT away_team FROM table_name_41 WHERE home_team = "footscray"
sql_create_context
CREATE TABLE table_22987 ( "Name" text, "Completions" real, "Attempts" real, "Completion %" text, "Yards" real, "Touchdowns" real, "Interceptions" real, "QB Rating" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which QB had a rating of ...
SELECT "Name" FROM table_22987 WHERE "QB Rating" = '72.3'
wikisql
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT t_kc21.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '61340309' AND t_kc21.MED_SER_ORG_NO = '8931708' AND t_kc21.OUT_DIAG_DOC_NM LIKE '郑%'
css
CREATE TABLE table_14381 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- August 16 had what record?
SELECT "Record" FROM table_14381 WHERE "Date" = 'august 16'
wikisql
CREATE TABLE table_22161 ( "Title" text, "Developer" text, "Category" text, "Function" text, "Release date" text, "Version" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the release date for metronome?
SELECT "Release date" FROM table_22161 WHERE "Title" = 'Metronome'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2151" AND procedures.icd9_code = "8841"
mimicsql_data
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Intestinal infection due to Clostridium difficile" AND lab."CATEGORY" = "Blood Gas"
mimicsql_data
CREATE TABLE table_22883210_8 ( score VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the final score of the game held on February 24?
SELECT score FROM table_22883210_8 WHERE date = "February 24"
sql_create_context
CREATE TABLE table_15694696_1 ( arabic_capital_name VARCHAR, english_capital_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the arabic capital name where the english capital name is beirut?
SELECT arabic_capital_name FROM table_15694696_1 WHERE english_capital_name = "Beirut"
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.long_title = "Endoscopic sphincterotomy and papillotomy"
mimicsql_data
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 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_ID = '29762576' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2000-02-05' AND '2020-09-20' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE table_name_70 ( position_in_1999 VARCHAR, capacity INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the position of the team that played at the venue with more than 6,500 capacity?
SELECT position_in_1999 FROM table_name_70 WHERE capacity > 6 OFFSET 500
sql_create_context
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT ACC_Road, SUM(Team_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road DESC
nvbench
CREATE TABLE table_71466 ( "Episode title" text, "Villain(s)" text, "Identity(ies)" text, "Reason(s)" text, "Original airdate" text, "DVD volume" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many DVD volumes was identified by Skippy Johnso...
SELECT "DVD volume" FROM table_71466 WHERE "Identity(ies)" = 'skippy johnson'
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT demographic.diagnosis, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Travis Hofman"
mimicsql_data
CREATE TABLE table_41647 ( "Year" text, "Starts" real, "Cuts Made" real, "Wins" real, "Top 10" real, "Top 25" real, "Earnings (\u20ac)" real, "Money list rank" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest number of ...
SELECT MAX("Wins") FROM table_41647 WHERE "Earnings (\u20ac)" > '150,643' AND "Cuts Made" > '1' AND "Starts" > '22' AND "Money list rank" = '32'
wikisql
CREATE TABLE table_61799 ( "Rank" real, "Cyclist" text, "Team" text, "Time" text, "UCI ProTour Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which team is ranked #10?
SELECT "Team" FROM table_61799 WHERE "Rank" = '10'
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 COALESCE(CommentCount, 0), AVG(CAST(Score AS FLOAT)) FROM Posts WHERE PostTypeId = 2 AND Score > 1 AND ViewCount > 0 GROUP BY COALESCE(CommentCount, 0) ORDER BY COALESCE(CommentCount, 0)
sede
CREATE TABLE table_41263 ( "Year" text, "Dates" text, "Champion" text, "Country" text, "Score" text, "Tournament location" text, "Purse ($)" real, "Winner's share ($)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest Pu...
SELECT MAX("Purse ($)") FROM table_41263 WHERE "Dates" = 'aug 3–5'
wikisql
CREATE TABLE media_types ( id number, name text ) CREATE TABLE invoices ( id number, customer_id number, invoice_date time, billing_address text, billing_city text, billing_state text, billing_country text, billing_postal_code text, total number ) CREATE TABLE playlists ( ...
SELECT T1.name FROM tracks AS T1 JOIN invoice_lines AS T2 ON T1.id = T2.track_id JOIN invoices AS T3 ON T3.id = T2.invoice_id JOIN customers AS T4 ON T4.id = T3.customer_id WHERE T4.first_name = "Daan" AND T4.last_name = "Peeters"
spider
CREATE TABLE table_72204 ( "Acquisition" text, "knowledge" text, "penance" text, "permanence of the body" text, "constancy" text, "purity" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the permanence of the body where purity is apprehens...
SELECT "permanence of the body" FROM table_72204 WHERE "purity" = 'apprehension'
wikisql
CREATE TABLE table_1182314_5 ( percent__1990_ VARCHAR, state VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what are all the percent (1990) where state is mississippi
SELECT percent__1990_ FROM table_1182314_5 WHERE state = "Mississippi"
sql_create_context
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, ...
SELECT COUNT(WebsiteUrl), COUNT(Id), COUNT(*) FROM Users
sede
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT mzjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '秦宛白' UNION SELECT wdmzjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN wdmzjzjlb ON person_info.RYBH = ...
css
CREATE TABLE table_36714 ( "Result" text, "Date" text, "Race" text, "Venue" text, "Group" text, "Distance" text, "Weight (kg)" real, "Jockey" text, "Winner/2nd" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What venue has a weight (...
SELECT "Venue" FROM table_36714 WHERE "Weight (kg)" > '55' AND "Result" = 'won'
wikisql
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM 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 = '5666230' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 23
css
CREATE TABLE table_name_45 ( outcome VARCHAR, surface VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the outcome when the surface is grass on 23 june 1997?
SELECT outcome FROM table_name_45 WHERE surface = "grass" AND date = "23 june 1997"
sql_create_context
CREATE TABLE gyb ( 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 COUNT(*) FROM qtb WHERE qtb.MED_SER_ORG_NO = '7030360' AND qtb.HOSP_STS > 0 UNION SELECT COUNT(*) FROM gyb WHERE gyb.MED_SER_ORG_NO = '7030360' AND gyb.HOSP_STS > 0 UNION SELECT COUNT(*) FROM zyb WHERE zyb.MED_SER_ORG_NO = '7030360' AND zyb.HOSP_STS > 0 UNION SELECT COUNT(*) FROM mzb WHERE mzb.MED_SER_ORG_NO = '...
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 * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb 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 AND jybgb.YLJG...
css
CREATE TABLE table_name_80 ( nationality VARCHAR, fate VARCHAR, tonnage__grt_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Nationality has a Fate of sunk (mine), and a Tonnage (GRT) smaller than 2,266?
SELECT nationality FROM table_name_80 WHERE fate = "sunk (mine)" AND tonnage__grt_ < 2 OFFSET 266
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE vitalperiodic ( vitalperio...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'laxatives - doss (colace)' AND DATETIME(treatment.treatmenttime, 'start o...
eicu
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE patient ( uniquep...
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'diagnosis' AND cost.eventid IN (SELECT diagnosis.diagnosisid FROM diagnosis WHERE diagnosis.diagnosisname = 's/p hysterectomy')
eicu
CREATE TABLE table_1008653_9 ( country___endonym__ VARCHAR, official_or_native_language_s___alphabet_script_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In which country (endonym) is Irish English the official or native language(s) (alphabet/script)?
SELECT country___endonym__ FROM table_1008653_9 WHERE official_or_native_language_s___alphabet_script_ = "Irish English"
sql_create_context
CREATE TABLE table_40253 ( "Spoofed Title" text, "Actual Title" text, "Writer" text, "Artist" text, "Issue" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which artist has the Spoofed title Miscue 911?
SELECT "Artist" FROM table_40253 WHERE "Spoofed Title" = 'miscue 911'
wikisql
CREATE TABLE table_78870 ( "Team" text, "City" text, "Venue" text, "Capacity" real, "Head Coach" text, "Team Captain" text, "Past Season" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Venue has a Past Season of 2nd?
SELECT "Venue" FROM table_78870 WHERE "Past Season" = '2nd'
wikisql
CREATE TABLE torrents ( groupname text, totalsnatched number, artist text, groupyear number, releasetype text, groupid number, id number ) CREATE TABLE tags ( index number, id number, tag text ) -- Using valid SQLite, answer the following questions for the tables provided abov...
SELECT groupname, groupyear FROM torrents
whatcdhiphop
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 WHERE t_kc21.PERSON_NM = '卫谷雪' AND t_kc21.IN_HOSP_DATE BETWEEN '2004-08-07' AND '2004-08-08' AND t_kc21.CLINIC_TYPE = '住院'
css
CREATE TABLE table_name_22 ( score VARCHAR, partner VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the final score for the game played on January 10, 2011 with partner Mashona Washington?
SELECT score FROM table_name_22 WHERE partner = "mashona washington" AND date = "january 10, 2011"
sql_create_context
CREATE TABLE table_57230 ( "Years" text, "Engine" text, "Power" text, "Torque" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the years for engin 5.7l hemi v8?
SELECT "Years" FROM table_57230 WHERE "Engine" = '5.7l hemi v8'
wikisql
CREATE TABLE table_33350 ( "Translator Call Letters" text, "B Mountain Channel" text, "Laurel Mountain Channel" text, "PSIP" text, "Station Call Letters" text, "Network Affiliation ID" text, "Original Channel" text, "Signal Quality" text ) -- Using valid SQLite, answer the following qu...
SELECT "Translator Call Letters" FROM table_33350 WHERE "Station Call Letters" = 'kcop-dt'
wikisql
CREATE TABLE table_63953 ( "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. -- What is the total number of losses with less than 6 wins and less than 0 draws?
SELECT COUNT("Losses") FROM table_63953 WHERE "Wins" < '6' AND "Draws" < '0'
wikisql
CREATE TABLE table_name_22 ( venue VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Venue with a Date with 27-02-2003?
SELECT venue FROM table_name_22 WHERE date = "27-02-2003"
sql_create_context
CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescript...
SELECT u.DisplayName FROM (SELECT b.UserId FROM Badges AS b WHERE b.Name = 'java' AND b.Class = 1 AND b.TagBased = 1) AS jb INNER JOIN (SELECT b.UserId FROM Badges AS b WHERE b.Name = 'kotlin' AND b.Class = 1 AND b.TagBased = 1) AS kb ON kb.UserId = jb.UserId INNER JOIN Users AS u ON u.Id = kb.UserId ORDER BY u.Display...
sede
CREATE TABLE table_41151 ( "Year" real, "Men's singles" text, "Women's singles" text, "Men's doubles" text, "Women's doubles" text, "Mixed doubles" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many years were there a men's double of gy rgy...
SELECT SUM("Year") FROM table_41151 WHERE "Men's doubles" = 'györgy vörös gábor petrovits' AND "Men's singles" = 'györgy vörös'
wikisql
CREATE TABLE table_3392 ( "January\u2013December 2012" text, "Birth/2012" real, "Birth/2011" real, "Death/2012" real, "Death/2011" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were the total 2012 births when the 2012 deaths were 163?
SELECT MIN("Birth/2012") FROM table_3392 WHERE "Death/2012" = '163'
wikisql
CREATE TABLE table_204_920 ( id number, "goal" number, "date" text, "location" text, "opponent" text, "lineup" text, "min" number, "assist/pass" text, "score" text, "result" text, "competition" text ) -- Using valid SQLite, answer the following questions for the tables prov...
SELECT COUNT(*) FROM table_204_920 WHERE "min" > 15
squall
CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops int,...
SELECT DISTINCT flight.flight_id FROM airport_service, city, flight WHERE city.city_code = airport_service.city_code AND city.city_name = 'DALLAS' AND flight.airline_code = 'DL' AND flight.to_airport = airport_service.airport_code
atis
CREATE TABLE table_58601 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which team was the home team when Colorado was the visitor and the record became 26 15 9?
SELECT "Home" FROM table_58601 WHERE "Visitor" = 'colorado' AND "Record" = '26–15–9'
wikisql
CREATE TABLE table_name_26 ( result VARCHAR, week VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Result of the game after Week 10 against Philadelphia Eagles?
SELECT result FROM table_name_26 WHERE week > 10 AND opponent = "philadelphia eagles"
sql_create_context
CREATE TABLE bank ( no_of_customers INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the average number of customers cross all banks.
SELECT AVG(no_of_customers) FROM bank
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 COUNT(*) FROM zyjzjlb JOIN hz_info_zyjzjlb JOIN hz_info ON hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.zyjzjlb_id = zyjzjlb.zyjzjlb_id AND hz_info_zyjzjlb.YLJGDM = hz_info.YLJGDM WHERE hz_info.YLJGDM = '51...
css
CREATE TABLE table_36436 ( "Rank" real, "Highway" text, "Elevation" text, "Surface" text, "Route" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Route larger than 24, and a Highway of trail ridge road had what elevation?
SELECT "Elevation" FROM table_36436 WHERE "Route" > '24' AND "Highway" = 'trail ridge road'
wikisql
CREATE TABLE table_20496 ( "No." real, "Date" text, "Tournament" text, "Winning score" text, "To par" text, "Margin of victory" text, "Runner(s)-up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the runner-up in the Memorial Tournam...
SELECT "Runner(s)-up" FROM table_20496 WHERE "Tournament" = 'Memorial Tournament'
wikisql
CREATE TABLE table_name_37 ( silver INTEGER, total VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Silver has a Total of 1, and a Rank of 12?
SELECT MIN(silver) FROM table_name_37 WHERE total = 1 AND rank = "12"
sql_create_context
CREATE TABLE table_67233 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Ken Walter's lowest pick number with an overall pick number larger than 195?
SELECT MIN("Pick #") FROM table_67233 WHERE "Name" = 'ken walter' AND "Overall" > '195'
wikisql
CREATE TABLE table_67911 ( "Exam" text, "2006 First Time" text, "2006 All" text, "2007 First Time" text, "2007 All" text, "2008 First Time" text, "2008 All" text, "2009 First Time" text, "2009 All" text, "2010 First Time" text, "2011 First Time" text, "2012 First Time" te...
SELECT "2009 First Time" FROM table_67911 WHERE "2008 First Time" = '54%' AND "Exam" = 'mg general science 5-9'
wikisql
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 INTEGER, Appelation TEXT, County TEXT, State TEXT, Area...
SELECT Winery, COUNT(Winery) FROM wine WHERE Price > 100 GROUP BY Grape, Winery ORDER BY COUNT(Winery) DESC
nvbench
CREATE TABLE table_28228 ( "Stage" real, "Winner" text, "General classification" text, "Points classification" text, "Mountains classification" text, "Young rider classification" text, "Team classification" text, "Combativity award" text ) -- Using valid SQLite, answer the following qu...
SELECT "Young rider classification" FROM table_28228 WHERE "Winner" = 'Jelle Vanendert'
wikisql
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 Founder, AVG(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder
nvbench
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2164.0" AND procedures.icd9_code = "9465"
mimicsql_data
CREATE TABLE table_52121 ( "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. -- Which Away team score has a Venue of princes par...
SELECT "Away team score" FROM table_52121 WHERE "Venue" = 'princes park'
wikisql
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date...
SELECT OwnerUserId AS "user_link", COUNT(*) AS Count FROM Posts WHERE Posts.CreationDate < '2015-05-02' AND Posts.CreationDate > '2015-05-01' GROUP BY OwnerUserId ORDER BY Count DESC
sede
CREATE TABLE table_name_7 ( week VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the week with w 31-21 result?
SELECT week FROM table_name_7 WHERE result = "w 31-21"
sql_create_context
CREATE TABLE table_48250 ( "Country" text, "Preliminary" real, "Interview" real, "Swimsuit" real, "Evening Gown" real, "Average" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number for the interview in Illinois when the preliminary...
SELECT SUM("Interview") FROM table_48250 WHERE "Country" = 'illinois' AND "Preliminary" < '8.558'
wikisql
CREATE TABLE table_39306 ( "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. -- When w...
SELECT "Date" FROM table_39306 WHERE "Record" = '5-31'
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 zyjzjlb.CYKSDM, zyjzjlb.CYKSMC FROM zyjzjlb WHERE zyjzjlb.JZLSH = '57012186438'
css
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), ...
SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY SUM(SALARY)
nvbench
CREATE TABLE table_68152 ( "Race" text, "Dist (f)" real, "Course" text, "Class" text, "Prize (\u00a3K)" real, "Odds" text, "Runners" real, "Placing" real, "Margin" real, "Time" text, "Jockey" text, "Trainer" text ) -- Using valid SQLite, answer the following questions f...
SELECT "Jockey" FROM table_68152 WHERE "Odds" = '5/1'
wikisql
CREATE TABLE table_63980 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the score when the competition is 1995 southeast asian games?
SELECT "Score" FROM table_63980 WHERE "Competition" = '1995 southeast asian games'
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "F" AND prescriptions.drug = "Phenytoin Sodium"
mimicsql_data
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 jybgb.SHRGH, jybgb.SHRXM FROM jybgb WHERE jybgb.JZLSH = '60954060244' GROUP BY jybgb.SHRGH HAVING COUNT(*) > 1
css
CREATE TABLE table_1342270_17 ( candidates VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who were the candidates when Noble Jones Gregory was incumbent?
SELECT candidates FROM table_1342270_17 WHERE incumbent = "Noble Jones Gregory"
sql_create_context
CREATE TABLE table_51346 ( "1953" text, "party" text, "Manhattan" text, "The Bronx" text, "Brooklyn" text, "Queens" text, "Richmond [Staten Is.]" text, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the candidate that go...
SELECT "1953" FROM table_51346 WHERE "Richmond [Staten Is.]" = '1,019'
wikisql
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE d_icd_procedures ( ...
SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 30 AND 39) GROUP BY prescriptions.drug) AS t1 WHERE t1.c1 <= 5
mimic_iii
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, ...
SELECT admissions.dischtime FROM admissions WHERE admissions.subject_id = 7959 AND STRFTIME('%y', admissions.dischtime) >= '2105' ORDER BY admissions.dischtime LIMIT 1
mimic_iii
CREATE TABLE table_name_1 ( term_of_office VARCHAR, state VARCHAR, member VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Term of office for Leonard Reynolds of NSW?
SELECT term_of_office FROM table_name_1 WHERE state = "nsw" AND member = "leonard reynolds"
sql_create_context
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT t_kc21.MED_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_ID = '61592932' AND t_kc21.IN_HOSP_DATE BETWEEN '2009-05-21' AND '2015-10-12' GROUP BY t_kc21.MED_SER_ORG_NO ORDER BY COUNT(*) DESC LIMIT 1
css
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE treatment ( treatmentid number...
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 = '006-140729')) AND medication.drugname = 'amlodipine besylate 5...
eicu
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 = "Status amput below knee" AND lab.flag = "delta"
mimicsql_data
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, ...
SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 7112)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'sump...
mimic_iii
CREATE TABLE table_10530 ( "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 was the away team at the game played at Lake...
SELECT "Away team" FROM table_10530 WHERE "Venue" = 'lake oval'
wikisql
CREATE TABLE table_name_17 ( sideline_reporter_s_ VARCHAR, color_commentator_s_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which sideline reporters worked alongside Frank Gifford and Dan Dierdorf?
SELECT sideline_reporter_s_ FROM table_name_17 WHERE color_commentator_s_ = "frank gifford and dan dierdorf"
sql_create_context
CREATE TABLE table_39677 ( "Year" text, "Title" text, "Role" text, "Language" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the title in 1996?
SELECT "Title" FROM table_39677 WHERE "Year" = '1996'
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 SUM(t_kc24.MED_AMOUT) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '柏向明' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2017-05-05' AND '2018-01-22' UNION SELECT SUM(t_kc24.MED_AMOUT) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE fgwyjzb.PE...
css
CREATE TABLE table_33680 ( "Network" text, "Origin of Programming" text, "Language" text, "Genre" text, "Service" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What network is in the language of Bengali?
SELECT "Service" FROM table_33680 WHERE "Language" = 'bengali'
wikisql
CREATE TABLE table_53903 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the opponent for may 12
SELECT "Opponent" FROM table_53903 WHERE "Date" = 'may 12'
wikisql
CREATE TABLE table_28846752_5 ( innings VARCHAR, average VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many innings have an average of 19.60?
SELECT innings FROM table_28846752_5 WHERE average = "19.60"
sql_create_context
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NA...
SELECT EMPLOYEE_ID, COMMISSION_PCT FROM employees WHERE HIRE_DATE < '2002-06-21'
nvbench
CREATE TABLE table_name_40 ( attendance INTEGER, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the lowest attendance for a score of 5 - 0?
SELECT MIN(attendance) FROM table_name_40 WHERE score = "5 - 0"
sql_create_context
CREATE TABLE table_name_94 ( hometown VARCHAR, position VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Guard Kerri Shields Hometown?
SELECT hometown FROM table_name_94 WHERE position = "guard" AND name = "kerri shields"
sql_create_context
CREATE TABLE table_32084 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the lowest total for rank of 13 with bronze less than 1
SELECT MIN("Total") FROM table_32084 WHERE "Rank" = '13' AND "Bronze" < '1'
wikisql
CREATE TABLE table_32950 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was Richmond's score as the home team?
SELECT "Home team score" FROM table_32950 WHERE "Home team" = 'richmond'
wikisql
CREATE TABLE table_75773 ( "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 sum of Against when the lost is mor...
SELECT SUM("Against") FROM table_75773 WHERE "Lost" > '7'
wikisql
CREATE TABLE table_28846752_8 ( matches INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest number listed for matches?
SELECT MAX(matches) FROM table_28846752_8
sql_create_context
CREATE TABLE table_test_6 ( "id" int, "scr" int, "anemia" bool, "blood_hemoglobin" int, "bleeding" int, "hemorrhagic_diseases" bool, "stroke" bool, "blood_platelet_counts" int, "trauma" bool, "renal_disease" bool, "hematocrit_hct" float, "hepatic_disease" bool, "polyg...
SELECT * FROM table_test_6 WHERE hepatic_disease = 1 AND renal_disease = 1 OR (estimated_glomerular_filtration_rate_egfr < 30 OR scr > 200)
criteria2sql
CREATE TABLE table_10737 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Record with a Date with 29 march 2008?
SELECT "Record" FROM table_10737 WHERE "Date" = '29 march 2008'
wikisql
CREATE TABLE table_204_564 ( id number, "devanagari" text, "iso 15919" text, "unrsgn" text, "iast" text, "comment" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what unrsgn is listed previous to the o ?
SELECT "unrsgn" FROM table_204_564 WHERE id = (SELECT id FROM table_204_564 WHERE "unrsgn" = 'o') - 1
squall
CREATE TABLE table_34045 ( "Date" text, "Opponents" text, "H / A" text, "Result F \u2013 A" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Attendance when Lincoln City was the Opponents with H/A of A?
SELECT COUNT("Attendance") FROM table_34045 WHERE "Opponents" = 'lincoln city' AND "H / A" = 'a'
wikisql