instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.icd9_code = "7742"
mimicsql_data
CREATE TABLE table_51921 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which home team has a Venue of corio oval?
SELECT "Home team" FROM table_51921 WHERE "Venue" = 'corio oval'
wikisql
CREATE TABLE finrev_fed_key_17 ( state_code number, state text, #_records text ) CREATE TABLE finrev_fed_17 ( state_code number, idcensus number, school_district text, nces_id text, yr_data number, t_fed_rev number, c14 number, c25 number ) CREATE TABLE ndecoreexcel_math_gr...
SELECT T2.state, T3.average_scale_score FROM finrev_fed_key_17 AS T2 JOIN finrev_fed_17 AS T1 ON T1.state_code = T2.state_code JOIN ndecoreexcel_math_grade8 AS T3 ON T2.state = T3.state GROUP BY T2.state ORDER BY SUM(T1.t_fed_rev) DESC LIMIT 1
studentmathscore
CREATE TABLE table_71326 ( "Club" text, "League" text, "Sport" text, "Venue" text, "Established" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Club Established in 2010 has a League of MHL?
SELECT "Club" FROM table_71326 WHERE "League" = 'mhl' AND "Established" = '2010'
wikisql
CREATE TABLE table_77633 ( "YEAR" real, "Seniors" text, "Reserves" text, "Thirds (Under 17's)" text, "Fourths (Under 14's)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Thirds (Under 17's) have a Reserve of barnawartha?
SELECT "Thirds (Under 17's)" FROM table_77633 WHERE "Reserves" = 'barnawartha'
wikisql
CREATE TABLE table_20590020_2 ( starts VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of entries for Leif Olson?
SELECT COUNT(starts) FROM table_20590020_2 WHERE player = "Leif Olson"
sql_create_context
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name
nvbench
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND lab.label = "Monocytes"
mimicsql_data
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 lab ( labid number, pa...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'cabg' AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year'))
eicu
CREATE TABLE table_17058116_5 ( location_attendance VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where was the game that took place in November 21 located and how many attended?
SELECT location_attendance FROM table_17058116_5 WHERE date = "November 21"
sql_create_context
CREATE TABLE table_23197088_4 ( opponents_in_final VARCHAR, championship VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what are every one of the rivals in conclusive where title is z rich
SELECT opponents_in_final FROM table_23197088_4 WHERE championship = "Zürich"
sql_create_context
CREATE TABLE business ( bid int, business_id varchar, name varchar, full_address varchar, city varchar, latitude varchar, longitude varchar, review_count bigint, is_open tinyint, rating float, state varchar ) CREATE TABLE checkin ( cid int, business_id varchar, c...
SELECT COUNT(DISTINCT (business.name)) FROM business, review, user WHERE review.business_id = business.business_id AND review.year = 2010 AND user.name = 'Michelle' AND user.user_id = review.user_id
yelp
CREATE TABLE table_name_83 ( opponent_in_the_final VARCHAR, partner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Opponent from the final with a Partner named jorgelina cravero?
SELECT opponent_in_the_final FROM table_name_83 WHERE partner = "jorgelina cravero"
sql_create_context
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostFeedb...
SELECT TIME_TO_STR(CreationDate, '%W'), COUNT(P.Id) FROM Posts AS P JOIN PostTags AS PT ON P.Id = PT.PostId JOIN Tags AS T ON PT.TagId = T.Id WHERE T.TagName = 'pejorative-language' GROUP BY TIME_TO_STR(CreationDate, '%W') ORDER BY TIME_TO_STR(CreationDate, '%W')
sede
CREATE TABLE table_2068719_1 ( δs_ VARCHAR, _butadiene VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of s /cal mol 1 k 1 for butadiene being 1,2-dimethylene-cyclohexane
SELECT COUNT(δs_) AS ‡__cal_mol_−1_k_−1 FROM table_2068719_1 WHERE _butadiene = "1,2-dimethylene-cyclohexane"
sql_create_context
CREATE TABLE table_name_57 ( aircraft VARCHAR, versions VARCHAR, in_service VARCHAR, origin VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which version B-58 aircraft model originated in the United States has 2 in service?
SELECT aircraft FROM table_name_57 WHERE in_service = "2" AND origin = "united states" AND versions = "b-58"
sql_create_context
CREATE TABLE table_46176 ( "Rank" real, "Team" text, "Played" real, "Loss" real, "Last 5" text, "Streak" text, "PF per game" real, "PA per game" real, "PD per game" real, "Winning %" text ) -- Using valid SQLite, answer the following questions for the tables provided above. --...
SELECT "Last 5" FROM table_46176 WHERE "Rank" = '7'
wikisql
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 COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '9150592' AND IN_HOSP_DATE BETWEEN '2000-06-12' AND '2018-01-22'
css
CREATE TABLE table_14945608_1 ( result VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many games had the attendance of 60225?
SELECT COUNT(result) FROM table_14945608_1 WHERE attendance = 60225
sql_create_context
CREATE TABLE table_66978 ( "Date" text, "Season" text, "Playing for" text, "Opponent" text, "Final score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what season is Victoria the Opponent?
SELECT "Season" FROM table_66978 WHERE "Opponent" = 'victoria'
wikisql
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text,...
SELECT q.Id FROM Posts AS q INNER JOIN Posts AS acc ON acc.Id = q.AcceptedAnswerId LEFT OUTER JOIN Posts AS a ON a.ParentId = q.Id AND a.Id != acc.Id WHERE q.PostTypeId = 1 AND NOT q.AcceptedAnswerId IS NULL AND q.OwnerUserId = '##userid:int?160527##' GROUP BY q.Id HAVING MIN(acc.Score) < MAX(a.Score)
sede
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_nam...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t4.icd9_code FROM (SELECT t3.icd9_code, DENSE_RANK() OVER (ORDER BY t3.c1 DESC) AS c2 FROM (SELECT t2.icd9_code, 100 - SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.chartt...
mimic_iii
CREATE TABLE table_5635 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Series" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What opponent has april 10 as the date?
SELECT "Opponent" FROM table_5635 WHERE "Date" = 'april 10'
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Hypertension NOS" AND prescriptions.route = "IV"
mimicsql_data
CREATE TABLE table_29506171_2 ( money_list_rank VARCHAR, top_10s VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the money list rank for Reid in the year that she had 0 top 10s?
SELECT money_list_rank FROM table_29506171_2 WHERE top_10s = 0
sql_create_context
CREATE TABLE table_55749 ( "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 scored 4.15 (39)?
SELECT "Away team" FROM table_55749 WHERE "Away team score" = '4.15 (39)'
wikisql
CREATE TABLE table_name_25 ( grand_prix VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Grand Prix is located in Jerez?
SELECT grand_prix FROM table_name_25 WHERE location = "jerez"
sql_create_context
CREATE TABLE table_17933600_2 ( outgoing_manage VARCHAR, incoming_manager VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the outgoing manager when the incoming manager was jo o pereira?
SELECT outgoing_manage FROM table_17933600_2 WHERE incoming_manager = "João Pereira"
sql_create_context
CREATE TABLE month ( month_number int, month_name text ) 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...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND date_day.day_number = 20 AND date_day.month_number = 1 AND d...
atis
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.drug_type = "BASE" AND lab.label = "Uric Acid"
mimicsql_data
CREATE TABLE Performers ( Performer_ID INTEGER, Address_ID INTEGER, Customer_Name VARCHAR(255), Customer_Phone VARCHAR(255), Customer_Email_Address VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Addresses ( Address_ID VARCHAR(100), Line_1 VARCHAR(255), Line_2 VARCHAR(255), ...
SELECT City_Town, COUNT(*) FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID GROUP BY T1.City_Town ORDER BY COUNT(*)
nvbench
CREATE TABLE table_name_31 ( team VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What teams played in Capital Bowl IV?
SELECT team FROM table_name_31 WHERE game = "capital bowl iv"
sql_create_context
CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
SELECT SQRGH, SQRXM FROM jybgb WHERE JZLSH = '05077547937' GROUP BY SQRGH HAVING COUNT(*) > 2
css
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
SELECT T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T1.Code
nvbench
CREATE TABLE 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 (SELECT MED_ORG_DEPT_CD FROM t_kc21 WHERE MED_SER_ORG_NO = '0869043' GROUP BY MED_ORG_DEPT_CD HAVING MIN(IN_HOSP_DAYS) > 21) AS T
css
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Sec neuroendo tumor-bone" AND prescriptions.route = "IVPCA"
mimicsql_data
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 outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE ...
mimic_iii
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 PRESCRIPTION_CODE, PRESCRIPTION_ID FROM t_kc22 WHERE MED_EXP_DET_ID = '18978368931'
css
CREATE TABLE table_50288 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT COUNTRY HAS A T7 PLACE, WITH IAN WOOSNAM?
SELECT "Country" FROM table_50288 WHERE "Place" = 't7' AND "Player" = 'ian woosnam'
wikisql
CREATE TABLE table_289 ( "Delegate" text, "Interview" text, "Swimsuit" text, "Evening Gown" text, "Average" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the swimsuits for south africa?
SELECT "Swimsuit" FROM table_289 WHERE "Delegate" = 'South Africa'
wikisql
CREATE TABLE table_name_59 ( run_4 VARCHAR, run_1 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Run 4 has a Run 1 of 1:25.82?
SELECT run_4 FROM table_name_59 WHERE run_1 = "1:25.82"
sql_create_context
CREATE TABLE table_9593 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What event did Soares fight against josh spearman?
SELECT "Event" FROM table_9593 WHERE "Opponent" = 'josh spearman'
wikisql
CREATE TABLE table_7445 ( "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. -- Which Lost has Points smaller than 12, and a Dra...
SELECT COUNT("Lost") FROM table_7445 WHERE "Points" < '12' AND "Drawn" > '1'
wikisql
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TAB...
SELECT DISTINCT course_offering.section_number FROM course, course_offering, semester WHERE course_offering.monday = 'N' AND course.course_id = course_offering.course_id AND course.department = 'SLAVIC' AND course.number = 871 AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester...
advising
CREATE TABLE table_49200 ( "Player" text, "Nationality" text, "Jersey Number(s)" text, "Position" text, "Years" text, "From" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What years did jersey number 55 play?
SELECT "Years" FROM table_49200 WHERE "Jersey Number(s)" = '55'
wikisql
CREATE TABLE table_name_98 ( format VARCHAR, frequency VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Format has a Frequency of 100.5 fm?
SELECT format FROM table_name_98 WHERE frequency = "100.5 fm"
sql_create_context
CREATE TABLE employee ( eid number, name text, salary number ) CREATE TABLE certificate ( eid number, aid number ) CREATE TABLE aircraft ( aid number, name text, distance number ) CREATE TABLE flight ( flno number, origin text, destination text, distance number, de...
SELECT aid, name FROM aircraft ORDER BY distance DESC LIMIT 1
spider
CREATE TABLE course ( title VARCHAR, course_id VARCHAR ) CREATE TABLE prereq ( course_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the title of courses that have two prerequisites?
SELECT T1.title FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY T2.course_id HAVING COUNT(*) = 2
sql_create_context
CREATE TABLE table_203_804 ( id number, "pos" text, "no" number, "driver" text, "constructor" text, "laps" number, "time/retired" text, "grid" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many times is hesketh ford listed as the ...
SELECT COUNT(*) FROM table_203_804 WHERE "constructor" = 'hesketh-ford'
squall
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 HOSP_DOC_CD, HOSP_DOC_NM FROM t_kc22 WHERE MED_CLINIC_ID = '88854845172'
css
CREATE TABLE table_24927 ( "Name" text, "Position" text, "Height" text, "Weight" text, "Date of Birth" text, "Home Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the home team is UMBC and the weight is 78kg, what the the name total numb...
SELECT COUNT("Name") FROM table_24927 WHERE "Weight" = '78kg' AND "Home Team" = 'UMBC'
wikisql
CREATE TABLE table_203_726 ( id number, "year" number, "national champion" text, "score" text, "runner-up" text, "host or site" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who had the greater score in 2012 , stanford or usc ?
SELECT "national champion" FROM table_203_726 WHERE "year" = 2012
squall
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE days ( days_code varchar, da...
SELECT DISTINCT FLIGHT_0.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, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, date_day AS DATE...
atis
CREATE TABLE table_203_444 ( id number, "week" number, "start date" text, "type" text, "tournament" text, "surface" text, "town" text, "country" text, "continent" text, "prize money" text ) -- Using valid SQLite, answer the following questions for the tables provided above. --...
SELECT "continent" FROM table_203_444 WHERE "continent" IN ('europe', 'asia') GROUP BY "continent" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-29520')) AND lab.labname = 'potassium' AND DATETIME(lab.labresulttime) >= DATET...
eicu
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE hz_info ( KH text, KLX number...
SELECT zyjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND ...
css
CREATE TABLE table_name_60 ( nfl_club VARCHAR, pick VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the NFL club with pick # 153?
SELECT nfl_club FROM table_name_60 WHERE pick = 153
sql_create_context
CREATE TABLE table_train_194 ( "id" int, "organ_transplantation" bool, "systolic_blood_pressure_sbp" int, "hemoglobin_a1c_hba1c" float, "substance_dependence" bool, "diastolic_blood_pressure_dbp" int, "alcohol_abuse" bool, "age" float, "NOUSE" float ) -- Using valid SQLite, answer ...
SELECT * FROM table_train_194 WHERE organ_transplantation = 1
criteria2sql
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.admityear < "2162" AND procedures.short_title = "Clo endosc bx bile duct"
mimicsql_data
CREATE TABLE Customers ( customer_id INTEGER, customer_first_name VARCHAR(20), customer_last_name VARCHAR(20), customer_address VARCHAR(255), customer_phone VARCHAR(255), customer_email VARCHAR(255), other_customer_details VARCHAR(255) ) CREATE TABLE Accounts ( account_id INTEGER, c...
SELECT card_type_code, COUNT(*) FROM Financial_Transactions AS T1 JOIN Customers_Cards AS T2 ON T1.card_id = T2.card_id GROUP BY T2.card_type_code ORDER BY card_type_code
nvbench
CREATE TABLE appellations ( No INTEGER, Appelation TEXT, County TEXT, State TEXT, Area TEXT, isAVA TEXT ) CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases IN...
SELECT Area, COUNT(Area) FROM appellations GROUP BY Area
nvbench
CREATE TABLE table_name_61 ( silver VARCHAR, rank VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which country is ranked number 2 and has less than 5 total medals?
SELECT COUNT(silver) FROM table_name_61 WHERE rank = 2 AND total < 5
sql_create_context
CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_...
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'WASHINGTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.c...
atis
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 diagnoses.short_title FROM diagnoses WHERE diagnoses.subject_id = "3343"
mimicsql_data
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABL...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'dextromethorphan-guaifenesin (sugar free)' AND DATETIME(prescript...
mimic_iii
CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE equipment_...
SELECT DISTINCT COUNT(DISTINCT fare_basis_code) FROM fare_basis WHERE economy = 'YES'
atis
CREATE TABLE table_16058 ( "Camp" text, "Estimated deaths" text, "Operational" text, "Occupied territory" text, "Current country of location" text, "Primary means for mass killings" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the occup...
SELECT "Occupied territory" FROM table_16058 WHERE "Operational" = 'May 1940 – January 1945'
wikisql
CREATE TABLE table_203_764 ( id number, "name" text, "date" number, "nation" text, "displacement" text, "speed" text, "number" number, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which name has the largest displacement ?
SELECT "name" FROM table_203_764 ORDER BY "displacement" DESC LIMIT 1
squall
CREATE TABLE table_1566852_8 ( date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who answered the 20 questions on 10-07?
SELECT 20 AS _questions FROM table_1566852_8 WHERE date = "10-07"
sql_create_context
CREATE TABLE table_name_91 ( party VARCHAR, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What party has the South Carolina 2 district?
SELECT party FROM table_name_91 WHERE district = "south carolina 2"
sql_create_context
CREATE TABLE table_24560733_1 ( opponents INTEGER, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the minimum number of opponents' points for the game at Michigan State?
SELECT MIN(opponents) FROM table_24560733_1 WHERE opponent = "at Michigan State"
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 lab ( labid number, pa...
SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-19726')) AND intakeoutput.cellpath LIKE '%intake%...
eicu
CREATE TABLE table_33180 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many weeks ended in a result of L 20-10?
SELECT COUNT("Week") FROM table_33180 WHERE "Result" = 'l 20-10'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE patient ( uniquepid text, ...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.hospitaladmittime)) FROM patient WHERE patient.uniquepid = '032-9230' AND patient.hospitaldischargetime IS NULL
eicu
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 jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzj...
css
CREATE TABLE table_76379 ( "Game" real, "Date" text, "Opponent" 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. -- Wh...
SELECT "Date" FROM table_76379 WHERE "Opponent" = 'indiana'
wikisql
CREATE TABLE table_17968282_1 ( played INTEGER, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the most played when points is 105
SELECT MAX(played) FROM table_17968282_1 WHERE points = 105
sql_create_context
CREATE TABLE table_9623 ( "School Name" text, "Start" text, "School District" text, "Year Open" real, "2012 Enrolment" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE ENROLLMENT FOR cole saint-ther se AFTER 1954?
SELECT MIN("2012 Enrolment") FROM table_9623 WHERE "School Name" = 'école saint-therèse' AND "Year Open" > '1954'
wikisql
CREATE TABLE table_name_31 ( winner VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the winner when the team is mobil 1 racing?
SELECT winner FROM table_name_31 WHERE team = "mobil 1 racing"
sql_create_context
CREATE TABLE table_name_17 ( d__max_ INTEGER, taper VARCHAR, c__max_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What total D (max) has a taper of 1:20.047, and a C (max) bigger than 65.5?
SELECT SUM(d__max_) FROM table_name_17 WHERE taper = "1:20.047" AND c__max_ > 65.5
sql_create_context
CREATE TABLE management ( department_id VARCHAR ) CREATE TABLE department ( department_id VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which department has more than 1 head at a time? List the id, name and the number of heads.
SELECT T1.department_id, T1.name, COUNT(*) FROM management AS T2 JOIN department AS T1 ON T1.department_id = T2.department_id GROUP BY T1.department_id HAVING COUNT(*) > 1
sql_create_context
CREATE TABLE table_name_11 ( opponent VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who did they play when the score was 95-114?
SELECT opponent FROM table_name_11 WHERE score = "95-114"
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND procedures.icd9_code = "3897"
mimicsql_data
CREATE TABLE Mailshot_Customers ( mailshot_id INTEGER, customer_id INTEGER, outcome_code VARCHAR(15), mailshot_customer_date DATETIME ) CREATE TABLE Mailshot_Campaigns ( mailshot_id INTEGER, product_category VARCHAR(15), mailshot_name VARCHAR(80), mailshot_start_date DATETIME, mails...
SELECT outcome_code, COUNT(*) FROM Mailshot_Customers GROUP BY outcome_code ORDER BY outcome_code DESC
nvbench
CREATE TABLE mountain ( id number, name text, height number, prominence number, range text, country text ) CREATE TABLE camera_lens ( id number, brand text, name text, focal_length_mm number, max_aperture number ) CREATE TABLE photos ( id number, camera_lens_id numb...
SELECT MAX(height), AVG(height) FROM mountain
spider
CREATE TABLE table_57551 ( "Player" text, "Position" text, "School" text, "Hometown" text, "MLB Draft" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which position has a Player of chad hutchinson?
SELECT "Position" FROM table_57551 WHERE "Player" = 'chad hutchinson'
wikisql
CREATE TABLE table_30879 ( "Network" text, "Flagship" text, "Programming" text, "Region" text, "Origin" text, "Owner" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which of the networks originate in Xalapa?
SELECT "Network" FROM table_30879 WHERE "Origin" = 'Xalapa'
wikisql
CREATE TABLE table_46980 ( "2004/ 05" text, "2006/ 07" text, "2007/ 08" text, "2009/ 10" text, "2010/ 11" text, "2011/ 12" text, "2012/ 13" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the 2006/07 finish for the tournament that ha...
SELECT "2006/ 07" FROM table_46980 WHERE "2009/ 10" = 'lq' AND "2010/ 11" = 'a'
wikisql
CREATE TABLE table_204_268 ( id number, "album/single" text, "performer" text, "year" number, "variant" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the album released before blood and roses vol 2 ?
SELECT "album/single" FROM table_204_268 WHERE "year" < (SELECT "year" FROM table_204_268 WHERE "album/single" = 'blood and roses vol 2') ORDER BY "year" DESC LIMIT 1
squall
CREATE TABLE table_name_34 ( club VARCHAR, lost VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the Club that has the Lost of 19?
SELECT club FROM table_name_34 WHERE lost = "19"
sql_create_context
CREATE TABLE table_4046 ( "Position" text, "Name" text, "Nationality" text, "Event 1 Giant Farmers Walk" text, "Event 2 Power Stairs" text, "Event 3 Deadlift" text, "Event 4 Africa Stone" text, "Event 5 Metal Block Press" text, "Event 6 Loading Race" text ) -- Using valid SQLite, a...
SELECT "Event 3 Deadlift" FROM table_4046 WHERE "Name" = 'Hennie Jordan'
wikisql
CREATE TABLE table_402 ( "Name" text, "Position" text, "Height" text, "Weight(lbs)" real, "Born" text, "College" text, "Drafted" text, "Pro Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is under drafted when pro team is arizo...
SELECT "Drafted" FROM table_402 WHERE "Pro Team" = 'Arizona Cardinals'
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 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2058" AND prescriptions.drug_type = "ADDITIVE"
mimicsql_data
CREATE TABLE table_name_33 ( silver INTEGER, gold VARCHAR, rank VARCHAR, bronze VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many silver medals were awarded to the Nation with less than 2 gold, more than 6 bronze and a rank higher than 5?
SELECT SUM(silver) FROM table_name_33 WHERE rank > 5 AND bronze > 6 AND gold < 2
sql_create_context
CREATE TABLE table_11959669_7 ( score VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the final score on March 26?
SELECT score FROM table_11959669_7 WHERE date = "March 26"
sql_create_context
CREATE TABLE table_name_42 ( headquarters VARCHAR, primary_industry VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is the headquarter of the conglomerate industry?
SELECT headquarters FROM table_name_42 WHERE primary_industry = "conglomerate"
sql_create_context
CREATE TABLE table_name_6 ( tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the tournament when 1992 is A?
SELECT tournament FROM table_name_6 WHERE 1992 = "a"
sql_create_context
CREATE TABLE table_27967 ( "Series #" real, "Season #" real, "Title" text, "Director" text, "Writer(s)" text, "Original air date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 'the 37-year itch' is the title what is the lowest series numbe...
SELECT MIN("Series #") FROM table_27967 WHERE "Title" = 'The 37-Year Itch'
wikisql
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE fare ( fare_id int, from_...
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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND flight.from_airport = AIRP...
atis
CREATE TABLE membership_register_branch ( name VARCHAR, member_id VARCHAR ) CREATE TABLE member ( name VARCHAR, member_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show member names without any registered branch.
SELECT name FROM member WHERE NOT member_id IN (SELECT member_id FROM membership_register_branch)
sql_create_context