instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
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 COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-119203')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput.c...
eicu
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Na...
SELECT DATEADD(month, DATEDIFF(month, 0, CreationDate), 0) AS m, TagName, COUNT(*) FROM PostTags AS pt JOIN Posts AS q ON q.Id = pt.PostId JOIN Tags AS t ON t.Id = pt.TagId WHERE TagName IN ('kotlin', 'swift', 'c#', 'dart') AND q.CreationDate < DATEADD(month, DATEDIFF(month, 0, GETDATE()), 0) GROUP BY DATEADD(month, DA...
sede
CREATE TABLE table_36460 ( "Name" text, "GP-GS" real, "Gain" real, "Loss" real, "Long" real, "Avg/G" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the amount of Avg/G with a Name of blaine gabbert and a Long greater than 30?
SELECT SUM("Avg/G") FROM table_36460 WHERE "Name" = 'blaine gabbert' AND "Long" > '30'
wikisql
CREATE TABLE table_name_11 ( attendance VARCHAR, decision VARCHAR, home VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people attended the game when Calgary was the home team and the decision was McLean?
SELECT COUNT(attendance) FROM table_name_11 WHERE decision = "mclean" AND home = "calgary"
sql_create_context
CREATE TABLE table_74242 ( "No. in series" text, "No. in season" text, "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. -- the episode directed by ar...
SELECT "No. in series" FROM table_74242 WHERE "Directed by" = 'Art Dielhenn'
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 countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0),...
SELECT LAST_NAME, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY MANAGER_ID
nvbench
CREATE TABLE table_52901 ( "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 moorabbin oval's away team?
SELECT "Away team" FROM table_52901 WHERE "Venue" = 'moorabbin oval'
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 qtb.OUT_DIAG_DIS_CD, qtb.OUT_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_ID = '48319787' AND qtb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 3818.79) UNION SELECT gyb.OUT_DIAG_DIS_CD, gyb.OUT_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_ID = '48319787' AND gyb.MED_CLINIC_ID IN (SELECT t...
css
CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, basePrice INTEGER, decor TEXT ) CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adul...
SELECT roomName, COUNT(roomName) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE FirstName LIKE '%ROY%' GROUP BY roomName ORDER BY COUNT(roomName)
nvbench
CREATE TABLE table_62289 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What home team has blackpool as the away team?
SELECT "Home team" FROM table_62289 WHERE "Away team" = 'blackpool'
wikisql
CREATE TABLE table_17550 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the title of the ep...
SELECT "Title" FROM table_17550 WHERE "Production code" = '136'
wikisql
CREATE TABLE table_24431264_16 ( player VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What player had 1420 points coming in?
SELECT player FROM table_24431264_16 WHERE points = 1420
sql_create_context
CREATE TABLE table_18448 ( "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 district is James A. Haley from?
SELECT "District" FROM table_18448 WHERE "Incumbent" = 'James A. Haley'
wikisql
CREATE TABLE table_name_58 ( subject INTEGER, plural VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest Subject, when Plural is t der (their)?
SELECT MIN(subject) FROM table_name_58 WHERE plural = "tãder (their)"
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 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.formulary_drug_cd = "PHYT10IVPB" AND lab.fluid = "Urine"
mimicsql_data
CREATE TABLE table_name_74 ( goals_scored VARCHAR, points INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of Goals scored that has more than 45 Points?
SELECT COUNT(goals_scored) FROM table_name_74 WHERE points > 45
sql_create_context
CREATE TABLE table_11540 ( "State" text, "Interview" real, "Swimsuit" real, "Evening Gown" real, "Average" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest average that has a swimsuit less than 8.966, for west virginia and an evenin...
SELECT MIN("Average") FROM table_11540 WHERE "Swimsuit" < '8.966' AND "State" = 'west virginia' AND "Evening Gown" < '8.711'
wikisql
CREATE TABLE table_77487 ( "Institution" text, "Location" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Nickname" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which institution is private/catholic?
SELECT "Institution" FROM table_77487 WHERE "Affiliation" = 'private/catholic'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE" AND demographic.days_stay > "3"
mimicsql_data
CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'BIOMEDE' AND course.number = 599 AND semester.semester = 'Winter' AND semester.semester_id = course_offering.semester
advising
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 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 table_66909 ( "Name" text, "Nation" text, "Career" text, "Goals" real, "Appearances" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many appearances did Gary Depalma make when he scored less than 30 goals?
SELECT "Appearances" FROM table_66909 WHERE "Goals" < '30' AND "Name" = 'gary depalma'
wikisql
CREATE TABLE table_67617 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of years that an entrant had more than 0 points?
SELECT COUNT("Year") FROM table_67617 WHERE "Points" > '0'
wikisql
CREATE TABLE table_10864 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which venue was used 11 february 1996?
SELECT "Venue" FROM table_10864 WHERE "Date" = '11 february 1996'
wikisql
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.PERSON_ID = '94683238' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2007-03-29' AND '2013-01-06'
css
CREATE TABLE table_47502 ( "Rank" real, "Player" text, "Club(s)" text, "Year(s)" text, "U-17 Goals" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest Rank, when U-17 Goals is '9'?
SELECT MAX("Rank") FROM table_47502 WHERE "U-17 Goals" = '9'
wikisql
CREATE TABLE table_name_3 ( silver INTEGER, rank VARCHAR, bronze VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Silver has a Rank of 6, and a Bronze smaller than 3?
SELECT MIN(silver) FROM table_name_3 WHERE rank = 6 AND bronze < 3
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 WHERE demographic.age < "76" AND demographic.admityear < "2111"
mimicsql_data
CREATE TABLE table_70732 ( "Year" text, "Qual" text, "Rank" text, "Finish" text, "Laps" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was Dick Rathmann's Finish the year he Qualed at 130.928?
SELECT "Finish" FROM table_70732 WHERE "Qual" = '130.928'
wikisql
CREATE TABLE table_name_83 ( silver INTEGER, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many silvers are there with a total of 11?
SELECT SUM(silver) FROM table_name_83 WHERE total = 11
sql_create_context
CREATE TABLE table_77868 ( "System" text, "Band" real, "Uplink (MHz)" text, "Downlink (MHz)" text, "Channel number" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What band is the highest and has a System of gsm-450?
SELECT MAX("Band") FROM table_77868 WHERE "System" = 'gsm-450'
wikisql
CREATE TABLE table_name_72 ( round VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Round has a Player of anthony christnovich?
SELECT round FROM table_name_72 WHERE player = "anthony christnovich"
sql_create_context
CREATE TABLE table_39877 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Records from Kontor Records from the catalog of Kontor446 was released in what format?
SELECT "Format" FROM table_39877 WHERE "Label" = 'kontor records' AND "Catalog" = 'kontor446'
wikisql
CREATE TABLE table_62168 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest rank of Hungary where there was a total of 8 medals, including 2 silver?
SELECT MIN("Rank") FROM table_62168 WHERE "Total" = '8' AND "Nation" = 'hungary' AND "Silver" > '2'
wikisql
CREATE TABLE table_54109 ( "Round" real, "Player" text, "Nationality" text, "NHL team" text, "College/junior/club team (league)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the nationality of the player who played for the Peterborough Pet...
SELECT "Nationality" FROM table_54109 WHERE "College/junior/club team (league)" = 'peterborough petes (ohl)'
wikisql
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 jyjgzbb ( BGDH text, BGRQ tim...
SELECT zyjzjlb.ZYZDBM, zyjzjlb.ZYZDMC FROM hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON 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 hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLS...
css
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE presc...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime 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 = 'venous cath...
mimic_iii
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate ...
SELECT p.Id AS "post_link" FROM Posts AS p INNER JOIN Users AS u ON u.Id = p.OwnerUserId WHERE p.Body LIKE '%<img%' AND u.Reputation < 10 AND p.PostTypeId = 1 ORDER BY p.CreationDate DESC
sede
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.JCFF FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb 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 = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJG...
css
CREATE TABLE subjects ( subject_id number, subject_name text ) CREATE TABLE course_authors_and_tutors ( author_id number, author_tutor_atb text, login_name text, password text, personal_name text, middle_name text, family_name text, gender_mf text, address_line_1 text ) CRE...
SELECT T1.course_name FROM courses AS T1 JOIN student_course_enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name HAVING COUNT(*) = 1
spider
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 employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL v...
SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY HIRE_DATE
nvbench
CREATE TABLE school_bus ( School_ID int, Driver_ID int, Years_Working int, If_full_time bool ) CREATE TABLE school ( School_ID int, Grade text, School text, Location text, Type text ) CREATE TABLE driver ( Driver_ID int, Name text, Party text, Home_city text, Ag...
SELECT Name, Age FROM driver ORDER BY Name
nvbench
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE procedures.icd9_code = "8674" AND prescriptions.route = "NU"
mimicsql_data
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 AVG(demographic.age) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.diagnosis = "VENTRICULAR TACHYCARDIA"
mimicsql_data
CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE restriction ( restriction_c...
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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'OAKLAND' AND flight.arrival_time > 1000 AND flight.to_airport = AIRPORT_SERVICE_1.airport...
atis
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.MED_SER_ORG_NO = '0148623' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2007-03-23' AND '2016-01-01'
css
CREATE TABLE table_name_43 ( per_capita_income VARCHAR, median_household_income VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much is per capita income when median household income is $42,845?
SELECT per_capita_income FROM table_name_43 WHERE median_household_income = "$42,845"
sql_create_context
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 WHERE demographic.diagnosis = "CONGESTIVE HEART FAILURE" AND demographic.days_stay > "13"
mimicsql_data
CREATE TABLE table_36057 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which home team is ranked no. 7 by tie no.?
SELECT "Home team" FROM table_36057 WHERE "Tie no" = '7'
wikisql
CREATE TABLE table_204_879 ( id number, "year" number, "host / location" text, "division i overall" text, "division i undergraduate" text, "division ii overall" text, "division ii community college" text ) -- Using valid SQLite, answer the following questions for the tables provided above....
SELECT "division i undergraduate" FROM table_204_879 WHERE "year" = 2002
squall
CREATE TABLE zyb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '47170641' AND t_kc22.STA_DATE BETWEEN '2003-05-14' AND '2009-01-31' AND t_kc22.SELF_PAY_AMO > 6302.95 UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.PERSON_ID = '4717...
css
CREATE TABLE table_24559 ( "No." real, "#" real, "Title" text, "Directed by" text, "Written by" text, "U.S. air date" text, "Production code" text, "U.S. viewers (million)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many millions...
SELECT "U.S. viewers (million)" FROM table_24559 WHERE "Title" = 'Rabid'
wikisql
CREATE TABLE table_name_76 ( score VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Score on November 10, 2007?
SELECT score FROM table_name_76 WHERE date = "november 10, 2007"
sql_create_context
CREATE TABLE table_26867 ( "Week" real, "Date" text, "Kickoff" text, "Opponent" text, "Final score" text, "Team record" text, "Game site" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the game record during w...
SELECT "Team record" FROM table_26867 WHERE "Week" = '7'
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "7" AND lab.label = "Chloride, Whole Blood"
mimicsql_data
CREATE TABLE table_31952 ( "Season" text, "Level" text, "Division" text, "Section" text, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the section for position of 8th and season of 2003
SELECT "Section" FROM table_31952 WHERE "Position" = '8th' AND "Season" = '2003'
wikisql
CREATE TABLE table_name_57 ( surface VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which surface has a Date of 22 august 2006?
SELECT surface FROM table_name_57 WHERE date = "22 august 2006"
sql_create_context
CREATE TABLE table_name_28 ( allegiance VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who did Winfield Scott have an allegiance with?
SELECT allegiance FROM table_name_28 WHERE name = "winfield scott"
sql_create_context
CREATE TABLE table_33715 ( "Round" real, "Pick" real, "Player" text, "Position" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which school/club has a pick smaller than 196, a round higher than 5 and has Blake Miller?
SELECT "School/Club Team" FROM table_33715 WHERE "Pick" < '196' AND "Round" > '5' AND "Player" = 'blake miller'
wikisql
CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar ) CREATE TABLE class_of_service ( booking_class varchar, rank i...
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 cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE outputevents ( row_id number, subject_id number, ...
SELECT admissions.dischtime FROM admissions WHERE admissions.subject_id = 28279 AND DATETIME(admissions.dischtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY admissions.dischtime LIMIT 1
mimic_iii
CREATE TABLE table_47449 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Country has a Total of 148?
SELECT "Country" FROM table_47449 WHERE "Total" = '148'
wikisql
CREATE TABLE table_2259502_2 ( partner VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who were the partners in games where the score was 7-5, 2-6, [6-10]?
SELECT partner FROM table_2259502_2 WHERE score = "7-5, 2-6, [6-10]"
sql_create_context
CREATE TABLE table_56157 ( "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Diff" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of all points when number played is less than 18?
SELECT SUM("Points") FROM table_56157 WHERE "Played" < '18'
wikisql
CREATE TABLE table_60626 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" real, "Money ( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE LOWEST MONEY WITH 74-74-76-74=298 SCORE?
SELECT MIN("Money ( $ )") FROM table_60626 WHERE "Score" = '74-74-76-74=298'
wikisql
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT All_Neutral, Team_ID FROM basketball_match ORDER BY Team_ID
nvbench
CREATE TABLE table_60580 ( "Year (Ceremony)" text, "Original title" text, "Film title used in nomination" text, "Director" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year has a nomination title of 'sangrador'?
SELECT "Year (Ceremony)" FROM table_60580 WHERE "Film title used in nomination" = 'sangrador'
wikisql
CREATE TABLE table_64463 ( "Rank" real, "Lane" real, "Name" text, "Nationality" text, "Time" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Rank of the Swimmer in Lane 5?
SELECT AVG("Rank") FROM table_64463 WHERE "Lane" = '5'
wikisql
CREATE TABLE Student ( Fname VARCHAR, Lname VARCHAR, Age VARCHAR, Sex VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show first name, last name, age for all female students. Their sex is F.
SELECT Fname, Lname, Age FROM Student WHERE Sex = 'F'
sql_create_context
CREATE TABLE table_15264 ( "Rank" real, "Population" real, "Name" text, "Former Name" text, "Municipality" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest rank of Qaanaaq, which has a population greater than 231?
SELECT MIN("Rank") FROM table_15264 WHERE "Population" > '231' AND "Name" = 'qaanaaq'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellv...
SELECT vitalperiodic.systemicsystolic FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '032-754')) AND NOT vitalperiodic.systemicsystolic ...
eicu
CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number, ZZBZ number, WDBZ number, JZKSBM text, JZKSMC text, JZKSRQ time, ...
SELECT JZLX FROM jybgb WHERE BGDH = '76103028787'
css
CREATE TABLE table_name_20 ( duration VARCHAR, appearances VARCHAR, character VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the duration that has 3 for appearances, and james garret as the character?
SELECT duration FROM table_name_20 WHERE appearances = "3" AND character = "james garret"
sql_create_context
CREATE TABLE table_204_789 ( id number, "plant name" text, "location" text, "country" text, "startup date" number, "capacity (mmtpa)" text, "corporation" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the total number of plants in al...
SELECT COUNT("plant name") FROM table_204_789 WHERE "country" = 'algeria'
squall
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.marital_status = "SINGLE" AND lab."CATEGORY" = "Chemistry"
mimicsql_data
CREATE TABLE table_57871 ( "Track" real, "Title" text, "Translation" text, "Composer" text, "Recorded" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date recorded of Hate?
SELECT "Recorded" FROM table_57871 WHERE "Translation" = 'hate'
wikisql
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE ReviewTaskSt...
SELECT Id AS "post_link", CreationDate FROM Posts WHERE PostTypeId = 1 AND AnswerCount > 30 AND ClosedDate IS NULL ORDER BY CreationDate DESC
sede
CREATE TABLE table_name_91 ( entrant VARCHAR, points VARCHAR, chassis VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which entrant scored less than 8 points and used a Maserati chassis?
SELECT entrant FROM table_name_91 WHERE points < 8 AND chassis = "maserati"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND lab.label = "Lymphocytes"
mimicsql_data
CREATE TABLE bdmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE wdmzjzjlb.JZZDBM = 'W55.859' AND jyjgzbb.JCZBDM = '...
css
CREATE TABLE table_name_68 ( album VARCHAR, label_and_cat_number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which album has a label and cat# full moon/warner 28628?
SELECT album FROM table_name_68 WHERE label_and_cat_number = "full moon/warner 28628"
sql_create_context
CREATE TABLE table_name_83 ( loser VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team was the loser when the result was 119 113?
SELECT loser FROM table_name_83 WHERE result = "119–113"
sql_create_context
CREATE TABLE table_62129 ( "Year" real, "Grand Slam" text, "Round" text, "Winner" text, "Loser" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the round when Grand Slam was the Davis Cup?
SELECT "Round" FROM table_62129 WHERE "Grand Slam" = 'davis cup'
wikisql
CREATE TABLE table_67779 ( "Year" real, "Team" text, "Co-Drivers" text, "Class" text, "Laps" real, "Pos." text, "Class Pos." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who were the co-drivers for the Racing Organisation Course team in ye...
SELECT "Co-Drivers" FROM table_67779 WHERE "Pos." = 'dnf' AND "Year" < '2011' AND "Team" = 'racing organisation course'
wikisql
CREATE TABLE table_43865 ( "Team 1" text, "Agg." text, "Team 2" text, "1st leg" text, "2nd leg" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is 2nd Leg, when 1st Leg is 'SGM Basso Molise (Molise)'?
SELECT "2nd leg" FROM table_43865 WHERE "1st leg" = 'sgm basso molise (molise)'
wikisql
CREATE TABLE table_16570286_2 ( matches INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest number of matches?
SELECT MAX(matches) FROM table_16570286_2
sql_create_context
CREATE TABLE table_304 ( "Player" text, "Position" text, "School" text, "Hometown" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many players attended Hillcrest High School?
SELECT COUNT("College") FROM table_304 WHERE "School" = 'Hillcrest High School'
wikisql
CREATE TABLE table_name_36 ( player VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Player, when Total is 292?
SELECT player FROM table_name_36 WHERE total = 292
sql_create_context
CREATE TABLE table_23149 ( "Player" text, "Team" text, "Matches" real, "Overs" text, "Wickets" real, "Economy Rate" text, "Average" text, "Strike Rate" text, "BBI" text, "BBM" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How ma...
SELECT COUNT("Wickets") FROM table_23149 WHERE "Strike Rate" = '54.0'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TA...
SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-4322')) AND DATETIME(medication.drugstarttime) >= DATETIME(CURRENT_TIME(),...
eicu
CREATE TABLE table_37300 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text ) -- 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_37300 WHERE "Record" = '24–23–3'
wikisql
CREATE TABLE table_13409 ( "Overall points" text, "100 m" text, "400 m" text, "110 m H" text, "1500 m" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 110m H number when the overall points are 7835 (sb)?
SELECT "110 m H" FROM table_13409 WHERE "Overall points" = '7835 (sb)'
wikisql
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flig...
SELECT DISTINCT city.city_code FROM airport_service, city, flight WHERE city.city_code = airport_service.city_code AND flight.airline_code = 'NW' AND flight.from_airport = airport_service.airport_code
atis
CREATE TABLE table_23258574_2 ( surface VARCHAR, championship VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the surface during wimbledon in 1974?
SELECT surface FROM table_23258574_2 WHERE championship = "Wimbledon" AND year = 1974
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 = '73428643' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT < 9644.26)
css
CREATE TABLE table_name_68 ( venue VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which venue has a Date of 28 july 2007?
SELECT venue FROM table_name_68 WHERE date = "28 july 2007"
sql_create_context
CREATE TABLE table_62899 ( "Name (pinyin)" text, "Name (Wade Giles)" text, "Characters" text, "Type" text, "Construction" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the type of Kuang-Hsing?
SELECT "Type" FROM table_62899 WHERE "Name (Wade Giles)" = 'kuang-hsing'
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.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZ...
css
CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id...
advising
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 prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.dob_year < "2167"
mimicsql_data