instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Ath ext ntv at w claudct"
mimicsql_data
CREATE TABLE table_train_273 ( "id" int, "systolic_blood_pressure_sbp" int, "hemoglobin_a1c_hba1c" float, "body_weight" float, "hba1c" float, "insulin_requirement" float, "body_mass_index_bmi" float, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables p...
SELECT * FROM table_train_273 WHERE body_mass_index_bmi >= 27 AND body_mass_index_bmi <= 45 AND body_weight <= 136
criteria2sql
CREATE TABLE Settlements ( Settlement_ID INTEGER, Claim_ID INTEGER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed INTEGER, Amount_Settled INTEGER, Customer_Policy_ID INTEGER ) CREATE TABLE Payments ( Payment_ID INTEGER, Settlement_ID INTEGER, Payment_Method_Code ...
SELECT Date_Payment_Made, AVG(Amount_Payment) FROM Payments WHERE Payment_Method_Code = 'Visa'
nvbench
CREATE TABLE Order_Items ( Order_Item_ID INTEGER, Order_ID INTEGER, Product_ID INTEGER, Order_Quantity VARCHAR(288), Other_Item_Details VARCHAR(255) ) CREATE TABLE Bookings ( Booking_ID INTEGER, Customer_ID INTEGER, Workshop_Group_ID VARCHAR(100), Status_Code CHAR(15), Store_ID ...
SELECT payment_method_code, COUNT(*) FROM Invoices GROUP BY payment_method_code ORDER BY payment_method_code DESC
nvbench
CREATE TABLE table_name_28 ( seats INTEGER, _percentage_change VARCHAR, _percentage_votes VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the fewest seats with a -3.7% change and more than 4.7% votes?
SELECT MIN(seats) FROM table_name_28 WHERE _percentage_change = -3.7 AND _percentage_votes > 4.7
sql_create_context
CREATE TABLE table_69873 ( "Year" text, "Team" text, "Number" text, "BB +HBP" real, "BA (Place)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In the year 1992 for the Seibu Lions, the BB + HBP which is larger than 49 was this as a BA (Place)?
SELECT "BA (Place)" FROM table_69873 WHERE "BB +HBP" > '49' AND "Team" = 'seibu lions' AND "Year" = '1992'
wikisql
CREATE TABLE table_76915 ( "Year" real, "Film" text, "Role" text, "Director" text, "Studio" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Year of the Film Klondike Annie?
SELECT SUM("Year") FROM table_76915 WHERE "Film" = 'klondike annie'
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 demographic ( subject_id text, hadm_id t...
SELECT prescriptions.drug, prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "ASA325"
mimicsql_data
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 demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2158" AND diagnoses.long_title = "Unspecified pleural effusion"
mimicsql_data
CREATE TABLE table_46528 ( "car model" text, "displacement & configuration" text, "max. motive power @ rpm" text, "max. torque @ rpm" text, "max. speed" text, "emissions CO2" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the displacemen...
SELECT "displacement & configuration" FROM table_46528 WHERE "emissions CO2" = '204 g/km'
wikisql
CREATE TABLE table_51708 ( "Year" real, "Category" text, "Character" text, "For The Show" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What show had a nomination for best actor in a lead role female (popular) in 2006?
SELECT "For The Show" FROM table_51708 WHERE "Category" = 'best actor in a lead role – female (popular)' AND "Year" = '2006'
wikisql
CREATE TABLE table_name_95 ( home_team VARCHAR, crowd INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What home team has had a crowd bigger than 20,000?
SELECT home_team FROM table_name_95 WHERE crowd > 20 OFFSET 000
sql_create_context
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 WHERE qtb.MED_SER_ORG_NO = '3916890' AND qtb.IN_HOSP_DATE BETWEEN '2003-07-01' AND '2021-03-29' AND qtb.REMOTE_SETTLE_FLG = '异地1' OR qtb.REMOTE_SETTLE_FLG = '异地2' UNION SELECT COUNT(*) FROM gyb WHERE gyb.MED_SER_ORG_NO = '3916890' AND gyb.IN_HOSP_DATE BETWEEN '2003-07-01' AND '2021-03-29' AND g...
css
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 semester ( semester_id int, semester varchar, year int ) CREATE TABLE...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'CHEMBIO' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Fal...
advising
CREATE TABLE table_56287 ( "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. -- When Nashville was the visiting team what was the lowest Attendanc...
SELECT MIN("Attendance") FROM table_56287 WHERE "Visitor" = 'nashville'
wikisql
CREATE TABLE table_26548 ( "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 is the name of episod...
SELECT "Title" FROM table_26548 WHERE "No. in series" = '77'
wikisql
CREATE TABLE table_60959 ( "Cover Date" text, "Story Title" text, "Writer/s" text, "Letterer/s" text, "Colourist/s" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the Colourist that has a Story Title of Broken Glass (part 3) and a Letterer of...
SELECT "Colourist/s" FROM table_60959 WHERE "Letterer/s" = 'albers' AND "Story Title" = 'broken glass (part 3)'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wa...
SELECT t2.drugname FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-3028') AND diagnosis.diagnosi...
eicu
CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE swimme...
SELECT T4.Name, COUNT(T4.Name) FROM swimmer AS t1 JOIN record AS t2 ON t1.ID = t2.Swimmer_ID JOIN event AS t3 ON t2.Event_ID = t3.ID JOIN stadium AS t4 ON t4.ID = t3.Stadium_ID WHERE t1.Nationality = 'Australia' GROUP BY T4.Name
nvbench
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT person_info.XM FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb 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 AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE jybgb.BGDH = '9...
css
CREATE TABLE table_13139 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the player for Japan when the to par was smaller than 7?
SELECT "Player" FROM table_13139 WHERE "To par" < '7' AND "Country" = 'japan'
wikisql
CREATE TABLE table_201_44 ( id number, "year" number, "title" text, "role" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which of elizabeth berkley 's films got her the most award nominations ?
SELECT "title" FROM table_201_44 ORDER BY "notes" DESC LIMIT 1
squall
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.gender = "M" AND procedures.icd9_code = "102"
mimicsql_data
CREATE TABLE table_name_90 ( second VARCHAR, lead VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the Second when Michel Gribi is the lead?
SELECT second FROM table_name_90 WHERE lead = "michel gribi"
sql_create_context
CREATE TABLE table_53294 ( "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 plays at Arden Street Oval?
SELECT "Away team" FROM table_53294 WHERE "Venue" = 'arden street oval'
wikisql
CREATE TABLE table_39182 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Series" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Game has a Series of bruins lead 3 1?
SELECT SUM("Game") FROM table_39182 WHERE "Series" = 'bruins lead 3–1'
wikisql
CREATE TABLE table_name_90 ( tournament INTEGER, total VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many tournament titles for iowa state with 3 total titles?
SELECT MAX(tournament) FROM table_name_90 WHERE total = 3 AND team = "iowa state"
sql_create_context
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) 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 ...
SELECT t_kc21.IN_HOSP_DAYS FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '43389483198'
css
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE cost ( row_id number, subject_...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 588...
mimic_iii
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 medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-9853')) AND medication.routeadmin = 'inhale' AND STRFTIME('%y-%...
eicu
CREATE TABLE table_32421 ( "Season" real, "Driver" text, "Team" text, "Engine" text, "Poles" real, "Wins" real, "Podiums" real, "Points" real, "Margin of defeat" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the most recent ...
SELECT MAX("Season") FROM table_32421 WHERE "Engine" = 'ferrari' AND "Driver" = 'fernando alonso' AND "Podiums" > '13'
wikisql
CREATE TABLE table_name_22 ( average_cards_a_game INTEGER, season VARCHAR, red_cards VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Average Cards a game has a Season of 2004/2005, and a Red Cards larger than 3?
SELECT MIN(average_cards_a_game) FROM table_name_22 WHERE season = "2004/2005" AND red_cards > 3
sql_create_context
CREATE TABLE table_40013 ( "Date" text, "Score" text, "Set 1" text, "Set 2" text, "Set 3" text, "Set 4" text, "Set 5" text, "Total" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was set 3 of 18-25?
SELECT "Date" FROM table_40013 WHERE "Set 3" = '18-25'
wikisql
CREATE TABLE table_204_549 ( id number, "series\nnumber" text, "key" text, "composed" text, "published" text, "opus no." text, "brown" text, "kobylanska" text, "chominski" text, "dedication" text, "notes" text ) -- Using valid SQLite, answer the following questions for the ...
SELECT "published" FROM table_204_549 GROUP BY "published" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABL...
SELECT DISTINCT advisory_requirement, enforced_requirement, name FROM course WHERE department = 'EECS' AND number = 463
advising
CREATE TABLE schedule ( Cinema_ID int, Film_ID int, Date text, Show_times_per_day int, Price float ) CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_season int, Title text, Directed_by text, Original_air_date text, Production_code text ) CREATE TABLE cine...
SELECT Openning_year, SUM(Capacity) FROM cinema GROUP BY Openning_year ORDER BY Openning_year DESC
nvbench
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "WIDOWED" AND lab.label = "Albumin, Urine"
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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND demographic.admityear < "2148"
mimicsql_data
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden ...
SELECT p.Id AS "post_link", c.Text FROM Posts AS p INNER JOIN Comments AS c ON c.PostId = p.Id WHERE c.Text LIKE '%answer%' AND p.AnswerCount = 0 AND p.ClosedDate IS NULL ORDER BY p.CreationDate
sede
CREATE TABLE table_55379 ( "Sport" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest Shooting Total with a Bronze less than 0?
SELECT MAX("Total") FROM table_55379 WHERE "Sport" = 'shooting' AND "Bronze" < '0'
wikisql
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_...
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, food_service WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code AND food...
atis
CREATE TABLE table_32690 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the lowest crowd size when the away tea...
SELECT MIN("Crowd") FROM table_32690 WHERE "Away team score" = '11.17 (83)'
wikisql
CREATE TABLE table_8268 ( "Name" text, "Date" text, "Defending forces" text, "Brigade" text, "Population" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which brigade has a population of 190?
SELECT "Brigade" FROM table_8268 WHERE "Population" = '190'
wikisql
CREATE TABLE table_name_94 ( traffic_direction VARCHAR, street VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the traffic direction of 97th street?
SELECT traffic_direction FROM table_name_94 WHERE street = "97th street"
sql_create_context
CREATE TABLE table_203_563 ( id number, "#" number, "judge" text, "state" text, "born/died" text, "active" text, "chief" text, "senior" text, "appointed by" text, "reason for\ntermination" text ) -- Using valid SQLite, answer the following questions for the tables provided abov...
SELECT "state" FROM table_203_563 GROUP BY "state" ORDER BY COUNT("judge") DESC LIMIT 1
squall
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int,...
SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN course ON course.course_id = course_offering.course_id INNER JOIN semester...
advising
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, val...
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14397 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND prescriptions.route = 'oral' ORDER BY prescriptions.startdate DESC LIMIT 1
mimic_iii
CREATE TABLE table_59569 ( "Club" text, "Wins" real, "Byes" real, "Losses" real, "Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which wins have less than 1 bye?
SELECT MAX("Wins") FROM table_59569 WHERE "Byes" < '1'
wikisql
CREATE TABLE table_70343 ( "Year" text, "Total (000s)" real, "Israel" real, "Germany" real, "Jews (Halakha) in Israel" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the amount of 000s when Germany had 16.6?
SELECT "Total (000s)" FROM table_70343 WHERE "Germany" = '16.6'
wikisql
CREATE TABLE table_54289 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who did they lose to 3-17?
SELECT "Opponent" FROM table_54289 WHERE "Score" = '3-17'
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 prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, ...
SELECT STRFTIME('%j', icustays.outtime) - STRFTIME('%j', icustays.intime) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28484) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1
mimic_iii
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE vitalperiodic ( vitalperio...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE NOT patient.hospitaldischargetime IS NULL AND DATETIME(patient.hospitaldischargetime) >= DATETIME(CURRENT_TIME(), '-2 year')
eicu
CREATE TABLE table_23725 ( "Date" text, "Presenter" text, "Guest 1" text, "Guest 2" text, "Guest 3" text, "Guest 4" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the guest 2 in the episode where guest 4 is Iyare Igiehon and guest 3 is Jo...
SELECT "Guest 2" FROM table_23725 WHERE "Guest 4" = 'Iyare Igiehon' AND "Guest 3" = 'John Oliver'
wikisql
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date...
SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE NOT FIRST_NAME LIKE '%M%'
nvbench
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 * FROM hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb 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 AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH WHERE hz_inf...
css
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'peptic ulcer di...
eicu
CREATE TABLE table_name_64 ( team_1 VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the team 1 for round 3
SELECT team_1 FROM table_name_64 WHERE round = "3"
sql_create_context
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 MED_CLINIC_ID FROM t_kc21 WHERE PERSON_NM = '魏阳舒' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE AMOUNT >= 6027.88)
css
CREATE TABLE table_25711913_14 ( field_goals__4_points_ VARCHAR, touchdowns__5_points_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many field goals were scored by the player that got 7 touchdowns?
SELECT field_goals__4_points_ FROM table_25711913_14 WHERE touchdowns__5_points_ = 7
sql_create_context
CREATE TABLE fgwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT SUM(t_kc22.AMOUNT) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '施博雅' AND gwyjzb.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2005-08-29' AND '2007-04-15' AND t_kc22.MED_INV_ITEM_TYPE = '手术费' UNION SELECT SUM(t_kc22.AMOUNT) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb...
css
CREATE TABLE table_52272 ( "Name" text, "Years" text, "Area" text, "Authority" text, "Decile" text, "Roll" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the school with a decile of 1, a state authority, and located in Otahuh...
SELECT "Name" FROM table_52272 WHERE "Decile" = '1' AND "Authority" = 'state' AND "Area" = 'otahuhu'
wikisql
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) 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 T...
SELECT JOB_ID, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMPLOYEE_ID
nvbench
CREATE TABLE table_31596 ( "Year" real, "Date" text, "Event" text, "Days" text, "Stages" text, "Acts" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the stages for 1981
SELECT "Stages" FROM table_31596 WHERE "Year" = '1981'
wikisql
CREATE TABLE table_name_27 ( language VARCHAR, film_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what language is seethaiah in
SELECT language FROM table_name_27 WHERE film_name = "seethaiah"
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 diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.dob_year < "2103"
mimicsql_data
CREATE TABLE table_name_89 ( date VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the date of stade des martyrs, dr congo
SELECT date FROM table_name_89 WHERE venue = "stade des martyrs, dr congo"
sql_create_context
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 gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_ID = '85618311' AND NOT gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 2746.51) UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '85618311' AND NOT fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLI...
css
CREATE TABLE table_45257 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum for the week with the date october 30, 1994?
SELECT SUM("Week") FROM table_45257 WHERE "Date" = 'october 30, 1994'
wikisql
CREATE TABLE table_23662356_3 ( average VARCHAR, number_of_dances VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many averages were listed for the couple who had 12 dances?
SELECT COUNT(average) FROM table_23662356_3 WHERE number_of_dances = 12
sql_create_context
CREATE TABLE table_name_51 ( type VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the school type for Los Angeles, California?
SELECT type FROM table_name_51 WHERE location = "los angeles, california"
sql_create_context
CREATE TABLE table_203_267 ( id number, "no." number, "song" text, "singers" text, "length (m:ss)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the number of songs sung by two singers ?
SELECT COUNT("song") FROM table_203_267 WHERE "singers" >= 2
squall
CREATE TABLE table_70625 ( "Position" text, "Name" text, "Height" text, "Weight (lbs.)" real, "Hometown" text, "Draft Year" real, "Pick" text, "All-Stars" text, "NBA Championships" text, "NBA Team" text ) -- Using valid SQLite, answer the following questions for the tables prov...
SELECT "Pick" FROM table_70625 WHERE "Height" = '6''9' AND "Weight (lbs.)" = '215'
wikisql
CREATE TABLE table_14903081_1 ( current_venue VARCHAR, tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the current venue for the Miami Masters tournament?
SELECT current_venue FROM table_14903081_1 WHERE tournament = "Miami Masters"
sql_create_context
CREATE TABLE table_75294 ( "Game" real, "December" real, "Opponent" text, "Score" text, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- after december 29 what is the score?
SELECT "Score" FROM table_75294 WHERE "December" > '29'
wikisql
CREATE TABLE table_68431 ( "Episode" text, "First aired" text, "Entrepreneur(s)" text, "Company or product name" text, "Money requested (\u00a3)" real, "Investing Dragon(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much money did gamin...
SELECT COUNT("Money requested (\u00a3)") FROM table_68431 WHERE "Company or product name" = 'gaming alerts'
wikisql
CREATE TABLE table_2639433_4 ( timeslot VARCHAR, episodes VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the episode was number 234, what was it's timeslot?
SELECT timeslot FROM table_2639433_4 WHERE episodes = 234
sql_create_context
CREATE TABLE table_name_56 ( car INTEGER, yards INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest Car with more than 155 yards?
SELECT MAX(car) FROM table_name_56 WHERE yards > 155
sql_create_context
CREATE TABLE table_46120 ( "School" text, "Location" text, "Founded" real, "Affiliation" text, "Nickname" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What school has a public nickname, founded after 1838 in Harrisonburg, Va?
SELECT "Nickname" FROM table_46120 WHERE "Affiliation" = 'public' AND "Founded" > '1838' AND "Location" = 'harrisonburg, va'
wikisql
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, Deletio...
SELECT Users.Id AS "user_link", SUM(Posts.Score) AS Score FROM Users JOIN Posts ON Users.Id = Posts.OwnerUserId JOIN PostTags ON PostTags.PostId = Posts.Id GROUP BY Users.Id, DisplayName ORDER BY SUM(Posts.Score) LIMIT 10
sede
CREATE TABLE files ( f_id number, artist_name text, file_size text, duration text, formats text ) CREATE TABLE artist ( artist_name text, country text, gender text, preferred_genre text ) CREATE TABLE song ( song_name text, artist_name text, country text, f_id numbe...
SELECT AVG(rating), languages FROM song GROUP BY languages
spider
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT COUNT(hz_info.RYBH) 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.JZLSH AND hz_in...
css
CREATE TABLE table_name_31 ( recorded VARCHAR, track VARCHAR, translation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which recording has a Track larger than 2, and a Translation of the last meal?
SELECT recorded FROM table_name_31 WHERE track > 2 AND translation = "the last meal"
sql_create_context
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT COUNT(*) FROM Posts, Users WHERE Posts.OwnerUserId = Users.Id AND Users.Id = '##UserID##' AND Posts.CreationDate BETWEEN '##StartDate##' AND '##EndDate##'
sede
CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text, ZYLBDM text, ZYMC text ) CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGD...
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDSM = '急性支气管炎' AND jyjgzbb.JCZBMC = '触珠蛋白'
css
CREATE TABLE table_22907 ( "Draw" real, "Country" text, "Language" text, "Artist" text, "Song" text, "English translation" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the English translation is hello girl, what was the l...
SELECT "Language" FROM table_22907 WHERE "English translation" = 'Hello girl'
wikisql
CREATE TABLE table_name_71 ( opponent VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which opponent had a time of 0:29?
SELECT opponent FROM table_name_71 WHERE time = "0:29"
sql_create_context
CREATE TABLE aircraft ( Aircraft_ID int(11), Aircraft varchar(50), Description varchar(50), Max_Gross_Weight varchar(50), Total_disk_area varchar(50), Max_disk_Loading varchar(50) ) CREATE TABLE match ( Round real, Location text, Country text, Date text, Fastest_Qualifying t...
SELECT Aircraft, COUNT(*) FROM aircraft AS T1 JOIN match AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft
nvbench
CREATE TABLE payments ( payment_id number, settlement_id number, payment_method_code text, date_payment_made time, amount_payment number ) CREATE TABLE settlements ( settlement_id number, claim_id number, date_claim_made time, date_claim_settled time, amount_claimed number, ...
SELECT T1.customer_details, T1.customer_id FROM customers AS T1 JOIN customer_policies AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING COUNT(*) >= 2 EXCEPT SELECT T1.customer_details, T1.customer_id FROM customers AS T1 JOIN customer_policies AS T2 ON T1.customer_id = T2.customer_id JOIN claims ...
spider
CREATE TABLE table_204_506 ( id number, "seasons" number, "team" text, "ch.wins" number, "promotions" number, "relegations" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many teams are listed ?
SELECT COUNT("team") FROM table_204_506
squall
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 prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Nitroglycerin SL"
mimicsql_data
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 treatment.treatmentname FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '008-39015')) AND DATETIME(treatment.treatmenttime, 'start of year...
eicu
CREATE TABLE table_name_13 ( label VARCHAR, catalog VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Label has a Catalog of 486 136-2?
SELECT label FROM table_name_13 WHERE catalog = "486 136-2"
sql_create_context
CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE offering_instructor ( ...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE program_course.catego...
advising
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
SELECT Users.Id AS "user_link", Posts.Title, 'http://english.stackexchange.com/questions/' + CAST(Posts.Id AS TEXT) AS Hyperlink, Posts.LastEditDate, Posts.CreationDate, Posts.ClosedDate, Posts.AcceptedAnswerId FROM Users INNER JOIN Posts ON Users.Id = OwnerUserId WHERE Reputation >= 1000 AND Title != '' AND Posts.Crea...
sede
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE ta ( campus_job_id int,...
SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id
advising
CREATE TABLE table_11268 ( "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. -- What field did the Home Team score 5.10 (40)?
SELECT "Venue" FROM table_11268 WHERE "Home team score" = '5.10 (40)'
wikisql
CREATE TABLE table_name_40 ( goals_for VARCHAR, played VARCHAR, draws VARCHAR, losses VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of goals when there are 3 draws, more than 18 losses, and played is smaller than 38?
SELECT COUNT(goals_for) FROM table_name_40 WHERE draws = 3 AND losses > 18 AND played < 38
sql_create_context
CREATE TABLE mzb ( 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 qtb.IN_DIAG_DIS_CD, qtb.IN_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_ID = '55103393' AND qtb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 6694.41) UNION SELECT gyb.IN_DIAG_DIS_CD, gyb.IN_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_ID = '55103393' AND gyb.MED_CLINIC_ID IN (SELECT t_kc...
css
CREATE TABLE table_name_94 ( bronze INTEGER, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the most bronze when the total is 9?
SELECT MAX(bronze) FROM table_name_94 WHERE total = 9
sql_create_context
CREATE TABLE table_name_24 ( date VARCHAR, location_attendance VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date was the location attendance at&t center 18,797, and a game earlier than 57?
SELECT date FROM table_name_24 WHERE location_attendance = "at&t center 18,797" AND game < 57
sql_create_context