instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ...
SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'lidocaine 1%') AND STRFTIME('%y', cost.chargetime) <= '2104' GROUP BY cost.hadm_id) AS t1
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 SUM(OVE_PAY) FROM t_kc24 WHERE PERSON_ID = '20485029' AND CLINIC_SLT_DATE BETWEEN '2002-04-23' AND '2015-07-22'
css
CREATE TABLE table_43567 ( "Year" text, "Matches" real, "Wins" real, "Losses" real, "No Result" real, "Win %" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of matches when the wins are less than 8, and losses of 7, in 2011?
SELECT SUM("Matches") FROM table_43567 WHERE "Wins" < '8' AND "Losses" = '7' AND "Year" = '2011'
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 MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '6281887' AND t_kc21.IN_DIAG_DIS_CD = 'J30.696')
css
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDis...
SELECT MAX(t.Count) AS TagCount, 'site://questions/tagged/' + MAX(t.TagName) + '|' + MAX(t.TagName) AS TagLink, COALESCE('site://users/' + CAST(p.OwnerUserId AS TEXT) + '|' + u.DisplayName, p.OwnerDisplayName) AS UserLink, COUNT(p.Id) AS UTQnCount FROM Tags AS t JOIN PostTags AS a ON a.TagId = t.Id JOIN Posts AS q ON q...
sede
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT t_kc21.MAIN_COND_DES FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '88548403439'
css
CREATE TABLE publication ( abstract varchar, cid int, citation_num int, jid int, pid int, reference_num int, title varchar, year int ) CREATE TABLE writes ( aid int, pid int ) CREATE TABLE domain_conference ( cid int, did int ) CREATE TABLE cite ( cited int, ci...
SELECT conference.name FROM author, conference, publication, writes WHERE author.name = 'H. V. Jagadish' AND publication.cid = conference.cid AND writes.aid = author.aid AND writes.pid = publication.pid
academic
CREATE TABLE table_72794 ( "Player" text, "No." real, "Nationality" text, "Position" text, "Years for Grizzlies" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which school/club team did blue edwards play for
SELECT "School/Club Team" FROM table_72794 WHERE "Player" = 'Blue Edwards'
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 jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN 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 = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJ...
css
CREATE TABLE region ( region_id number, region_name text, date text, label text, format text, catalogue text ) CREATE TABLE party ( party_id number, minister text, took_office text, left_office text, region_id number, party_name text ) CREATE TABLE party_events ( ev...
SELECT party_name FROM party WHERE NOT party_id IN (SELECT party_id FROM member)
spider
CREATE TABLE table_15887683_1 ( package_option VARCHAR, television_service VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the package/options when the TV service is rai 3?
SELECT package_option FROM table_15887683_1 WHERE television_service = "Rai 3"
sql_create_context
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 WHERE demographic.discharge_location = "DISCH-TRAN TO PSYCH HOSP" AND demographic.age < "77"
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 zyjybgb.KSBM, zyjybgb.KSMC FROM hz_info JOIN mzjzjlb JOIN zyjybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '16815496' AND zyjybgb.BGRQ BETWEEN '2006-09-29...
css
CREATE TABLE table_80451 ( "Year" text, "Start" text, "Qual" text, "Rank" text, "Finish" text, "Laps" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year has a finish of 19?
SELECT "Year" FROM table_80451 WHERE "Finish" = '19'
wikisql
CREATE TABLE table_name_94 ( crowd INTEGER, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the largest crowd when north melbourne is the home side?
SELECT MAX(crowd) FROM table_name_94 WHERE home_team = "north melbourne"
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "17" AND procedures.long_title = "Open and other sigmoidectomy"
mimicsql_data
CREATE TABLE table_67447 ( "Date" text, "Opponent" text, "Score" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the record of the game on 13 May?
SELECT "Record" FROM table_67447 WHERE "Date" = '13 may'
wikisql
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND procedures.short_title = "Cystoscopy NEC"
mimicsql_data
CREATE TABLE table_11958 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Save" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score when a save of ||25,354||63 43 occurred?
SELECT "Score" FROM table_11958 WHERE "Save" = '||25,354||63–43'
wikisql
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
SELECT * FROM Comments WHERE Text LIKE '%webapps.stackexchange.com%'
sede
CREATE TABLE table_35957 ( "Team" text, "Location" text, "Venue" text, "Capacity" real, "Position in 1993\u201394" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what team scored in gomel
SELECT "Team" FROM table_35957 WHERE "Location" = 'gomel'
wikisql
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE T...
SELECT HIRE_DATE, MANAGER_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY HIRE_DATE
nvbench
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 lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "50970"
mimicsql_data
CREATE TABLE table_64912 ( "Rank" real, "Lane" real, "Name" text, "Nationality" text, "Time" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the lowest rank of the United States with a time less than 24.63?
SELECT MIN("Rank") FROM table_64912 WHERE "Nationality" = 'united states' AND "Time" < '24.63'
wikisql
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 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 = '002-3736')) AND lab.labname = 'hct' AND STRFTIME('%y-%m', lab.labresulttime) <= '21...
eicu
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text...
SELECT zzmzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zzmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE person_info.XM = '云鸿运' AND NOT zzmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2009-07-3...
css
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TA...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND CIT...
atis
CREATE TABLE table_17319 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Series" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What i...
SELECT "Location Attendance" FROM table_17319 WHERE "High rebounds" = 'A. Horford (13)'
wikisql
CREATE TABLE table_68926 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many points does an entrant of Martini Racing, the engine of an Alfa Romeo flat-12 a chassis of brabha...
SELECT COUNT("Points") FROM table_68926 WHERE "Entrant" = 'martini racing' AND "Engine" = 'alfa romeo flat-12' AND "Chassis" = 'brabham bt45' AND "Year" = '1976'
wikisql
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 labevents ( row_id number, subject_id number, hadm_id number, itemid number, chart...
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 83894 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = ...
mimic_iii
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
SELECT DATEADD(MONTH, DATEDIFF(MONTH, 0, creationDate), 0) AS Month, Tags.TagName, COUNT(Posts.Id) AS Questions FROM Posts LEFT JOIN PostTags ON Posts.Id = PostTags.PostId LEFT JOIN Tags ON PostTags.TagId = Tags.Id WHERE Posts.PostTypeId = 1 AND (PostTags.TagId = 4452 OR PostTags.TagId = 16) GROUP BY DATEADD(MONTH, DAT...
sede
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 = '7794776' AND IN_HOSP_DATE BETWEEN '2000-04-14' AND '2016-12-22' AND IN_DIAG_DIS_CD <> OUT_DIAG_DIS_CD
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Injury-hanging" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE table_49035 ( "Name" text, "Team" text, "Qual 1" text, "Qual 2" text, "Best" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Name when Qual 2 is 1:15.582?
SELECT "Name" FROM table_49035 WHERE "Qual 2" = '1:15.582'
wikisql
CREATE TABLE table_68387 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In 2007, what player won player of the year?
SELECT "Player" FROM table_68387 WHERE "Year(s) won" = '2007'
wikisql
CREATE TABLE table_36770 ( "Driver" text, "Team" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average grid for the +2.2 secs time/retired?
SELECT AVG("Grid") FROM table_36770 WHERE "Time/Retired" = '+2.2 secs'
wikisql
CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments ...
SELECT DISTINCT instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 493 AND NOT instructor.name LIKE '%Michael Swan%' AND offering_instructor.instructor_id = instructor.instructor_id AND offer...
advising
CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_...
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 ((flight.to_airport = AIRPORT_SERVICE_0.airport_code AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE') OR (flight.from_airpo...
atis
CREATE TABLE table_name_96 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is 1995 Grand Slam Tournament if 1990 is LQ?
SELECT 1995 FROM table_name_96 WHERE 1990 = "lq"
sql_create_context
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 AVG(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.days_stay = "3"
mimicsql_data
CREATE TABLE table_54251 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Attendance on august 15?
SELECT "Attendance" FROM table_54251 WHERE "Date" = 'august 15'
wikisql
CREATE TABLE table_26590 ( "#" real, "Player" text, "Country" text, "Points" real, "Reset points" real, "Events" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the player for 22 events
SELECT "Player" FROM table_26590 WHERE "Events" = '22'
wikisql
CREATE TABLE table_74821 ( "Rank" real, "Name" text, "Location" text, "Height Metres / feet" text, "Floors" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Rank is the lowest one that has a Name of maribor cathedral?
SELECT MIN("Rank") FROM table_74821 WHERE "Name" = 'maribor cathedral'
wikisql
CREATE TABLE table_65324 ( "Year" real, "Artist" text, "Song" text, "UK Chart" text, "At Eurovision" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Song of the Year was 42 on the UK charts prior to 1994?
SELECT "Song" FROM table_65324 WHERE "Year" < '1994' AND "UK Chart" = '42'
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 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "M" AND procedures.icd9_code = "3521"
mimicsql_data
CREATE TABLE table_5558 ( "Election" text, "Date" text, "Mayor" text, "Ward seats" text, "Votes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the Election of 1953?
SELECT "Date" FROM table_5558 WHERE "Election" = '1953'
wikisql
CREATE TABLE table_name_23 ( place VARCHAR, score VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what place did Des Smyth, who scored less than 71, finish?
SELECT place FROM table_name_23 WHERE score < 71 AND player = "des smyth"
sql_create_context
CREATE TABLE table_16863 ( "Player" text, "No." text, "Nationality" text, "Position" text, "Years for Jazz" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the position for player Blue Edwards?
SELECT "Position" FROM table_16863 WHERE "Player" = 'Blue Edwards'
wikisql
CREATE TABLE table_name_59 ( agricultural_panel VARCHAR, national_university_of_ireland INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of agriculatural panels of the composition with more than 3 National Universities of Ireland?
SELECT COUNT(agricultural_panel) FROM table_name_59 WHERE national_university_of_ireland > 3
sql_create_context
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.religion = "UNOBTAINABLE" AND lab.itemid = "51181"
mimicsql_data
CREATE TABLE table_17057 ( "Player" text, "Position" text, "School" text, "Hometown" text, "MLB Draft" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the school for the player who's hometown was Irvine, CA?
SELECT "School" FROM table_17057 WHERE "Hometown" = 'Irvine, CA'
wikisql
CREATE TABLE table_36975 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text ) -- Using valid SQLite, answer the following questions f...
SELECT "Losing bonus" FROM table_36975 WHERE "Points for" = '571'
wikisql
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 MIN(demographic.age) FROM demographic WHERE demographic.ethnicity = "ASIAN" AND demographic.days_stay = "27"
mimicsql_data
CREATE TABLE table_52689 ( "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. -- How many people were in the crowd when the home ...
SELECT "Crowd" FROM table_52689 WHERE "Home team score" = '13.10 (88)'
wikisql
CREATE TABLE table_61592 ( "Province, Community" text, "Contestant" text, "Height" text, "Hometown" text, "Geographical Regions" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the geographical region for hometown Imbert?
SELECT "Geographical Regions" FROM table_61592 WHERE "Hometown" = 'imbert'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "ASIAN" AND demographic.dob_year < "2152"
mimicsql_data
CREATE TABLE shop ( shop_id number, shop_name text, location text, open_date text, open_year number ) CREATE TABLE stock ( shop_id number, device_id number, quantity number ) CREATE TABLE device ( device_id number, device text, carrier text, package_version text, ap...
SELECT shop_name, location FROM shop ORDER BY shop_name
spider
CREATE TABLE table_37492 ( "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. -- What home has Philadelphia as the visitor, and december 4 as the d...
SELECT "Home" FROM table_37492 WHERE "Visitor" = 'philadelphia' AND "Date" = 'december 4'
wikisql
CREATE TABLE table_train_257 ( "id" int, "serum_bicarbonate" int, "plasma_glucose_concentration" int, "hemoglobin_a1c_hba1c" float, "platelets" int, "visual_impairment" bool, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided above. -- serum bica...
SELECT * FROM table_train_257 WHERE serum_bicarbonate < 15
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 procedures.long_title FROM procedures WHERE procedures.subject_id = "9575"
mimicsql_data
CREATE TABLE table_63991 ( "Class" text, "Wheel arrangement" text, "Fleet number(s)" text, "Manufacturer" text, "Serial numbers" text, "Year made" text, "Quantity made" text, "Quantity preserved" text, "Year(s) retired" text ) -- Using valid SQLite, answer the following questions f...
SELECT "Serial numbers" FROM table_63991 WHERE "Class" = '4-8-4 — oooooooo — northern'
wikisql
CREATE TABLE table_name_62 ( category VARCHAR, label VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What category did MCG get a nominee in?
SELECT category FROM table_name_62 WHERE label = "mcg" AND result = "nominee"
sql_create_context
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) 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 employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), ...
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(MANAGER_ID) DESC
nvbench
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number...
SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT labevents.hadm_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'potassium, urine')) AND STRFTIME('%y', cost.chargetime) <= '2103' GROUP BY cost.hadm_id) AS t1
mimic_iii
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 gwyjzb.IN_HOSP_DAYS FROM gwyjzb WHERE gwyjzb.MED_CLINIC_ID = '63144287347' UNION SELECT fgwyjzb.IN_HOSP_DAYS FROM fgwyjzb WHERE fgwyjzb.MED_CLINIC_ID = '63144287347'
css
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insuranc...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'd & c nec') AND DATET...
mimic_iii
CREATE TABLE table_32887 ( "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 team is travelling to play Hawthorn?
SELECT "Away team" FROM table_32887 WHERE "Home team" = 'hawthorn'
wikisql
CREATE TABLE table_name_21 ( production_number VARCHAR, series VARCHAR, title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the production number for Bell Hoppy in the MM Series?
SELECT COUNT(production_number) FROM table_name_21 WHERE series = "mm" AND title = "bell hoppy"
sql_create_context
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, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND diagnoses.long_title = "Other abnormal blood chemistry"
mimicsql_data
CREATE TABLE table_32136 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the sum of total for rank of 1
SELECT SUM("Total") FROM table_32136 WHERE "Rank" = '1'
wikisql
CREATE TABLE table_name_95 ( worst_score VARCHAR, best_score VARCHAR, worst_dancer_s_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the worst score for the worst dancer(s) john barnes, with a best score of 36?
SELECT worst_score FROM table_name_95 WHERE best_score = 36 AND worst_dancer_s_ = "john barnes"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2150" AND prescriptions.route = "TD"
mimicsql_data
CREATE TABLE table_22410 ( "Episode" text, "Garfield Episode 1" text, "U.S. Acres Episode" text, "Garfield Episode 2" text, "Original Airdate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is episode 2 of garfield when episode 1 is 'the horror...
SELECT "Garfield Episode 2" FROM table_22410 WHERE "Garfield Episode 1" = 'The Horror Hostess (Part 1)'
wikisql
CREATE TABLE table_53133 ( "Driver" text, "Constructor" text, "Laps" text, "Time/Retired" text, "Grid" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For which constructor does Juan Manuel Fangio drive?
SELECT "Constructor" FROM table_53133 WHERE "Driver" = 'juan manuel fangio'
wikisql
CREATE TABLE bridge ( architect_id number, id number, name text, location text, length_meters number, length_feet number ) CREATE TABLE architect ( id text, name text, nationality text, gender text ) CREATE TABLE mill ( architect_id number, id number, location text,...
SELECT t1.name FROM bridge AS t1 JOIN architect AS t2 ON t1.architect_id = t2.id WHERE t2.nationality = 'American' ORDER BY t1.length_feet
spider
CREATE TABLE table_78379 ( "Season" text, "1st Division" text, "Relegated" text, "2nd Division" text, "Promoted" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What season was Norwich Union League promoted?
SELECT "Season" FROM table_78379 WHERE "Promoted" = 'norwich union league'
wikisql
CREATE TABLE table_7780 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the position in 2010 with team notes?
SELECT "Position" FROM table_7780 WHERE "Year" = '2010' AND "Notes" = 'team'
wikisql
CREATE TABLE table_name_4 ( silver INTEGER, rank VARCHAR, gold VARCHAR, total VARCHAR, bronze VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the least silver when the total is more than 2, bronze is 3, gold is more than 0, and rank is 1?
SELECT MIN(silver) FROM table_name_4 WHERE total > 2 AND bronze = 3 AND gold > 0 AND rank = "1"
sql_create_context
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
SELECT Title, Tags, CreationDate, ClosedDate FROM Posts WHERE (Title LIKE '%buntu%' OR Title LIKE '%inux%')
sede
CREATE TABLE table_name_8 ( opponents VARCHAR, venue VARCHAR, competition VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the opponent at the League Play Offs at home?
SELECT opponents FROM table_name_8 WHERE venue = "home" AND competition = "league play offs"
sql_create_context
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 AVG(MED_AMOUT) FROM t_kc21 WHERE MED_ORG_DEPT_NM = '预防保健科' AND IN_HOSP_DATE BETWEEN '2004-07-03' AND '2008-09-09' AND IN_DIAG_DIS_CD = 'G15.489' AND CLINIC_TYPE = '住院'
css
CREATE TABLE table_name_79 ( type VARCHAR, faith VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Faith of , and a Name of greenway has what type?
SELECT type FROM table_name_79 WHERE faith = "–" AND name = "greenway"
sql_create_context
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT zyjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zyjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND pers...
css
CREATE TABLE table_name_16 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2007 of the Grand Slam Tournaments in 2008?
SELECT 2007 FROM table_name_16 WHERE 2008 = "grand slam tournaments"
sql_create_context
CREATE TABLE table_52156 ( "Rank" real, "List" text, "Candidate name" text, "Gender" text, "Religion" text, "Votes" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average rank for antun salman?
SELECT AVG("Rank") FROM table_52156 WHERE "Candidate name" = 'antun salman'
wikisql
CREATE TABLE table_20935 ( "Year (January)" real, "Population (000)" real, "Rural, %" real, "Urban, %" real, "Source" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For how many years was the urban population 57%?
SELECT COUNT("Source") FROM table_20935 WHERE "Urban, %" = '57'
wikisql
CREATE TABLE table_27203 ( "Player" text, "Minutes" real, "Field Goals" real, "Rebounds" real, "Assists" real, "Steals" real, "Blocks" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many field goals had 597 points?
SELECT COUNT("Field Goals") FROM table_27203 WHERE "Points" = '597'
wikisql
CREATE TABLE table_203_711 ( id number, "name" text, "age" number, "hometown" text, "occupation" text, "culinary p.o.v." text, "eliminated" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which contestant is the same age as chris hodgson ?
SELECT "name" FROM table_203_711 WHERE "name" <> 'chris hodgson' AND "age" = (SELECT "age" FROM table_203_711 WHERE "name" = 'chris hodgson')
squall
CREATE TABLE table_8333 ( "Rank" real, "Title" text, "Studio" text, "Director(s)" text, "Gross" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which studio grossed $83,531,958 and ranked lower than 13?
SELECT "Studio" FROM table_8333 WHERE "Rank" > '13' AND "Gross" = '$83,531,958'
wikisql
CREATE TABLE table_2841865_2 ( representative VARCHAR, congress VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What name is listed under representative for the 112th congress?
SELECT representative FROM table_2841865_2 WHERE congress = "112th"
sql_create_context
CREATE TABLE table_203_47 ( id number, "game" number, "date" text, "opponent" text, "location" text, "score" text, "ot" text, "attendance" number, "record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the score for game 8 ...
SELECT "score" FROM table_203_47 WHERE "game" = 8
squall
CREATE TABLE table_44878 ( "Name" text, "Team" text, "Qual 1" text, "Qual 2" text, "Best" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Justin Wilson's Team?
SELECT "Team" FROM table_44878 WHERE "Name" = 'justin wilson'
wikisql
CREATE TABLE table_67799 ( "Date" text, "Home captain" text, "Away captain" text, "Venue" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what venue was the result a draw?
SELECT "Venue" FROM table_67799 WHERE "Result" = 'draw'
wikisql
CREATE TABLE table_3808 ( "Sd" real, "Rk" real, "Player" text, "Points" real, "Points defending" real, "Points won" real, "New points" real, "Status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many new points were earned by rk 26...
SELECT "New points" FROM table_3808 WHERE "Rk" = '26'
wikisql
CREATE TABLE table_name_72 ( draws INTEGER, against VARCHAR, wins VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the sum of draws for against larger than 1228 with fewer than 1 wins?
SELECT SUM(draws) FROM table_name_72 WHERE against > 1228 AND wins < 1
sql_create_context
CREATE TABLE table_12294 ( "Main contestant" text, "Co-contestant (Yaar vs. Pyaar)" text, "Date performed" text, "Scores by each individual judge" text, "Total score/week" text, "Position" text, "Status" text ) -- Using valid SQLite, answer the following questions for the tables provided a...
SELECT "Scores by each individual judge" FROM table_12294 WHERE "Total score/week" = '51/60' AND "Co-contestant (Yaar vs. Pyaar)" = 'tina sachdev'
wikisql
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABL...
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 CITY_1.city_name = 'SAN FR...
atis
CREATE TABLE school ( TYPE VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the types of schools that have two schools.
SELECT TYPE FROM school GROUP BY TYPE HAVING COUNT(*) = 2
sql_create_context
CREATE TABLE table_10028 ( "Date" text, "H/A/N" text, "Opponent" text, "Score" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Opponent, when Record is 17-44?
SELECT "Opponent" FROM table_10028 WHERE "Record" = '17-44'
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 jyjgzbb.JCZBMC FROM jyjgzbb WHERE jyjgzbb.BGDH = '78801857956' INTERSECT SELECT jyjgzbb.JCZBMC FROM jyjgzbb WHERE jyjgzbb.BGDH = '97130676744'
css