instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_39989 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Round" text, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the total time for the match that ocurred in Round 3 with op...
SELECT "Time" FROM table_39989 WHERE "Round" = '3' AND "Opponent" = 'keith wisniewski'
wikisql
CREATE TABLE table_18470 ( "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. -- Which candidates ran in the Alabama 6 district?
SELECT "Candidates" FROM table_18470 WHERE "District" = 'Alabama 6'
wikisql
CREATE TABLE table_name_56 ( type VARCHAR, quantity VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE TYPE WITH 124?
SELECT type FROM table_name_56 WHERE quantity = "124"
sql_create_context
CREATE TABLE flight ( flno number, origin text, destination text, distance number, departure_date time, arrival_date time, price number, aid number ) CREATE TABLE employee ( eid number, name text, salary number ) CREATE TABLE aircraft ( aid number, name text, di...
SELECT AVG(distance), AVG(price) FROM flight WHERE origin = "Los Angeles"
spider
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 MAX(demographic.age) FROM demographic WHERE demographic.diagnosis = "NEWBORN" AND demographic.dod_year < "2138.0"
mimicsql_data
CREATE TABLE table_name_94 ( date VARCHAR, leading_scorer VARCHAR, visitor VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- While the Hornets were visiting, what date was Deron Williams (29) the leading scorer?
SELECT date FROM table_name_94 WHERE leading_scorer = "deron williams (29)" AND visitor = "hornets"
sql_create_context
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 AVG(demographic.age) FROM demographic WHERE demographic.insurance = "Government" AND demographic.admityear >= "2176"
mimicsql_data
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT 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 customers ( customer_id number, customer_details text ) CREATE TABLE claims_processing ( claim_processing_id number, claim_id number, claim_outcome_code text, claim_stage_id number, staff_id number ) CREATE TABLE claim_headers ( claim_header_id number, claim_status_cod...
SELECT DISTINCT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id WHERE t1.policy_type_code = "Deputy" OR t1.policy_type_code = "Uniform"
spider
CREATE TABLE table_name_61 ( results¹ VARCHAR, city VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were the results against the game against Skoplje?
SELECT results¹ FROM table_name_61 WHERE city = "skoplje"
sql_create_context
CREATE TABLE table_204_309 ( id number, "model" text, "released" number, "usage" text, "features" text, "storage" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is . the last feature on the chart
SELECT "features" FROM table_204_309 ORDER BY id DESC LIMIT 1
squall
CREATE TABLE table_19176 ( "Home (1st leg)" text, "Home (2nd leg)" text, "1st Leg" text, "2nd leg" text, "Aggregate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When platense is the home (2nd leg) what is the 2nd leg?
SELECT "2nd leg" FROM table_19176 WHERE "Home (2nd leg)" = 'Platense'
wikisql
CREATE TABLE Apartment_Facilities ( apt_id INTEGER, facility_code CHAR(15) ) CREATE TABLE Apartment_Buildings ( building_id INTEGER, building_short_name CHAR(15), building_full_name VARCHAR(80), building_description VARCHAR(255), building_address VARCHAR(255), building_manager VARCHAR(5...
SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 2 ORDER BY COUNT(booking_start_date)
nvbench
CREATE TABLE table_204_613 ( id number, "title" text, "year" number, "peak chart positions\nus" number, "peak chart positions\nus\nr&b" number, "peak chart positions\nus\nrap" number, "album" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- ho...
SELECT COUNT("title") FROM table_204_613
squall
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 SUM(t_kc22.AMOUNT) 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.PERSON_NM = '韦逸馨' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2008-04-28' AND '2018-10-12' AND t_kc22.MED_INV_IT...
css
CREATE TABLE table_42575 ( "Hangul" text, "Hanja" text, "Revised" text, "McCune-Reischauer" text, "2000 n South Korea population *" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Hanja for McCune-Reischauer of ch n?
SELECT "Hanja" FROM table_42575 WHERE "McCune-Reischauer" = 'chŏn'
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 INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.icd9_code = "3727"
mimicsql_data
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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,...
SELECT jybgb.BGDH FROM jybgb WHERE jybgb.JZLSH = '13021515758' AND NOT jybgb.KSMC LIKE '%手术%'
css
CREATE TABLE table_70342 ( "Year" text, "Total (000s)" real, "Israel" real, "Germany" real, "Jews (Halakha) in Israel" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the amount of 000s from 1996?
SELECT SUM("Total (000s)") FROM table_70342 WHERE "Year" = '1996'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND lab.label = "Red Blood Cells"
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 OUT_DIAG_DOC_CD, OUT_DIAG_DOC_NM FROM t_kc21 WHERE PERSON_ID = '68061275' AND IN_HOSP_DATE BETWEEN '2004-10-02' AND '2005-07-28' GROUP BY OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC LIMIT 1
css
CREATE TABLE PostTypes ( Id number, Name text ) 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, ProfileImage...
SELECT p.Score, p.Id AS "post_link" FROM Posts AS p INNER JOIN ReviewTasks AS rt ON rt.PostId = p.Id WHERE NOT rt.DeletionDate IS NULL ORDER BY p.Score
sede
CREATE TABLE table_12159115_2 ( production_code VARCHAR, us_viewers__millions_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the production code of the episode seen by 11.64 million US viewers?
SELECT production_code FROM table_12159115_2 WHERE us_viewers__millions_ = "11.64"
sql_create_context
CREATE TABLE table_name_89 ( year INTEGER, title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the average year when the title is baka to test to sh kanj ?
SELECT AVG(year) FROM table_name_89 WHERE title = "baka to test to shōkanjū"
sql_create_context
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course ( course_id int, name varchar, dep...
SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Masters Thesis Proj%' OR name LIKE '%Masters Thesis Proj%') AND credits = 5
advising
CREATE TABLE table_23014476_1 ( gore__number INTEGER, others__number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the gore number for others # 6.6%
SELECT MIN(gore__number) FROM table_23014476_1 WHERE others__number = "6.6%"
sql_create_context
CREATE TABLE table_name_16 ( year_named INTEGER, name VARCHAR, diameter__km_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the average year for the name aida-wedo dorsa with a diameter less than 450?
SELECT AVG(year_named) FROM table_name_16 WHERE name = "aida-wedo dorsa" AND diameter__km_ < 450
sql_create_context
CREATE TABLE table_71944 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date of the game against the Royals that had an attendance of 12,699?
SELECT "Date" FROM table_71944 WHERE "Opponent" = 'royals' AND "Attendance" = '12,699'
wikisql
CREATE TABLE table_train_212 ( "id" int, "pregnancy_or_lactation" bool, "postmeal_c_peptide" float, "chemotherapy" bool, "liver_disease" bool, "alcohol_abuse" bool, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided above. -- active chemotherapy
SELECT * FROM table_train_212 WHERE chemotherapy = 1
criteria2sql
CREATE TABLE Customers ( Customer_ID INTEGER, Customer_Details VARCHAR(255) ) CREATE TABLE Payments ( Payment_ID INTEGER, Settlement_ID INTEGER, Payment_Method_Code VARCHAR(255), Date_Payment_Made DATE, Amount_Payment INTEGER ) CREATE TABLE Settlements ( Settlement_ID INTEGER, Clai...
SELECT Date_Claim_Made, COUNT(Date_Claim_Made) FROM Claims WHERE Amount_Claimed > (SELECT AVG(Amount_Claimed) FROM Claims) ORDER BY COUNT(Date_Claim_Made)
nvbench
CREATE TABLE table_name_18 ( chart VARCHAR, debut_position VARCHAR, peak_position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many chart runs had a debut position of more than 7 when peak position was 11?
SELECT COUNT(chart) AS run FROM table_name_18 WHERE debut_position > 7 AND peak_position = 11
sql_create_context
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) 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, C...
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '62939084' AND t_kc21.MED_SER_ORG_NO = '2068001' AND t_kc21.IN_DIAG_DIS_NM LIKE '%沙眼%'
css
CREATE TABLE table_24990183_5 ( ws_points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the 08-09 i/o best of the player with 1386 points?
SELECT 08 AS _09_i_o_best FROM table_24990183_5 WHERE ws_points = 1386
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 txmzjzjlb.JZLSH FROM hz_info JOIN txmzjzjlb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE hz_info.RYBH = '31549527' AND NOT txmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2006-04-16') UNION SELECT ftxmzjzjlb.JZLSH FROM hz_info JOI...
css
CREATE TABLE table_63710 ( "Rank" real, "Lane" real, "Name" text, "Nationality" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lane with a time of 1:56.64, and a tank smaller than 7?
SELECT COUNT("Lane") FROM table_63710 WHERE "Time" = '1:56.64' AND "Rank" < '7'
wikisql
CREATE TABLE table_name_60 ( round VARCHAR, name VARCHAR, overall VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of the round in which Ron Hansen was drafted and the overall is greater than 332?
SELECT COUNT(round) FROM table_name_60 WHERE name = "ron hansen" AND overall > 332
sql_create_context
CREATE TABLE table_34958 ( "Outcome" text, "Year" text, "Venue" text, "Last opponent" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Score of 0 3 (11 21, 14 21) had what outcome?
SELECT "Outcome" FROM table_34958 WHERE "Score" = '0–3 (11–21, 14–21)'
wikisql
CREATE TABLE table_37824 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Attendance on September 11, 1983?
SELECT "Attendance" FROM table_37824 WHERE "Date" = 'september 11, 1983'
wikisql
CREATE TABLE table_204_517 ( id number, "name" text, "date of birth" text, "club" text, "division" text, "appointed" text, "time as manager" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who has served longer , regi van acker or dante brogn...
SELECT "name" FROM table_204_517 WHERE "name" IN ('regi van acker', 'dante brogno') ORDER BY "time as manager" DESC LIMIT 1
squall
CREATE TABLE table_name_76 ( open_1st_viii VARCHAR, crew VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Open 1st VIII for the 2012 crew?
SELECT open_1st_viii FROM table_name_76 WHERE crew = 2012
sql_create_context
CREATE TABLE table_12962773_2 ( position VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Ido Kozikaro's position?
SELECT position FROM table_12962773_2 WHERE player = "Ido Kozikaro"
sql_create_context
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT icustays.hadm_id FROM icustays WHERE icustays.icustay_id IN (SELECT inputevents_cv.icustay_id FROM inputevents_cv WHERE inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'd5w w/20gm cagluc' ...
mimic_iii
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, ...
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 = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = '...
atis
CREATE TABLE table_1341640_39 ( district VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What district is Ray Musto the incumbent of?
SELECT district FROM table_1341640_39 WHERE incumbent = "Ray Musto"
sql_create_context
CREATE TABLE table_name_40 ( total VARCHAR, bronze VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many totals have 2 for the bronze?
SELECT COUNT(total) FROM table_name_40 WHERE bronze = 2
sql_create_context
CREATE TABLE table_name_30 ( surface VARCHAR, outcome VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what Surface was the match with a Score of 6 4, 6 3 and Runner-up Outcome played?
SELECT surface FROM table_name_30 WHERE outcome = "runner-up" AND score = "6–4, 6–3"
sql_create_context
CREATE TABLE table_31124 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the production code for the ...
SELECT "Production code" FROM table_31124 WHERE "Original air date" = 'May15,2000'
wikisql
CREATE TABLE table_name_47 ( season INTEGER, assists VARCHAR, minutes VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the earliest year that Assists were less than 13 and minutes were under 91?
SELECT MIN(season) FROM table_name_47 WHERE assists < 13 AND minutes < 91
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT prescriptions.drug_type, prescriptions.formulary_drug_cd FROM prescriptions WHERE prescriptions.drug = "Lansoprazole Oral Disintegrating Tab"
mimicsql_data
CREATE TABLE table_29182 ( "Rank" real, "Rider" text, "Sat 21 Aug" text, "Mon 23 Aug" text, "Tues 24 Aug" text, "Wed 25 Aug" text, "Thurs 26 Aug" text, "Fri 27 Aug" text, "Sat 28 Aug" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If...
SELECT "Sat 28 Aug" FROM table_29182 WHERE "Wed 25 Aug" = '20'' 09.25 112.324mph'
wikisql
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 jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '28348727' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM jyjgzbb WH...
css
CREATE TABLE table_22962 ( "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. -- When 4th, great lakes is the regular season what is the league?
SELECT "League" FROM table_22962 WHERE "Regular Season" = '4th, Great Lakes'
wikisql
CREATE TABLE table_34055 ( "Date" text, "Label" text, "Region" text, "Format" text, "Catalog" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Format o Catalog F4 87199?
SELECT "Format" FROM table_34055 WHERE "Catalog" = 'f4 87199'
wikisql
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 d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE transfers ( r...
SELECT inputevents_cv.charttime 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 = 13806)) AND STRFTIME('%y-%m-%d', inputevents_cv.charttime) = '2102-01-21' ORDER BY inputeven...
mimic_iii
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 AVG(demographic.age) FROM demographic WHERE demographic.insurance = "Medicare" AND demographic.dod_year < "2111.0"
mimicsql_data
CREATE TABLE table_203_121 ( id number, "name" text, "pos." text, "caps" number, "goals" number, "club" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- played on the same team as rune killing emanuelsson
SELECT "name" FROM table_203_121 WHERE "name" <> 'rune "killing" emanuelsson' AND "club" = (SELECT "club" FROM table_203_121 WHERE "name" = 'rune "killing" emanuelsson')
squall
CREATE TABLE table_name_69 ( score VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Score of a Record 24 23 3?
SELECT score FROM table_name_69 WHERE record = "24–23–3"
sql_create_context
CREATE TABLE table_56281 ( "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 is the smallest crowd size for away team Fi...
SELECT MIN("Crowd") FROM table_56281 WHERE "Away team" = 'fitzroy'
wikisql
CREATE TABLE table_name_3 ( score VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Score of the game with a Record of 31 37 9?
SELECT score FROM table_name_3 WHERE record = "31–37–9"
sql_create_context
CREATE TABLE table_name_87 ( method VARCHAR, round VARCHAR, event VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the method in round 1 of the UFC 20 event?
SELECT method FROM table_name_87 WHERE round = 1 AND event = "ufc 20"
sql_create_context
CREATE TABLE table_23670057_6 ( height__f_ VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the height of demond greene
SELECT height__f_ FROM table_23670057_6 WHERE player = "Demond Greene"
sql_create_context
CREATE TABLE diagnoses ( 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 ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Personal history of surgery to other organs"
mimicsql_data
CREATE TABLE table_33914 ( "Year" real, "Championship" text, "Winning score" text, "Margin" text, "Runner(s)-up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Winning Score when Betsy Rawls was the Runner(s)-up?
SELECT "Winning score" FROM table_33914 WHERE "Runner(s)-up" = 'betsy rawls'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND diagnoses.short_title = "Hepatitis NOS"
mimicsql_data
CREATE TABLE table_38157 ( "City" text, "Country" text, "IATA" text, "ICAO" text, "Airport" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What shows for IATA for the City of sapporo?
SELECT "IATA" FROM table_38157 WHERE "City" = 'sapporo'
wikisql
CREATE TABLE catalog_contents ( catalog_entry_id number, catalog_level_number number, parent_entry_id number, previous_entry_id number, next_entry_id number, catalog_entry_name text, product_stock_number text, price_in_dollars number, price_in_euros number, price_in_pounds number...
SELECT catalog_entry_name FROM catalog_contents ORDER BY capacity LIMIT 1
spider
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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,...
SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON 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 mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH ...
css
CREATE TABLE table_204_913 ( id number, "#" number, "date" text, "venue" text, "opponent" text, "score" text, "result" text, "competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- in how many games did sri lanka score at least 2 go...
SELECT COUNT(*) FROM table_204_913 WHERE "score" >= 2
squall
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 mzjzjlb.JLSJ FROM mzjzjlb WHERE mzjzjlb.JZLSH = '15752379757'
css
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.short_title = "Infectious mononucleosis"
mimicsql_data
CREATE TABLE Financial_Transactions ( transaction_id INTEGER, account_id INTEGER, invoice_number INTEGER, transaction_type VARCHAR(15), transaction_date DATETIME, transaction_amount DECIMAL(19,4), transaction_comment VARCHAR(255), other_transaction_details VARCHAR(255) ) CREATE TABLE Or...
SELECT account_name, T1.account_id FROM Financial_Transactions AS T1 JOIN Accounts AS T2 ON T1.account_id = T2.account_id
nvbench
CREATE TABLE table_16849531_2 ( ncbi_accession_number__mrna_protein_ VARCHAR, length__bp_aa_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the NCBI Accession Number for the length of 5304bp/377aa?
SELECT ncbi_accession_number__mrna_protein_ FROM table_16849531_2 WHERE length__bp_aa_ = "5304bp/377aa"
sql_create_context
CREATE TABLE captain ( rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many captains are in each rank?
SELECT COUNT(*), rank FROM captain GROUP BY rank
sql_create_context
CREATE TABLE table_name_73 ( opponent VARCHAR, site_stadium VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent at Lindsey Nelson Stadium?
SELECT opponent FROM table_name_73 WHERE site_stadium = "lindsey nelson stadium"
sql_create_context
CREATE TABLE Organisations ( organisation_id INTEGER, organisation_type VARCHAR(10), organisation_details VARCHAR(255) ) CREATE TABLE Staff_Roles ( role_code VARCHAR(10), role_description VARCHAR(255) ) CREATE TABLE Documents ( document_id INTEGER, document_type_code VARCHAR(10), grant...
SELECT date_from, COUNT(date_from) FROM Project_Staff
nvbench
CREATE TABLE table_204_605 ( id number, "date" text, "round" text, "opponents" text, "h / a" text, "result\nf-a" text, "scorers" text, "attendance" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the most amount of people to att...
SELECT MAX("attendance") FROM table_204_605
squall
CREATE TABLE table_203_762 ( id number, "#" number, "date" text, "film" text, "gross" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the previous film to air before collateral damage ?
SELECT "film" FROM table_203_762 WHERE "date" < (SELECT "date" FROM table_203_762 WHERE "film" = 'collateral damage') ORDER BY "date" DESC LIMIT 1
squall
CREATE TABLE table_name_18 ( release_date VARCHAR, publisher VARCHAR, title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When Did Microsoft Game Studios release Amped: Freestyle Snowboarding?
SELECT release_date FROM table_name_18 WHERE publisher = "microsoft game studios" AND title = "amped: freestyle snowboarding"
sql_create_context
CREATE TABLE table_29839 ( "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. -- Name t...
SELECT "Record" FROM table_29839 WHERE "Score" = 'W 101–93 (OT)'
wikisql
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), ...
SELECT JOB_ID, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE train ( id int, train_number int, name text, origin text, destination text, time text, interval text ) CREATE TABLE route ( train_id int, station_id int ) CREATE TABLE weekly_weather ( station_id int, day_of_week text, high_temperature int, low_temperat...
SELECT services, COUNT(services) FROM station GROUP BY services
nvbench
CREATE TABLE table_18138132_2 ( function VARCHAR, version VARCHAR, title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the function of 1.4 version of Windows live messenger?
SELECT function FROM table_18138132_2 WHERE version = "1.4" AND title = "Windows Live Messenger"
sql_create_context
CREATE TABLE table_51857 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the home team scored 12.21 (93), what was t...
SELECT AVG("Crowd") FROM table_51857 WHERE "Home team score" = '12.21 (93)'
wikisql
CREATE TABLE table_name_97 ( visitor VARCHAR, leading_scorer VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the visitor team of the game with Andrew Bogut (21) as the leading scorer?
SELECT visitor FROM table_name_97 WHERE leading_scorer = "andrew bogut (21)"
sql_create_context
CREATE TABLE table_11622562_1 ( location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the minimal amount ($) of the 1st prize in the tournaments in New Mexico?
SELECT MIN(1 AS st_prize__) AS $__ FROM table_11622562_1 WHERE location = "New Mexico"
sql_create_context
CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text, ZYLBDM text, ZYMC text ) CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGD...
SELECT mzjzjlb.JZLSH 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 = '张曼蔓' AND hz_info.YLJGDM = '5644576' AND NOT mzjzjlb.JZKSMC LIKE '%口腔%'
css
CREATE TABLE table_58205 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which competition with a result of 3-1?
SELECT "Competition" FROM table_58205 WHERE "Result" = '3-1'
wikisql
CREATE TABLE table_name_71 ( wrestlers VARCHAR, event VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What wrestlers have summer brawl 2006 as the event?
SELECT wrestlers FROM table_name_71 WHERE event = "summer brawl 2006"
sql_create_context
CREATE TABLE table_52737 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the record when the visitor is st. louis
SELECT "Record" FROM table_52737 WHERE "Visitor" = 'st. louis'
wikisql
CREATE TABLE table_23274514_7 ( high_rebounds VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the high rebounds for 17-33
SELECT high_rebounds FROM table_23274514_7 WHERE record = "17-33"
sql_create_context
CREATE TABLE church ( Church_ID int, Name text, Organized_by text, Open_Date int, Continuation_of text ) CREATE TABLE people ( People_ID int, Name text, Country text, Is_Male text, Age int ) CREATE TABLE wedding ( Church_ID int, Male_ID int, Female_ID int, Year ...
SELECT Open_Date, COUNT(Open_Date) FROM church ORDER BY COUNT(Open_Date)
nvbench
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 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.icd9_code = "3079" AND lab.fluid = "Cerebrospinal Fluid (CSF)"
mimicsql_data
CREATE TABLE member_of_club ( stuid number, clubid number, position text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE club ( clubid number, clubname text, clubdes...
SELECT AVG(t3.age) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Hopkins Student Enterprises"
spider
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.HOSP_DOC_CD, t_kc22.HOSP_DOC_NM FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '73144270096'
css
CREATE TABLE table_2610582_7 ( branding VARCHAR, callsign VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What bran is the callsign dytc-fm?
SELECT branding FROM table_2610582_7 WHERE callsign = "DYTC-FM"
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 jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH =...
css
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConce...
SELECT DISTINCT Posts.Title, Posts.Body, Posts.Id, Posts.Score, Posts.OwnerDisplayName, Posts.Tags, TagName FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId INNER JOIN Votes ON Votes.PostId = Posts.Id AND VoteTypeId = 2 WHERE TagName = 'backbone.js' AND Scor...
sede
CREATE TABLE table_40755 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Gold has a Rank of 15, and a Total smaller than 2?
SELECT AVG("Gold") FROM table_40755 WHERE "Rank" = '15' AND "Total" < '2'
wikisql
CREATE TABLE table_name_17 ( driver VARCHAR, laps VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which driver has 62 laps?
SELECT driver FROM table_name_17 WHERE laps = 62
sql_create_context
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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "HYPERGLYCEMIA;HYPONATREMIA" AND demographic.age < "62"
mimicsql_data