instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE Ref_Budget_Codes ( Budget_Type_Code CHAR(15), Budget_Type_Description VARCHAR(255) ) CREATE TABLE Documents ( Document_ID INTEGER, Document_Type_Code CHAR(15), Project_ID INTEGER, Document_Date DATETIME, Document_Name VARCHAR(255), Document_Description VARCHAR(255), Oth...
SELECT T1.Project_Details, T1.Project_ID FROM Projects AS T1 JOIN Documents AS T2 ON T1.Project_ID = T2.Project_ID ORDER BY T1.Project_Details
nvbench
CREATE TABLE Customers ( customer_id INTEGER, payment_method VARCHAR(15), customer_name VARCHAR(80), date_became_customer DATETIME, other_customer_details VARCHAR(255) ) CREATE TABLE Customer_Orders ( order_id INTEGER, customer_id INTEGER, order_status VARCHAR(15), order_date DATETI...
SELECT active_from_date, COUNT(active_from_date) FROM Customers AS t1 JOIN Customer_Contact_Channels AS t2 ON t1.customer_id = t2.customer_id WHERE t2.channel_code = 'Email' GROUP BY customer_name ORDER BY COUNT(active_from_date)
nvbench
CREATE TABLE table_1342013_10 ( candidates VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many candidates ran in the race where the incumbent is J. L. Pilcher?
SELECT COUNT(candidates) FROM table_1342013_10 WHERE incumbent = "J. L. Pilcher"
sql_create_context
CREATE TABLE table_name_30 ( home_team VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is North Melbourne's home team?
SELECT home_team FROM table_name_30 WHERE away_team = "north melbourne"
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( medicationid ...
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '018-20179' AND patient.hospitaldischargetime IS NULL)) AND med...
eicu
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 99080) AND microbiologyevents.spec_type_desc = 'staph aureus screen' AND DATETIME(microbiologyevents.charttime) <= DATETIME(CURRENT_TIME(), '-95 month')
mimic_iii
CREATE TABLE teaches ( id text, course_id text, sec_id text, semester text, year number ) CREATE TABLE department ( dept_name text, building text, budget number ) CREATE TABLE student ( id text, name text, dept_name text, tot_cred number ) CREATE TABLE section ( co...
SELECT T2.name FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id = T2.id JOIN student AS T3 ON T1.s_id = T3.id ORDER BY T3.tot_cred DESC LIMIT 1
spider
CREATE TABLE table_24231638_3 ( manner_of_departure VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the manner of departure for the team racing santander?
SELECT manner_of_departure FROM table_24231638_3 WHERE team = "Racing Santander"
sql_create_context
CREATE TABLE table_77611 ( "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 the game on January 12?
SELECT "Score" FROM table_77611 WHERE "Date" = 'january 12'
wikisql
CREATE TABLE table_name_19 ( surface VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What surface was used on may 13, 2007?
SELECT surface FROM table_name_19 WHERE date = "may 13, 2007"
sql_create_context
CREATE TABLE table_5432 ( "Church name" text, "Organized by" text, "Date" text, "Split off / Continuation of" text, "Current status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which church had a Split off/Continuation in 1836?
SELECT "Split off / Continuation of" FROM table_5432 WHERE "Date" = '1836'
wikisql
CREATE TABLE table_37034 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" real, "Finish" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Player of corey pavin, and a To par larger than 5 has what average total?
SELECT AVG("Total") FROM table_37034 WHERE "Player" = 'corey pavin' AND "To par" > '5'
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 COUNT(t_kc21.PERSON_ID) FROM t_kc21 WHERE t_kc21.IN_DIAG_DIS_NM = '脑梗死后遗症'
css
CREATE TABLE table_39956 ( "Rank" real, "Name" text, "Years" text, "Matches" text, "Goals" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many goals ranked 6?
SELECT COUNT("Goals") FROM table_39956 WHERE "Rank" = '6'
wikisql
CREATE TABLE table_name_38 ( draws INTEGER, goals_against VARCHAR, losses VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total draw count with 52 goals and less than 15 losses?
SELECT SUM(draws) FROM table_name_38 WHERE goals_against = 52 AND losses < 15
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND diagnoses.icd9_code = "V1083"
mimicsql_data
CREATE TABLE table_34729 ( "Country" text, "Skip" text, "Third" text, "Second" text, "Lead" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which second's skip is Chris Plys?
SELECT "Second" FROM table_34729 WHERE "Skip" = 'chris plys'
wikisql
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.MED_CLINIC_ID FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.PERSON_NM = '苗飞章' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2015-03-03' AND '2015-09-01' UNION SELECT gyb.MED_CLINIC_ID FROM gyb JOIN t_kc24 ON gyb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gyb.PERSON_NM = '苗飞章' AND t_kc24.CL...
css
CREATE TABLE table_name_79 ( hole VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many holes does Player Vijay Singh have?
SELECT COUNT(hole) FROM table_name_79 WHERE player = "vijay singh"
sql_create_context
CREATE TABLE table_23533 ( "Year" text, "Team" text, "Games" real, "Mins" text, "FG%" text, "3P%" text, "FT%" text, "Rebounds" text, "Assists" text, "Steals" text, "Blocks" text, "Points" text ) -- Using valid SQLite, answer the following questions for the tables provid...
SELECT MIN("Games") FROM table_23533 WHERE "Mins" = '385:33'
wikisql
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.admission_location = "CLINIC REFERRAL/PREMATURE" AND diagnoses.short_title = "Hy kid NOS w cr kid I-IV"
mimicsql_data
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), ...
SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY SUM(DEPARTMENT_ID) DESC
nvbench
CREATE TABLE table_52294 ( "Country" text, "2005 Capacity" text, "2006 Capacity" text, "2007 Capacity" text, "2008 Capacity" text, "2009 Capacity" text, "2010 Capacity" text, "2011 Capacity" text, "2012 Capacity" text ) -- Using valid SQLite, answer the following questions for the ...
SELECT "Country" FROM table_52294 WHERE "2009 Capacity" = '1228 mw'
wikisql
CREATE TABLE swimmer ( nationality VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many different countries are all the swimmers from?
SELECT COUNT(DISTINCT nationality) FROM swimmer
sql_create_context
CREATE TABLE Ship ( Ship_ID int, Name text, Type text, Built_Year real, Class text, Flag text ) CREATE TABLE captain ( Captain_ID int, Name text, Ship_ID int, age text, Class text, Rank text ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT Flag, COUNT(*) FROM Ship GROUP BY Flag ORDER BY COUNT(*) DESC
nvbench
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 MIN(demographic.days_stay) FROM demographic WHERE demographic.age >= "50"
mimicsql_data
CREATE TABLE table_28298471_14 ( team_classification VARCHAR, winner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- when hayden roulston is the winner what is the team classification?
SELECT team_classification FROM table_28298471_14 WHERE winner = "Hayden Roulston"
sql_create_context
CREATE TABLE table_204_211 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many medals overall did puerto rico win ?
SELECT "total" FROM table_204_211 WHERE "nation" = 'puerto rico'
squall
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 demographic ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Medicaid" AND demographic.diagnosis = "VENTRICULAR TACHYCARDIA"
mimicsql_data
CREATE TABLE table_71118 ( "Country" text, "Film title used in nomination" text, "Language" text, "Original title" text, "Director" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the language of the film directed by Hans Kristensen?
SELECT "Language" FROM table_71118 WHERE "Director" = 'hans kristensen'
wikisql
CREATE TABLE table_name_99 ( payload__kg_ VARCHAR, in_service VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the payload that has an In service for 2011
SELECT payload__kg_ FROM table_name_99 WHERE in_service = "2011"
sql_create_context
CREATE TABLE table_46619 ( "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. -- Who is the home team when Preston North End is the away team?
SELECT "Home team" FROM table_46619 WHERE "Away team" = 'preston north end'
wikisql
CREATE TABLE table_44565 ( "Coach" text, "Years" text, "Win-Loss" text, "Win %" text, "Conference Titles" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Win-Loss, when Win % is .456?
SELECT "Win-Loss" FROM table_44565 WHERE "Win %" = '.456'
wikisql
CREATE TABLE table_name_21 ( country VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the country with a 76-68=144 score?
SELECT country FROM table_name_21 WHERE score = 76 - 68 = 144
sql_create_context
CREATE TABLE table_7011 ( "Location" text, "Aircraft" text, "Tail number" text, "Aircraft damage" text, "Fatalities" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the number of fatalities for the Viscount 700?
SELECT "Fatalities" FROM table_7011 WHERE "Aircraft" = 'viscount 700'
wikisql
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 demographic ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.drug_type = "MAIN" AND lab.label = "Sodium, Urine"
mimicsql_data
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 t1.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication WHERE STRFTIME('%y', medication.drugstarttime) = '2102' GROUP BY medication.drugname) AS t1 WHERE t1.c1 <= 4
eicu
CREATE TABLE table_3911 ( "#" real, "Date" text, "Opponent" text, "Site/Stadium" text, "Score" text, "Win" text, "Loss" text, "Save" text, "Attendance" real, "Overall Record" text, "Pac-10 Record" text ) -- Using valid SQLite, answer the following questions for the tables p...
SELECT MIN("Attendance") FROM table_3911 WHERE "Win" = 'G. Claypool (4-1)'
wikisql
CREATE TABLE table_29728 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name t...
SELECT MIN("Game") FROM table_29728 WHERE "Score" = 'L 109–116 (OT)'
wikisql
CREATE TABLE table_49743 ( "Game" real, "January" real, "Opponent" text, "Score" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of the games before January 19 with a 27-6-6 record?
SELECT SUM("Game") FROM table_49743 WHERE "January" < '19' AND "Record" = '27-6-6'
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 procedures ( ...
SELECT MAX(demographic.days_stay) FROM demographic WHERE demographic.dob_year > "2053"
mimicsql_data
CREATE TABLE table_1798 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Results" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the results of those elections for which Marcy Kaptur is the in...
SELECT "Results" FROM table_1798 WHERE "Incumbent" = 'Marcy Kaptur'
wikisql
CREATE TABLE table_60030 ( "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. -- What is Score, when Tie No is '30'?
SELECT "Score" FROM table_60030 WHERE "Tie no" = '30'
wikisql
CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int )...
SELECT DISTINCT COURSE_1.department, COURSE_1.name, COURSE_1.number FROM course AS COURSE_0 INNER JOIN course_prerequisite ON COURSE_0.course_id = course_prerequisite.course_id INNER JOIN course AS COURSE_1 ON COURSE_1.course_id = course_prerequisite.pre_course_id WHERE COURSE_0.department = 'BIOPHYS' AND COURSE_0.numb...
advising
CREATE TABLE table_203_533 ( id number, "season" number, "level" text, "division" text, "section" text, "position" text, "movements" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the difference in position from the year 2007 and 200...
SELECT ABS((SELECT "position" FROM table_203_533 WHERE "season" = 2007) - (SELECT "position" FROM table_203_533 WHERE "season" = 2008))
squall
CREATE TABLE table_25421463_1 ( races INTEGER, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many races were there when Sigachev had 38 points?
SELECT MIN(races) FROM table_25421463_1 WHERE points = "38"
sql_create_context
CREATE TABLE table_name_56 ( format VARCHAR, calls VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the format for calls of wrko
SELECT format FROM table_name_56 WHERE calls = "wrko"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH te...
SELECT * FROM hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.mzjzjlb...
css
CREATE TABLE table_75646 ( "Game" real, "January" real, "Opponent" text, "Score" text, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Points have a Score of 4 1, and a Game smaller than 39?
SELECT SUM("Points") FROM table_75646 WHERE "Score" = '4–1' AND "Game" < '39'
wikisql
CREATE TABLE table_71904 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score of the game when the record was 18-20?
SELECT "Score" FROM table_71904 WHERE "Record" = '18-20'
wikisql
CREATE TABLE table_28247 ( "Stage" real, "Winner" text, "General Classification" text, "Points Classification" text, "Young Rider Classification" text, "Teams Classification" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of s...
SELECT COUNT("Stage") FROM table_28247 WHERE "Teams Classification" = 'Cervélo TestTeam'
wikisql
CREATE TABLE table_name_15 ( draw INTEGER, points VARCHAR, played VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the draw that's played less than 36 and has 42 points?
SELECT AVG(draw) FROM table_name_15 WHERE points = 42 AND played < 36
sql_create_context
CREATE TABLE roles ( role_code text, role_name text, role_description text ) CREATE TABLE documents_to_be_destroyed ( document_id number, destruction_authorised_by_employee_id number, destroyed_by_employee_id number, planned_destruction_date time, actual_destruction_date time, other...
SELECT location_code, COUNT(*) FROM document_locations GROUP BY location_code
spider
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE patients ( row_...
SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19894) AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m', prescriptions.startdate) = '06'
mimic_iii
CREATE TABLE table_71639 ( "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. -- What was the position in 2006?
SELECT "Pos." FROM table_71639 WHERE "Year" = '2006'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtim...
SELECT t1.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication WHERE STRFTIME('%y', medication.drugstarttime) <= '2101' GROUP BY medication.drugname) AS t1 WHERE t1.c1 <= 5
eicu
CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT ) CREATE TABLE trip ( id INTEGER, duration INTEGER, start_date TEXT, start_station_name TEXT, start_station_id INTEGER, end_date TEXT, e...
SELECT start_station_name, start_station_id FROM trip ORDER BY start_station_name DESC
nvbench
CREATE TABLE table_31065 ( "Week of" text, "Tournament" text, "Champion" text, "Runner-up" text, "Semifinalists" text, "Quarterfinalists" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which tournament was runner-up paul annacone eric korita?
SELECT "Tournament" FROM table_31065 WHERE "Runner-up" = 'Paul Annacone Eric Korita'
wikisql
CREATE TABLE table_22010 ( "Name" text, "Volume" text, "Engine" text, "Fuel" text, "Output" text, "Torque" text, "Engine ID code(s)" text, "0\u2013100km/h,s" text, "Top speed" text, "CO 2" text, "Years" text ) -- Using valid SQLite, answer the following questions for the ta...
SELECT "Top speed" FROM table_22010 WHERE "0\u2013100km/h,s" = '12.7'
wikisql
CREATE TABLE table_29694 ( "Team" text, "Chairman" text, "Head Coach" text, "Captain" text, "Kitmaker" text, "Shirt sponsor" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many kitmaker correspond to team ittihad kalba?
SELECT COUNT("Kitmaker") FROM table_29694 WHERE "Team" = 'Ittihad Kalba'
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ...
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.short_title = "Opn mitral valvuloplasty"
mimicsql_data
CREATE TABLE table_24999 ( "Province, Community" text, "Contestant" text, "Age" real, "Height" text, "Hometown" text, "Geographical Regions" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which contestant hails from Dajab n?
SELECT "Contestant" FROM table_24999 WHERE "Province, Community" = 'Dajabón'
wikisql
CREATE TABLE table_6535 ( "Year" real, "Location" text, "Gold" text, "Silver" text, "Bronze" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who one bronze in the event where Choi Jun-Sang won gold, and Suh Jung-Kyun won silver?
SELECT "Bronze" FROM table_6535 WHERE "Gold" = 'choi jun-sang' AND "Silver" = 'suh jung-kyun'
wikisql
CREATE TABLE election ( election_id number, counties_represented text, district number, delegate text, party number, first_elected number, committee text ) CREATE TABLE party ( party_id number, year number, party text, governor text, lieutenant_governor text, comptro...
SELECT T2.party FROM election AS T1 JOIN party AS T2 ON T1.party = T2.party_id WHERE T1.committee = "Appropriations" INTERSECT SELECT T2.party FROM election AS T1 JOIN party AS T2 ON T1.party = T2.party_id WHERE T1.committee = "Economic Matters"
spider
CREATE TABLE course ( cid text, cname text, credits number, instructor number, days text, hours text, dno number ) CREATE TABLE member_of ( facid number, dno number, appt_type text ) CREATE TABLE minor_in ( stuid number, dno number ) CREATE TABLE gradeconversion ( ...
SELECT COUNT(DISTINCT stuid) FROM enrolled_in WHERE grade = "B"
spider
CREATE TABLE table_8957 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Ground" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Crowd for Away team with a s...
SELECT AVG("Crowd") FROM table_8957 WHERE "Away team score" = '17.14 (116)'
wikisql
CREATE TABLE table_73256 ( "Name" text, "Nationality" text, "from" real, "to" text, "League Apps" real, "League Goals" real, "Finals Apps" real, "Finals Goals" real, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the ...
SELECT "Position" FROM table_73256 WHERE "Name" = 'van den Brink, Bas'
wikisql
CREATE TABLE table_44490 ( "Archbishop" text, "Born" text, "Ordained Priest" text, "Ordained Bishop" text, "Appointed Archbishop" text, "Vacated throne" text, "Died" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which archbishop vacated the...
SELECT "Archbishop" FROM table_44490 WHERE "Vacated throne" = 'may 17, 1907'
wikisql
CREATE TABLE table_13477468_3 ( written_by VARCHAR, us_viewers__millions_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who wrote the episode that received 1.83 million U.S. viewers?
SELECT written_by FROM table_13477468_3 WHERE us_viewers__millions_ = "1.83"
sql_create_context
CREATE TABLE table_27437601_2 ( no_in_season VARCHAR, directed_by VARCHAR, no_in_series VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the season above 241.0 that was handled by brad tanenbaum.
SELECT no_in_season FROM table_27437601_2 WHERE directed_by = "Brad Tanenbaum" AND no_in_series > 241.0
sql_create_context
CREATE TABLE courses ( course_name VARCHAR, course_id VARCHAR ) CREATE TABLE student_course_registrations ( student_id VARCHAR, course_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the ids of all students for courses and what are the na...
SELECT T1.student_id, T2.course_name FROM student_course_registrations AS T1 JOIN courses AS T2 ON T1.course_id = T2.course_id
sql_create_context
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT jyjgzbb.JCFF FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_in...
css
CREATE TABLE table_name_65 ( episode__number INTEGER, location VARCHAR, _number_in_season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average episode # located in Tanzania and whose # in season is larger than 5?
SELECT AVG(episode__number) FROM table_name_65 WHERE location = "tanzania" AND _number_in_season > 5
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 procedures.long_title FROM procedures WHERE procedures.subject_id = "6983"
mimicsql_data
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_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, ...
SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc21_t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_AGE <= 20)
css
CREATE TABLE table_1498 ( "Finish" text, "Race" text, "Distance" text, "Jockey" text, "Time" text, "Victory Margin (in lengths)" text, "Runner up" text, "Track" text, "Surface" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided abo...
SELECT "Distance" FROM table_1498 WHERE "Jockey" = 'Kent Desormeaux' AND "Date" = '6/7/08'
wikisql
CREATE TABLE table_27922491_11 ( average VARCHAR, runs VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average for the player with 313 runs?
SELECT average FROM table_27922491_11 WHERE runs = 313
sql_create_context
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE hz_info ( KH text, KLX number...
SELECT mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '奚星光' AND NOT mzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2006-11-17')
css
CREATE TABLE table_name_52 ( tries_against VARCHAR, club VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many tries were there for club cwmtwrch rfc?
SELECT tries_against FROM table_name_52 WHERE club = "cwmtwrch rfc"
sql_create_context
CREATE TABLE table_204_667 ( id number, "year" number, "film title" text, "genre" text, "cast" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the total number of films that are love stories ?
SELECT COUNT(*) FROM table_204_667 WHERE "genre" = 'love story'
squall
CREATE TABLE table_70724 ( "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 highest rank a country with less than 3 gold, more than 2 silver, and less than ...
SELECT MAX("Rank") FROM table_70724 WHERE "Gold" < '3' AND "Silver" > '2' AND "Total" < '5'
wikisql
CREATE TABLE competition ( Competition_ID int, Year real, Competition_type text, Country text ) CREATE TABLE club ( Club_ID int, name text, Region text, Start_year text ) CREATE TABLE player ( Player_ID int, name text, Position text, Club_ID int, Apps real, Trie...
SELECT Competition_type, COUNT(*) FROM competition GROUP BY Competition_type ORDER BY Competition_type DESC
nvbench
CREATE TABLE table_name_76 ( season VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Season, when Opponent is source: . last updated: 28 june 2007.?
SELECT season FROM table_name_76 WHERE opponent = "source: . last updated: 28 june 2007."
sql_create_context
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 Title, MAX(T1.Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID GROUP BY Title ORDER BY MAX(T1.Price) DESC
nvbench
CREATE TABLE table_name_48 ( line_judge VARCHAR, referee VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the line judge at the game where Scott Green was referee?
SELECT line_judge FROM table_name_48 WHERE referee = "scott green"
sql_create_context
CREATE TABLE table_16388506_1 ( crowd INTEGER, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the largest crowd when essendon is the home team?
SELECT MAX(crowd) FROM table_16388506_1 WHERE home_team = "Essendon"
sql_create_context
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE Comments ( Id number, PostId number, Score number,...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%detroit%mi%' ORDER BY Reputation DESC LIMIT 200
sede
CREATE TABLE table_26250155_1 ( week__number VARCHAR, original_artist VARCHAR, theme VARCHAR, order__number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the number of weeks that had a Billboard Hot 100 Hits theme, an order number of 3, and...
SELECT COUNT(week__number) FROM table_26250155_1 WHERE theme = "Billboard Hot 100 Hits" AND order__number = "3" AND original_artist = "Sixpence None the Richer"
sql_create_context
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 instructor.name 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 INNER JOIN offering_instructor ON offering_instr...
advising
CREATE TABLE table_76620 ( "Fin. Pos" text, "Car No." text, "Driver" text, "Team" text, "Laps" text, "Time/Retired" text, "Grid" text, "Laps Led" text, "Points" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many laps does driver...
SELECT "Laps" FROM table_76620 WHERE "Driver" = 'dario franchitti'
wikisql
CREATE TABLE table_262560_1 ( institution VARCHAR, founded VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the place that was founded in 1920
SELECT institution FROM table_262560_1 WHERE founded = 1920
sql_create_context
CREATE TABLE table_57962 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalogue" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What format is the Catalogue 9362486152 from the region of Australia in?
SELECT "Format" FROM table_57962 WHERE "Catalogue" = '9362486152' AND "Region" = 'australia'
wikisql
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, Crea...
SELECT SUM(Score) + 1 FROM (SELECT COUNT(*) * p.PostTypeId * 5 AS score FROM Posts AS p INNER JOIN Votes AS v ON v.PostId = p.Id INNER JOIN Posts AS p2 ON p2.OwnerUserId = p.OwnerUserId WHERE p2.Id = '##postid?8092417##' AND v.VoteTypeId = 2 AND p.CreationDate < p2.CreationDate AND v.CreationDate < p2.CreationDate AND ...
sede
CREATE TABLE table_39330 ( "Call sign" text, "Frequency MHz" real, "City of license" text, "ERP W" real, "FCC info" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the frequency MHz in tremonton, utah with a ERP W larger than 30?
SELECT "Frequency MHz" FROM table_39330 WHERE "ERP W" > '30' AND "City of license" = 'tremonton, utah'
wikisql
CREATE TABLE table_name_20 ( week_12_nov_19 VARCHAR, week_13_nov_26 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What happened in week 12 when week 13 resulted in Tennessee (9-1)?
SELECT week_12_nov_19 FROM table_name_20 WHERE week_13_nov_26 = "tennessee (9-1)"
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE p...
SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'neck tumor - laryngeal ca') AS t1 GROUP BY t1.uniquepid HAVING M...
eicu
CREATE TABLE table_2110959_1 ( points VARCHAR, season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were the points in the 1958-59 season?
SELECT points FROM table_2110959_1 WHERE season = "1958-59"
sql_create_context
CREATE TABLE table_name_75 ( competition VARCHAR, result VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Competition had a Result of 3-0 and VEnue of Suwon?
SELECT competition FROM table_name_75 WHERE result = "3-0" AND venue = "suwon"
sql_create_context
CREATE TABLE table_38238 ( "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 attendance at the game with a record of 4-5?
SELECT "Attendance" FROM table_38238 WHERE "Record" = '4-5'
wikisql
CREATE TABLE table_203_862 ( id number, "draw" number, "artist" text, "song" text, "points" number, "place" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what artist received the least amount of points in the competition ?
SELECT "artist" FROM table_203_862 ORDER BY "points" LIMIT 1
squall