instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE prescribes ( physician number, patient number, medication number, date time, appointment number, dose text ) CREATE TABLE undergoes ( patient number, procedures number, stay number, dateundergoes time, physician number, assistingnurse number ) CREATE TABLE ...
SELECT COUNT(T1.ssn) FROM patient AS T1 JOIN prescribes AS T2 ON T1.ssn = T2.patient JOIN physician AS T3 ON T2.physician = T3.employeeid WHERE T3.name = "John Dorian"
spider
CREATE TABLE table_name_60 ( runner_up VARCHAR, tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the runner up in the konica san jose classic Tournament?
SELECT runner_up FROM table_name_60 WHERE tournament = "konica san jose classic"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND prescriptions.drug = "Amiodarone HCl"
mimicsql_data
CREATE TABLE table_24334163_1 ( Winners INTEGER, total_money_won VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the latest amount of won legs in the payoffs when the prize money was 2,350?
SELECT MAX(Winners) AS play_off_legs_won FROM table_24334163_1 WHERE total_money_won = "£2,350"
sql_create_context
CREATE TABLE table_76220 ( "Date" text, "Opponent" text, "Score" text, "Leading Scorer" text, "Attendance" text, "Series" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the opponent of the game with a tied 1-1 series and becky hammon (14)...
SELECT "Opponent" FROM table_76220 WHERE "Series" = 'tied 1-1' AND "Leading Scorer" = 'becky hammon (14)'
wikisql
CREATE TABLE table_20421 ( "Episode Number" real, "Air Date" text, "Guest Host" text, "Musical Guest (Song performed)" text, "Who knows the most about the guest host? panelists" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the date when Jerem...
SELECT "Air Date" FROM table_20421 WHERE "Who knows the most about the guest host? panelists" = 'Jeremy Edwards and Grace Adams-Short'
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 employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL v...
SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
nvbench
CREATE TABLE table_5125 ( "Date" text, "City" text, "Opponent" text, "Results\u00b9" text, "Type of game" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date has friendly as the type of game, france as an opponent, and paris, france as the city...
SELECT "Date" FROM table_5125 WHERE "Type of game" = 'friendly' AND "Opponent" = 'france' AND "City" = 'paris, france'
wikisql
CREATE TABLE table_39650 ( "Pick" real, "Player" text, "Nationality" text, "WNBA Team" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What school or club team did the player chosen for the Sacramento Monarchs play for?
SELECT "School/Club Team" FROM table_39650 WHERE "WNBA Team" = 'sacramento monarchs'
wikisql
CREATE TABLE table_58646 ( "Season" real, "Date" text, "Winning Driver" text, "Car #" real, "Sponsor" text, "Make" text, "Distance" text, "Avg Speed" text, "Margin of Victory" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is th...
SELECT MIN("Car #") FROM table_58646 WHERE "Sponsor" = 'ups' AND "Season" < '2001'
wikisql
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
SELECT T2.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T2.Founder DESC
nvbench
CREATE TABLE table_50126 ( "Award" text, "Year" real, "Category" text, "Work" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the work when the result is won and the year is before 2003?
SELECT "Work" FROM table_50126 WHERE "Result" = 'won' AND "Year" < '2003'
wikisql
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, ...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'OAKLAND...
atis
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE prescriptio...
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26612) AND STRFTIME('%y', prescriptions.startdate) <= '2104'
mimic_iii
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
SELECT * FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.person_info_XM = '姜慧丽' AND hz_info.YLJGDM = '0960685' AND NOT mzjzjlb.JZZDSM LIKE '%紧张%'
css
CREATE TABLE table_name_86 ( model_number VARCHAR, voltage VARCHAR, frequency VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Model Number, when the Voltage is 3.45 V, and when the Frequency is 133 MHZ?
SELECT model_number FROM table_name_86 WHERE voltage = "3.45 v" AND frequency = "133 mhz"
sql_create_context
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE d_labitems ( row_id number, itemid number, label te...
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_i...
mimic_iii
CREATE TABLE table_26965 ( "Name" text, "Position" text, "Period" text, "Appearances\u00b9" real, "Goals\u00b9" real, "Nationality\u00b2" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player had 252 appearances
SELECT "Name" FROM table_26965 WHERE "Appearances\u00b9" = '252'
wikisql
CREATE TABLE table_204_929 ( id number, "location" text, "name of mill and\ngrid reference" text, "type" text, "maps" text, "first mention\nor built" text, "last mention\nor demise" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is th...
SELECT "name of mill and\ngrid reference" FROM table_204_929 WHERE "location" = 'colney heath'
squall
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.ethnicity = "BLACK/AFRICAN AMERICAN" AND demographic.dob_year < "2064"
mimicsql_data
CREATE TABLE table_104858_1 ( admits_boys_girls VARCHAR, year_member_organization_was_founded VARCHAR, name_of_member_organization VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Does the Ghana Scout Association (founded in 1912) admit boys, girls, or bot...
SELECT admits_boys_girls FROM table_104858_1 WHERE year_member_organization_was_founded = "1912" AND name_of_member_organization = "The Ghana Scout Association"
sql_create_context
CREATE TABLE table_name_48 ( driver VARCHAR, laps VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- I want the Driver with Laps of 20
SELECT driver FROM table_name_48 WHERE laps = 20
sql_create_context
CREATE TABLE circulation_history ( document_id number, draft_number number, copy_number number, employee_id number ) CREATE TABLE employees ( employee_id number, role_code text, employee_name text, other_details text ) CREATE TABLE documents_mailed ( document_id number, mailed_...
SELECT receipt_date FROM documents WHERE document_id = 3
spider
CREATE TABLE table_name_25 ( game INTEGER, attendance INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Attendance larger than 55,189 is which average game?
SELECT AVG(game) FROM table_name_25 WHERE attendance > 55 OFFSET 189
sql_create_context
CREATE TABLE Employees ( Employee_ID INTEGER, Role_Code CHAR(15), Employee_Name VARCHAR(255), Gender_MFU CHAR(1), Date_of_Birth DATETIME, Other_Details VARCHAR(255) ) CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME, Day_Number INTEGER ) CREATE TABLE Ref_Locations ( Location_Code...
SELECT Date_in_Location_From, COUNT(Date_in_Location_From) FROM Document_Locations ORDER BY COUNT(Date_in_Location_From) DESC
nvbench
CREATE TABLE table_2523809_1 ( coverage VARCHAR, callsign VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which city did kpnz-tv provide coverage for?
SELECT coverage FROM table_2523809_1 WHERE callsign = "KPNZ-TV"
sql_create_context
CREATE TABLE table_24776075_2 ( final_score VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many final score datas are there on Sunday, May 12?
SELECT COUNT(final_score) FROM table_24776075_2 WHERE date = "Sunday, May 12"
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( medicatio...
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'septic shock - cultures pending') AS t1 JOIN (SELE...
eicu
CREATE TABLE table_name_82 ( team_1 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the 2nd leg score for the match with Lesotho as team 1?
SELECT 2 AS nd_leg FROM table_name_82 WHERE team_1 = "lesotho"
sql_create_context
CREATE TABLE table_name_91 ( engine VARCHAR, notes VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is then engine when the notes state srt8?
SELECT engine FROM table_name_91 WHERE notes = "srt8"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "2749" AND lab."CATEGORY" = "Chemistry"
mimicsql_data
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 demographic.insurance, demographic.discharge_location FROM demographic WHERE demographic.subject_id = "15898"
mimicsql_data
CREATE TABLE Player ( pID numeric(5,0), pName varchar(20), yCard varchar(3), HS numeric(5,0) ) CREATE TABLE Tryout ( pID numeric(5,0), cName varchar(20), pPos varchar(8), decision varchar(3) ) CREATE TABLE College ( cName varchar(20), state varchar(2), enr numeric(5,0) ) ...
SELECT cName, MIN(enr) FROM College GROUP BY state
nvbench
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT DIRE_TYPE FROM t_kc22 WHERE MED_CLINIC_ID = '77488325858' AND SOC_SRT_DIRE_CD = '859155991'
css
CREATE TABLE table_71591 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the average gold for czech republic and bronze less than 1 when total is less than 14
SELECT AVG("Gold") FROM table_71591 WHERE "Total" < '14' AND "Bronze" < '1' AND "Nation" = 'czech republic'
wikisql
CREATE TABLE table_name_44 ( socket VARCHAR, order_part_number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What kind of Socket has a Order part number of tmrm72dam22gg?
SELECT socket FROM table_name_44 WHERE order_part_number = "tmrm72dam22gg"
sql_create_context
CREATE TABLE table_38710 ( "Call sign" text, "Frequency MHz" real, "City of license" text, "ERP W" real, "Class" text, "FCC info" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which FCC info has a Frequency MHz larger than 102.3?
SELECT "FCC info" FROM table_38710 WHERE "Frequency MHz" > '102.3'
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
SELECT MIN(demographic.age) FROM demographic WHERE demographic.insurance = "Private" AND demographic.dod_year < "2183.0"
mimicsql_data
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2041" AND prescriptions.route = "SC"
mimicsql_data
CREATE TABLE table_48334 ( "Model Number" text, "Clock Speed" text, "L2 Cache" text, "FSB Speed" text, "Clock Multiplier" text, "Voltage Range" text, "Socket" text, "Release Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Rele...
SELECT "Release Date" FROM table_48334 WHERE "Voltage Range" = '1.148 v - 1.196 v'
wikisql
CREATE TABLE table_name_88 ( year VARCHAR, standalone VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what year is Zaxxon the Standalone?
SELECT year FROM table_name_88 WHERE standalone = "zaxxon"
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_DIRE_CD text, MED_DIRE_NM text,...
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '26418513266' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY SUM(t_kc22.SELF_PAY_AMO) DES...
css
CREATE TABLE table_60258 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Place has a Player of justin leonard?
SELECT "Place" FROM table_60258 WHERE "Player" = 'justin leonard'
wikisql
CREATE TABLE table_name_65 ( stadium VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What stadium was the game played in on november 20?
SELECT stadium FROM table_name_65 WHERE date = "november 20"
sql_create_context
CREATE TABLE table_15059783_1 ( team_classification VARCHAR, combination_classification VARCHAR, points_classification VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many teams have a combination classification of Alejandro Valverde and a Points clas...
SELECT COUNT(team_classification) FROM table_15059783_1 WHERE combination_classification = "Alejandro Valverde" AND points_classification = "Alessandro Petacchi"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "MARRIED" AND procedures.icd9_code = "3611"
mimicsql_data
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
SELECT DISTINCT prescriptions.route FROM prescriptions WHERE prescriptions.drug = 'naproxen'
mimic_iii
CREATE TABLE table_38240 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the record at the game with a result of W 13-12 after week 4?
SELECT "Record" FROM table_38240 WHERE "Week" > '4' AND "Result" = 'w 13-12'
wikisql
CREATE TABLE table_79100 ( "Position" real, "Team" text, "Played" real, "Drawn" real, "Lost" real, "Goals For" real, "Goals Against" real, "Goal Difference" text, "Points 1" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the ...
SELECT COUNT("Goals For") FROM table_79100 WHERE "Played" < '38'
wikisql
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'head ct scan' AND STRFTIME('%y', treatment.treatmenttime) <= '2104') AS t...
eicu
CREATE TABLE tryout ( pid number, cname text, ppos text, decision text ) CREATE TABLE college ( cname text, state text, enr number ) CREATE TABLE player ( pid number, pname text, ycard text, hs number ) -- Using valid SQLite, answer the following questions for the tables ...
SELECT cname FROM college ORDER BY enr DESC LIMIT 3
spider
CREATE TABLE table_34554 ( "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 the 1st leg of Team 2 PSV Eindhoven?
SELECT "1st leg" FROM table_34554 WHERE "Team 2" = 'psv eindhoven'
wikisql
CREATE TABLE table_77104 ( "Rank" real, "Name" text, "Stories" real, "Height" text, "Year Completed" text, "Primary Purpose" text, "City" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the height of the EMC Insurance Building in Des ...
SELECT "Height" FROM table_77104 WHERE "City" = 'des moines' AND "Name" = 'emc insurance building'
wikisql
CREATE TABLE table_name_50 ( downhill_points INTEGER, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the downhill points for the skier with total of 9.31 points?
SELECT SUM(downhill_points) FROM table_name_50 WHERE total = "9.31"
sql_create_context
CREATE TABLE table_10620 ( "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. -- Where does Melbourne play home games?
SELECT "Venue" FROM table_10620 WHERE "Home team" = 'melbourne'
wikisql
CREATE TABLE table_name_99 ( socialist_workers_ticket VARCHAR, republican_ticket VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When Republican ticket was John P. Lomenzo who ran for the Socialist Workers ticket?
SELECT socialist_workers_ticket FROM table_name_99 WHERE republican_ticket = "john p. lomenzo"
sql_create_context
CREATE TABLE table_550 ( "Championship" text, "Champion(s)" text, "Previous champion(s)" text, "Date Won" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who are the champions that have won at Aguas Buenas, Puerto Rico?
SELECT "Champion(s)" FROM table_550 WHERE "Location" = 'Aguas Buenas, Puerto Rico'
wikisql
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), ...
SELECT T1.FIRST_NAME, T1.MANAGER_ID FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID WHERE T1.EMPLOYEE_ID = T2.MANAGER_ID ORDER BY T1.FIRST_NAME
nvbench
CREATE TABLE table_name_39 ( venue VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the Venue which has a Position of 5th?
SELECT venue FROM table_name_39 WHERE position = "5th"
sql_create_context
CREATE TABLE table_name_21 ( attendance VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the attendance for time of 1:31
SELECT attendance FROM table_name_21 WHERE time = "1:31"
sql_create_context
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, ...
SELECT Posts.Id, Posts.Id AS "post_link", Users.Age, Users.Location, Posts.CreationDate FROM Posts, Users, Tags WHERE Posts.Tags = '24hour' ORDER BY Tags.Id
sede
CREATE TABLE table_62679 ( "Constituency number" text, "Name" text, "Reserved for ( SC / ST /None)" text, "District" text, "Number of electorates (2009)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Bhiwani district have what constituency number?
SELECT "Constituency number" FROM table_62679 WHERE "District" = 'bhiwani'
wikisql
CREATE TABLE table_42615 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the least Top-5 finish when the events are greater than...
SELECT MIN("Top-5") FROM table_42615 WHERE "Events" > '18'
wikisql
CREATE TABLE table_name_29 ( top_fives VARCHAR, year VARCHAR, wins VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of top fives in 2010 when casey mears had more than 0 wins?
SELECT COUNT(top_fives) FROM table_name_29 WHERE year = "2010" AND wins > 0
sql_create_context
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 MZZYZDZZBM, MZZYZDZZMC FROM mzjzjlb WHERE JZLSH = '84220777179'
css
CREATE TABLE table_44674 ( "Nat." text, "Name" text, "Moving to" text, "Type" text, "Transfer window" text, "Transfer fee" text, "Source" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the transfer fee when winter was the transfer w...
SELECT "Transfer fee" FROM table_44674 WHERE "Transfer window" = 'winter'
wikisql
CREATE TABLE table_6009 ( "Release date" text, "Country" text, "Classifaction" text, "Publisher" text, "Format" text, "Region" text, "Language" text, "Sound" text, "Subtitles" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What langu...
SELECT "Language" FROM table_6009 WHERE "Publisher" = '20th century fox'
wikisql
CREATE TABLE weather ( date TEXT, max_temperature_f INTEGER, mean_temperature_f INTEGER, min_temperature_f INTEGER, max_dew_point_f INTEGER, mean_dew_point_f INTEGER, min_dew_point_f INTEGER, max_humidity INTEGER, mean_humidity INTEGER, min_humidity INTEGER, max_sea_level_pre...
SELECT date, SUM(cloud_cover) FROM weather ORDER BY SUM(cloud_cover)
nvbench
CREATE TABLE table_74842 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Label has a Region of united states, and a Format of lp album?
SELECT "Label" FROM table_74842 WHERE "Region" = 'united states' AND "Format" = 'lp album'
wikisql
CREATE TABLE table_name_94 ( assists VARCHAR, blocks VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Assists that has a Blocks of 2 tied (1) with a Year larger than 1995
SELECT assists FROM table_name_94 WHERE blocks = "2 tied (1)" AND year > 1995
sql_create_context
CREATE TABLE table_name_32 ( driver VARCHAR, team VARCHAR, points VARCHAR, grid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which driver has fewer than 2 points, larger grid that 4 and is on American Spirit Team Johansson?
SELECT driver FROM table_name_32 WHERE points < 2 AND grid > 4 AND team = "american spirit team johansson"
sql_create_context
CREATE TABLE table_name_92 ( date_withdrawn VARCHAR, date_made VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the withdrawal date associated with a date made of 1904?
SELECT date_withdrawn FROM table_name_92 WHERE date_made = "1904"
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE vitalperiodic ( ...
SELECT COUNT(*) FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-16123')) AND microlab.culturesite = 'nasopharynx' AND STRFTIME('%y', microlab....
eicu
CREATE TABLE table_6970 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Score has a Tournament of san jose, us (2)?
SELECT "Score" FROM table_6970 WHERE "Tournament" = 'san jose, us (2)'
wikisql
CREATE TABLE table_60051 ( "Draft" real, "Round" text, "Pick" real, "Player" text, "Nationality" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Player has a Round of 9, and a Pick of 263?
SELECT "Player" FROM table_60051 WHERE "Round" = '9' AND "Pick" = '263'
wikisql
CREATE TABLE table_31995 ( "Year" real, "Competition" text, "Date" text, "Location" text, "Score" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the date for warsaw 1929
SELECT "Date" FROM table_31995 WHERE "Location" = 'warsaw' AND "Year" = '1929'
wikisql
CREATE TABLE table_14727 ( "Date" text, "Home captain" text, "Away captain" text, "Venue" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the Home Captain for 23,24,25,26 july 1992?
SELECT "Home captain" FROM table_14727 WHERE "Date" = '23,24,25,26 july 1992'
wikisql
CREATE TABLE table_name_94 ( nationality VARCHAR, round VARCHAR, college VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For the draft pick from round 3 out of Mercer College what is the nationality?
SELECT nationality FROM table_name_94 WHERE round = 3 AND college = "mercer"
sql_create_context
CREATE TABLE table_204_778 ( id number, "code" number, "county" text, "former province" text, "area (km2)" number, "population\ncensus 2009" number, "capital" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- did mombasa or tana river have a la...
SELECT "county" FROM table_204_778 WHERE "county" IN ('mombasa', 'tana river') ORDER BY "population\ncensus 2009" DESC LIMIT 1
squall
CREATE TABLE table_59194 ( "Code" real, "Municipality" text, "County" text, "Population" real, "Total area" text, "Density (per km 2 land)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the population of Danderyd municipality in Stockho...
SELECT COUNT("Population") FROM table_59194 WHERE "County" = 'stockholm county' AND "Municipality" = 'danderyd municipality' AND "Code" < '162'
wikisql
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 person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) FROM person_info JOIN hz_info JOIN wdmzjzjlb 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 WHERE wdmzjzjlb.JZZDBM = 'T31.744' GROUP BY person_info.JGDM UNION SELECT...
css
CREATE TABLE journalist ( journalist_ID int, Name text, Nationality text, Age text, Years_working int ) CREATE TABLE event ( Event_ID int, Date text, Venue text, Name text, Event_Attendance int ) CREATE TABLE news_report ( journalist_ID int, Event_ID int, Work_Type ...
SELECT Nationality, SUM(Age) FROM journalist GROUP BY Nationality ORDER BY SUM(Age) DESC
nvbench
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE labevents ( row_id number, sub...
SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_di...
mimic_iii
CREATE TABLE table_29126507_1 ( date VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the home team Essendon?
SELECT date FROM table_29126507_1 WHERE home_team = "Essendon"
sql_create_context
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
SELECT wdmzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN wdmzjzjlb 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 WHERE person_info.XM = '曹斌蔚' AND NOT wdmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2013-12-2...
css
CREATE TABLE table_name_1 ( driver VARCHAR, constructor VARCHAR, time_retired VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the driver, when the constructor was Renault, and when the Time/Retired was +38.600?
SELECT driver FROM table_name_1 WHERE constructor = "renault" AND time_retired = "+38.600"
sql_create_context
CREATE TABLE table_name_8 ( country VARCHAR, money___$__ VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Country has a Player with Playoff Money with a Score of 72-69-73-73=287?
SELECT country FROM table_name_8 WHERE money___$__ = "playoff" AND score = 72 - 69 - 73 - 73 = 287
sql_create_context
CREATE TABLE table_name_46 ( series VARCHAR, director VARCHAR, title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What series has dan povenmire as the director, with museum scream as the title?
SELECT series FROM table_name_46 WHERE director = "dan povenmire" AND title = "museum scream"
sql_create_context
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE gsi ( c...
SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'STDABRD' AND course.number = 368 AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016
advising
CREATE TABLE table_name_17 ( overall INTEGER, college VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest Overall, when College is Hardin-Simmons, and when Round is greater than 26?
SELECT MIN(overall) FROM table_name_17 WHERE college = "hardin-simmons" AND round > 26
sql_create_context
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE student_record ( student_...
SELECT DISTINCT student_record.grade FROM student_record INNER JOIN offering_instructor ON student_record.offering_id = offering_instructor.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE LOWER(instructor.name) LIKE '%Seward%' AND student_record.student_id = 1
advising
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
SELECT Price, Manufacturer FROM Products WHERE Price BETWEEN 60 AND 120 GROUP BY Name
nvbench
CREATE TABLE table_name_26 ( role VARCHAR, notes VARCHAR, title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the role that has a Title of Salud, Dinero y Amor and antagonist in the notes field?
SELECT role FROM table_name_26 WHERE notes = "antagonist" AND title = "salud, dinero y amor"
sql_create_context
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT ACC_Road, Team_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road
nvbench
CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT ) CREATE TABLE status ( station_id INTEGER, bikes_available INTEGER, docks_available INTEGER, time TEXT ) CREATE TABLE weather ( date TEXT, ...
SELECT date, COUNT(date) FROM weather WHERE max_temperature_f >= 80 GROUP BY date ORDER BY date
nvbench
CREATE TABLE table_41110 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many losses does corinthians have when they...
SELECT COUNT("Lost") FROM table_41110 WHERE "Team" = 'corinthians' AND "Points" > '22'
wikisql
CREATE TABLE table_name_33 ( meet VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Meet of the Event with a Time of 7:55.02?
SELECT meet FROM table_name_33 WHERE time = "7:55.02"
sql_create_context
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TAB...
SELECT CONCAT(YEAR(P.CreationDate), '-', MONTH(P.CreationDate)) AS YearMonth, 'MsAccess' AS TagName, COUNT(*) AS PostCount FROM Posts AS P INNER JOIN PostTags AS PT ON (P.Id = PT.PostId) INNER JOIN Tags AS T ON (PT.TagId = T.Id) WHERE T.TagName LIKE 'ms-access%' GROUP BY YEAR(P.CreationDate), MONTH(P.CreationDate) ORDE...
sede
CREATE TABLE table_49610 ( "Region (year)" text, "No. 1" text, "No. 2" text, "No. 3" text, "No. 4" text, "No. 5" text, "No. 6" text, "No. 7" text, "No. 8" text, "No. 9" text, "No. 10" text ) -- Using valid SQLite, answer the following questions for the tables provided above...
SELECT "No. 10" FROM table_49610 WHERE "No. 1" = 'noah' AND "No. 9" = 'carter'
wikisql
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, Cr...
SELECT c.PostId AS PostId, c.UserId AS C_UserId FROM Comments AS c WHERE c.PostId IN (SELECT p2.Id FROM Posts AS p2 WHERE p2.Tags LIKE '%android%' ORDER BY p2.CommentCount DESC LIMIT 500)
sede