instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE Customers ( customer_id INTEGER, customer_address_id INTEGER, customer_status_code VARCHAR(15), date_became_customer DATETIME, date_of_birth DATETIME, first_name VARCHAR(80), last_name VARCHAR(80), amount_outstanding DOUBLE, email_address VARCHAR(250), phone_number V...
SELECT date_of_birth, COUNT(date_of_birth) FROM Customers WHERE customer_status_code = 'Good Customer'
nvbench
CREATE TABLE table_79190 ( "Year" real, "Awards show" text, "Nominees" text, "Nominated Work" text, "Results" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Nominated Work won in 2000?
SELECT "Nominated Work" FROM table_79190 WHERE "Year" = '2000' AND "Results" = 'won'
wikisql
CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH text, MZJZLSH text, KH text, KLX number, HZXM text, WDBZ number, RYDJSJ time, RYTJDM number, RYTJMC text, JZKSDM text, JZKSMC text, RZBQDM text, RZBQMC text, RYCWH text, CYKSDM text, CYKSMC text, CYBQDM tex...
SELECT person_info.XM FROM person_info JOIN hz_info JOIN zyjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND zyjzjlb.YLJGDM = jybgb.YLJGDM_ZYJZJLB AND zyjzjlb.JZLSH = jybgb.JZLSH_ZYJZJLB WHERE jybgb.BGDH = '33959685545'
css
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), ...
SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY HIRE_DATE
nvbench
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 departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), ...
SELECT SALARY, COMMISSION_PCT FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40
nvbench
CREATE TABLE table_15146 ( "Kick Off" text, "Opponents" text, "H / A" text, "Result" text, "Referee" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the result of the match with Lugo as the oponent with a H/A of h?
SELECT "Result" FROM table_15146 WHERE "Opponents" = 'lugo' AND "H / A" = 'h'
wikisql
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE VoteTypes ( Id number, Name text...
SELECT * FROM Posts WHERE OwnerUserId = 113
sede
CREATE TABLE table_name_66 ( points_difference VARCHAR, points VARCHAR, lost VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the points difference associated with more than 3 points and more than 0 losses?
SELECT points_difference FROM table_name_66 WHERE points > 3 AND lost > 0
sql_create_context
CREATE TABLE table_41198 ( "Year" real, "Competition" text, "Club" text, "Nation" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What shows for nation when the Competition is preseason, Year less than 2011, and a Club of chivas de gua...
SELECT "Nation" FROM table_41198 WHERE "Competition" = 'preseason' AND "Year" < '2011' AND "Club" = 'chivas de guadalajara'
wikisql
CREATE TABLE Reviewer ( rID int, name text ) CREATE TABLE Movie ( mID int, title text, year int, director text ) CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show ...
SELECT title, stars FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID ORDER BY title
nvbench
CREATE TABLE table_14881 ( "Date" text, "Tournament" text, "Winning score" text, "To par" text, "Margin of victory" text, "Runner(s)-up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the Winning is 71-71-70-69=281, what is the To par?
SELECT "To par" FROM table_14881 WHERE "Winning score" = '71-71-70-69=281'
wikisql
CREATE TABLE table_name_10 ( date VARCHAR, undecided VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which date had the undecided percentage at 42%?
SELECT date FROM table_name_10 WHERE undecided = "42%"
sql_create_context
CREATE TABLE table_80386 ( "Team" text, "Manager" text, "Captain" text, "Kit manufacturer" text, "Shirt sponsor" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which manager has sheffield wednesday as the team?
SELECT "Manager" FROM table_80386 WHERE "Team" = 'sheffield wednesday'
wikisql
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, sh...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 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 ...
mimic_iii
CREATE TABLE table_name_62 ( catalog VARCHAR, year VARCHAR, issued_title VARCHAR, label VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the catalog issued with the title of 1958 Miles on the Sony label at a year prior to 2006?
SELECT catalog FROM table_name_62 WHERE issued_title = "1958 miles" AND label = "sony" AND year < 2006
sql_create_context
CREATE TABLE table_204_311 ( 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. -- which nations had a gold medal but no silver medals ?
SELECT "nation" FROM table_204_311 WHERE "gold" = 1 AND "silver" = 0
squall
CREATE TABLE business ( bid int, business_id varchar, name varchar, full_address varchar, city varchar, latitude varchar, longitude varchar, review_count bigint, is_open tinyint, rating float, state varchar ) CREATE TABLE checkin ( cid int, business_id varchar, c...
SELECT review.text FROM business, review WHERE business.rating = 2.5 AND review.business_id = business.business_id
yelp
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 t1.startdate FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'iso-osmotic dextrose' AND admissions.subject_id = 82132 AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_...
mimic_iii
CREATE TABLE table_12175755_1 ( order__number VARCHAR, original_artist VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the order number for songs by the original artist Luis Fonsi?
SELECT order__number FROM table_12175755_1 WHERE original_artist = "Luis Fonsi"
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 zyjzjlb ( CYBQDM text, CYBQMC...
SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE wdmzjzjlb.JZZDBM = 'C89.828' AND jyjgzbb.JCZBMC = '...
css
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT AVG(t_kc24.PER_ACC_PAY) FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.MED_SER_ORG_NO = '2313711' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2002-11-01' AND '2015-04-30'
css
CREATE TABLE table_20754 ( "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. -- Which location had an attendance of 22537?
SELECT "Ground" FROM table_20754 WHERE "Crowd" = '22537'
wikisql
CREATE TABLE table_204_269 ( id number, "week" number, "room" text, "winning couple" text, "2nd couple" text, "3rd couple" text, "chumps" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many weeks were chantelle and steve the 3rd couple ?...
SELECT COUNT("week") FROM table_204_269 WHERE "3rd couple" = 'chantelle and steve'
squall
CREATE TABLE table_3497 ( "Institution" text, "Location" text, "Founded" real, "Type" text, "Enrollment" text, "Nickname" text, "Joined" text, "Left" text, "Football Conference" text, "Primary Conference" text ) -- Using valid SQLite, answer the following questions for the tabl...
SELECT "Institution" FROM table_3497 WHERE "Primary Conference" = 'Merged into the University of Massachusetts Boston'
wikisql
CREATE TABLE table_name_86 ( gold VARCHAR, total VARCHAR, bronze VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number for gold where there were total 1, and bronze 1?
SELECT COUNT(gold) FROM table_name_86 WHERE total = 1 AND bronze = 1
sql_create_context
CREATE TABLE table_1341598_11 ( candidates VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who are shown as candidates when George Darden is the incumbent?
SELECT candidates FROM table_1341598_11 WHERE incumbent = "George Darden"
sql_create_context
CREATE TABLE table_24255 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided a...
SELECT "Title" FROM table_24255 WHERE "Production code" = '62015-08-162'
wikisql
CREATE TABLE table_name_52 ( third VARCHAR, events VARCHAR, skip VARCHAR, second VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- IN EVENTS 1995 STOH, WHO WAS THE THIRD WITH SKIP SANDRA PETERSON AND SECOND JOAN MCCUSKER?
SELECT third FROM table_name_52 WHERE skip = "sandra peterson" AND second = "joan mccusker" AND events = "1995 stoh"
sql_create_context
CREATE TABLE table_name_24 ( player VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player has rank 1?
SELECT player FROM table_name_24 WHERE rank = 1
sql_create_context
CREATE TABLE table_22834834_2 ( opponent_in_the_final VARCHAR, championship VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the opponent in the final when frankfurt is championship and the year is less than 1993.0?
SELECT opponent_in_the_final FROM table_22834834_2 WHERE championship = "Frankfurt" AND year < 1993.0
sql_create_context
CREATE TABLE table_46582 ( "Builder" text, "Works no." real, "Built" real, "Wheels" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which builder has a Built smaller than 1880?
SELECT "Builder" FROM table_46582 WHERE "Built" < '1880'
wikisql
CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
SELECT SQKS, SQKSMC FROM jybgb WHERE BGDH = '89851265565'
css
CREATE TABLE table_204_351 ( id number, "week of" text, "tournament" text, "champions" text, "runners-up" text, "semifinalists" text, "quarterfinalists" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the first week of the tournament ...
SELECT "week of" FROM table_204_351 ORDER BY "week of" LIMIT 1
squall
CREATE TABLE table_75736 ( "Rank" real, "Group" text, "Athlete" text, "Nationality" text, "Result" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which athlete's rank is more than 15 when the result is less than 7.68, the group is b, and the nationa...
SELECT "Athlete" FROM table_75736 WHERE "Rank" > '15' AND "Result" < '7.68' AND "Group" = 'b' AND "Nationality" = 'great britain'
wikisql
CREATE TABLE table_7390 ( "Player" text, "Club" text, "League" real, "FA Cup" real, "FA Trophy" real, "League Cup" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total of player Martin Randall, who has more than 1 L...
SELECT "Total" FROM table_7390 WHERE "League Cup" > '1' AND "League" < '18' AND "Player" = 'martin randall'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2157" AND lab.itemid = "50820"
mimicsql_data
CREATE TABLE trip ( id INTEGER, duration INTEGER, start_date TEXT, start_station_name TEXT, start_station_id INTEGER, end_date TEXT, end_station_name TEXT, end_station_id INTEGER, bike_id INTEGER, subscription_type TEXT, zip_code INTEGER ) CREATE TABLE station ( id INTEG...
SELECT mean_temperature_f, mean_humidity FROM weather ORDER BY max_gust_speed_mph DESC LIMIT 3
nvbench
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 prescriptions ( subject_id text, hadm_id...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "WHITE" AND diagnoses.long_title = "Mechanical complication due to other implant and internal device, not elsewhere classified"
mimicsql_data
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_items ( row_id num...
SELECT admissions.subject_id FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'hydronephrosis') AND STRFTIME('%y', diagnoses_icd.charttime) = '2105')
mimic_iii
CREATE TABLE table_4161 ( "Province" text, "Number of Dairy Farms" real, "Number of Dairy Cows" real, "Production (hectolitres)" real, "Dairy Cows per Farm" real, "Production (hectolitres) per Farm" real ) -- Using valid SQLite, answer the following questions for the tables provided above. --...
SELECT "Production (hectolitres)" FROM table_4161 WHERE "Province" = 'New Brunswick'
wikisql
CREATE TABLE table_12454156_1 ( prize_money VARCHAR, runner_up VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the total prize money where John Tabatabai was the runner-up?
SELECT prize_money FROM table_12454156_1 WHERE runner_up = "John Tabatabai"
sql_create_context
CREATE TABLE Projects ( Code Char(4), Name Char(50), Hours int ) CREATE TABLE AssignedTo ( Scientist int, Project char(4) ) CREATE TABLE Scientists ( SSN int, Name Char(30) ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the name of the pro...
SELECT T2.Name, COUNT(T2.Name) FROM AssignedTo AS T1 JOIN Projects AS T2 ON T1.Project = T2.Code JOIN Scientists AS T3 ON T1.Scientist = T3.SSN WHERE T3.Name LIKE '%Smith%' GROUP BY T2.Name ORDER BY COUNT(T2.Name)
nvbench
CREATE TABLE table_name_1 ( gold INTEGER, bronze VARCHAR, total VARCHAR, nation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The United States, with a total medal count of less than 171, and a bronze medal count less than 9, has how many gold medal...
SELECT MAX(gold) FROM table_name_1 WHERE total < 171 AND nation = "united states" AND bronze < 9
sql_create_context
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 d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE chart...
SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19473) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.item...
mimic_iii
CREATE TABLE table_name_4 ( venue VARCHAR, position VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the venue for 2004 and position of 25th
SELECT venue FROM table_name_4 WHERE position = "25th" AND year = 2004
sql_create_context
CREATE TABLE table_31338 ( "Constituency No." real, "Vidhan Sabha Constituency" text, "Reservation for SC/ST" text, "District" text, "Lok Sabha" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What district has 213 constituents?
SELECT COUNT("District") FROM table_31338 WHERE "Constituency No." = '213'
wikisql
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 jybgb.JYJSGH, jybgb.JYJSQM FROM jybgb WHERE jybgb.BGDH = '78865792393'
css
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 zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.person_info_XM = '水天心' AND hz_info.YLJGDM = '5751240' AND zyjzjlb.CYKSMC LIKE '%计生%'
css
CREATE TABLE table_name_13 ( player VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What player has 71-72-66=209 as the score?
SELECT player FROM table_name_13 WHERE score = 71 - 72 - 66 = 209
sql_create_context
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, ...
SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28343) AND prescriptions.drug = 'tramadol' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME(...
mimic_iii
CREATE TABLE table_name_40 ( opinion_research_centre__opc_ VARCHAR, party VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Opinion Research Centre (OPC), when Party is Conservative?
SELECT opinion_research_centre__opc_ FROM table_name_40 WHERE party = "conservative"
sql_create_context
CREATE TABLE table_name_7 ( position VARCHAR, number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which position is number 16?
SELECT position FROM table_name_7 WHERE number = 16
sql_create_context
CREATE TABLE table_19549 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many positions did 1972 NHL Draft pick Rene Lambert play...
SELECT COUNT("Position") FROM table_19549 WHERE "Player" = 'Rene Lambert'
wikisql
CREATE TABLE table_65422 ( "Rank" real, "Rowers" text, "Country" text, "Time" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Hungary's highest Rank?
SELECT MAX("Rank") FROM table_65422 WHERE "Country" = 'hungary'
wikisql
CREATE TABLE table_2689 ( "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 th...
SELECT "High points" FROM table_2689 WHERE "Record" = '31-27'
wikisql
CREATE TABLE table_1771753_3 ( average_speed__mph_ VARCHAR, driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When tony kanaan is the driver what is the average speed miles per hour?
SELECT average_speed__mph_ FROM table_1771753_3 WHERE driver = "Tony Kanaan"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "PNEUMONIA;HUMAN IMMUNODEFIENCY VIRUS;RULE OUT TUBERCULOSIS" AND demographic.dod_year <= "2173.0"
mimicsql_data
CREATE TABLE table_14809 ( "Office" text, "Representative" text, "Party" text, "Residence" text, "First Elected" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Office has a Representative of scott pelath?
SELECT "Office" FROM table_14809 WHERE "Representative" = 'scott pelath'
wikisql
CREATE TABLE table_34342 ( "Score" text, "Opposition" text, "Venue" text, "City" text, "Year" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest year that has chester-le-street as the city, with 345 runs as the score?
SELECT MIN("Year") FROM table_34342 WHERE "City" = 'chester-le-street' AND "Score" = '345 runs'
wikisql
CREATE TABLE table_name_77 ( drawn INTEGER, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Drawn has a Team of internacional-sp?
SELECT SUM(drawn) FROM table_name_77 WHERE team = "internacional-sp"
sql_create_context
CREATE TABLE table_name_65 ( attendance INTEGER, date VARCHAR, week VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Attendance has a Date of december 22, 1985, and a Week smaller than 16?
SELECT SUM(attendance) FROM table_name_65 WHERE date = "december 22, 1985" AND week < 16
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE medication ( med...
SELECT STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', patient.hospitaladmittime) FROM patient WHERE patient.uniquepid = '002-75209' AND NOT patient.hospitaladmittime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1
eicu
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 course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.credits = 1 AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Fall' AND seme...
advising
CREATE TABLE table_name_28 ( theme VARCHAR, paper_type VARCHAR, date_of_issue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Theme with a Paper Type of tullis russell coatings, and a Date with Issue of 1 october 2008?
SELECT theme FROM table_name_28 WHERE paper_type = "tullis russell coatings" AND date_of_issue = "1 october 2008"
sql_create_context
CREATE TABLE table_63878 ( "Monday" text, "Tuesday" text, "Wednesday" text, "Thursday" text, "Friday" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is shown on Tuesday when Monday is showing Fox Sports Primetime?
SELECT "Tuesday" FROM table_63878 WHERE "Monday" = 'fox sports primetime'
wikisql
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,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 varc...
SELECT HIRE_DATE, SALARY FROM employees WHERE HIRE_DATE < '2002-06-21'
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "68" AND prescriptions.drug = "Vancomycin"
mimicsql_data
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 text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT zyjybgb.BGRQ FROM zyjybgb WHERE zyjybgb.BGDH = '63658977370' UNION SELECT mzjybgb.BGRQ FROM mzjybgb WHERE mzjybgb.BGDH = '63658977370'
css
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 prescriptions ( row_id number, subject_id number, h...
SELECT (SELECT COUNT(DISTINCT t1.subject_id) 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_diagnoses.short_title = 'foreign bd...
mimic_iii
CREATE TABLE table_58248 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Date has a record of 3-5?
SELECT "Date" FROM table_58248 WHERE "Record" = '3-5'
wikisql
CREATE TABLE table_42545 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Outcome when a la b y kak ay was the opponent in the fina...
SELECT "Outcome" FROM table_42545 WHERE "Opponent in the final" = 'çağla büyükakçay'
wikisql
CREATE TABLE table_2469 ( "Week #" text, "Theme" text, "Song choice" text, "Original artist" text, "Order #" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which order #1 has a result of bottom 2
SELECT "Order #" FROM table_2469 WHERE "Result" = 'Bottom 2'
wikisql
CREATE TABLE table_28861 ( "Year" real, "Competition" text, "Location" text, "Apparatus" text, "Rank-Final" real, "Score-Final" text, "Rank-Qualifying" real, "Score-Qualifying" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the ...
SELECT MAX("Rank-Final") FROM table_28861 WHERE "Apparatus" = 'Floor Exercise'
wikisql
CREATE TABLE statements ( statement_id number, statement_details text ) CREATE TABLE documents ( document_id number, document_type_code text, project_id number, document_date time, document_name text, document_description text, other_details text ) CREATE TABLE accounts ( accou...
SELECT COUNT(*) FROM documents
spider
CREATE TABLE table_67336 ( "Club" text, "Australian Marquee" text, "International Marquee" text, "Junior Marquee player" text, "Captain" text, "Vice-Captain" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Junior Marquee team is Harry Kewell...
SELECT "Junior Marquee player" FROM table_67336 WHERE "Captain" = 'harry kewell'
wikisql
CREATE TABLE table_name_62 ( year INTEGER, category VARCHAR, beer_name VARCHAR, competition VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year did maggs magnificent mild bear win overall at the camra reading branch beer festival?
SELECT MAX(year) FROM table_name_62 WHERE beer_name = "maggs magnificent mild" AND competition = "camra reading branch beer festival" AND category = "overall"
sql_create_context
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, ...
SELECT SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 6170) AND prescriptions.drug = 'syringe (neonatal) *d5w*' AND STRFTIME('%y-%m', prescriptions.startdate) >= '2105-12'
mimic_iii
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE time_interval ( period text, begin_time int...
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, state WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BURBANK' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = ...
atis
CREATE TABLE table_12843 ( "Election" text, "1st Member" text, "1st Party" text, "2nd Member" text, "2nd Party" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Election has a 1st Member of james parker?
SELECT "Election" FROM table_12843 WHERE "1st Member" = 'james parker'
wikisql
CREATE TABLE table_49777 ( "Date" text, "Venue" text, "Opponents" text, "Score" text, "Comp" text, "Djurg\u00e5rden scorers" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who were the Djurgarden scorers when the venue was...
SELECT "Djurg\u00e5rden scorers" FROM table_49777 WHERE "Venue" = 'idrottsparken'
wikisql
CREATE TABLE table_name_9 ( points INTEGER, touchdowns VARCHAR, field_goals VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Points have Touchdowns of 1, and a Field goals smaller than 0?
SELECT AVG(points) FROM table_name_9 WHERE touchdowns = 1 AND field_goals < 0
sql_create_context
CREATE TABLE genre ( gid int, genre text ) CREATE TABLE writer ( wid int, gender text, name text, nationality text, birth_city text, birth_year int ) CREATE TABLE keyword ( id int, keyword text ) CREATE TABLE company ( id int, name text, country_code varchar ) CRE...
SELECT genre.genre FROM classification, directed_by, director, genre, movie WHERE director.did = directed_by.did AND director.name = 'Asghar Farhadi' AND genre.gid = classification.gid AND movie.mid = classification.msid AND movie.mid = directed_by.msid
imdb
CREATE TABLE table_name_91 ( studio_host VARCHAR, year VARCHAR, play_by_play VARCHAR, color_commentator_s_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the studio host for glenn ordway and jerry sichting with year of 1993-94
SELECT studio_host FROM table_name_91 WHERE play_by_play = "glenn ordway" AND color_commentator_s_ = "jerry sichting" AND year = "1993-94"
sql_create_context
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate tim...
SELECT Id AS "user_link", Reputation, voteScore, ROUND(CAST(Reputation AS FLOAT) / voteScore, 2) AS ratio FROM (SELECT up.Id, MAX(up.Reputation) AS reputation, SUM(CASE v.VoteTypeId WHEN 1 THEN 15 WHEN 2 THEN CASE WHEN PostTypeId = 1 THEN 5 ELSE 10 END END) AS voteScore FROM (SELECT p.Id AS postId, p.PostTypeId, u.Id, ...
sede
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 ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "55" AND diagnoses.long_title = "Closed fracture of base of skull with subarachnoid, subdural, and extradural hemorrhage, with loss of consciousness of unspecified durat...
mimicsql_data
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 transfers ( row_id number, subject_id number, hadm_...
SELECT COUNT(*) > 0 FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19059)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp [syst...
mimic_iii
CREATE TABLE table_30621 ( "No" real, "Driver" text, "Entrant" text, "Constructor" text, "Chassis" text, "Engine" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the least number for nello pagani
SELECT MIN("No") FROM table_30621 WHERE "Driver" = 'Nello Pagani'
wikisql
CREATE TABLE manufacturers ( revenue INTEGER, headquarter VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the total revenue created by the companies whose headquarter is located at Austin.
SELECT SUM(revenue) FROM manufacturers WHERE headquarter = 'Austin'
sql_create_context
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT CLINIC_ID FROM t_kc24 WHERE MED_CLINIC_ID = '82392960392'
css
CREATE TABLE table_5130 ( "Rank" real, "Name" text, "Headquarters" text, "Primary industry" text, "Market value ( USD million)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is Exxon Mobil, an oil and gas corporation, headquartered?
SELECT "Headquarters" FROM table_5130 WHERE "Primary industry" = 'oil and gas' AND "Name" = 'exxon mobil'
wikisql
CREATE TABLE table_19285 ( "Series" text, "Main presenter" text, "Co-presenter" text, "Comedian" text, "UK co-presenter" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the main presenter of the series Twelve (2012)?
SELECT "Main presenter" FROM table_19285 WHERE "Series" = 'Twelve (2012)'
wikisql
CREATE TABLE table_69570 ( "Arena/Venue" text, "Home Campus" text, "Location" text, "Province/Region" text, "Maximum Seating Capacity" text, "Year Opened" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is the Holy Cross of Davao College ca...
SELECT "Province/Region" FROM table_69570 WHERE "Home Campus" = 'holy cross of davao college'
wikisql
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 WHERE demographic.gender = "F" AND diagnoses.long_title = "35-36 completed weeks of gestation"
mimicsql_data
CREATE TABLE table_name_48 ( votes VARCHAR, rank VARCHAR, candidate VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many votes did 3rd ranking candidate Mary Louise Lorefice receive?
SELECT COUNT(votes) FROM table_name_48 WHERE rank = "3rd" AND candidate = "mary louise lorefice"
sql_create_context
CREATE TABLE table_61073 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score on January 23?
SELECT "Score" FROM table_61073 WHERE "Date" = 'january 23'
wikisql
CREATE TABLE table_11545282_19 ( player VARCHAR, no VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player wears the number 6?
SELECT player FROM table_11545282_19 WHERE no = 6
sql_create_context
CREATE TABLE View_Unit_Status ( apt_id INTEGER, apt_booking_id INTEGER, status_date DATETIME, available_yn BIT ) CREATE TABLE Apartment_Bookings ( apt_booking_id INTEGER, apt_id INTEGER, guest_id INTEGER, booking_status_code CHAR(15), booking_start_date DATETIME, booking_end_dat...
SELECT date_of_birth, COUNT(date_of_birth) FROM Guests WHERE gender_code = "Male" ORDER BY date_of_birth
nvbench
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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "GUILLAIN BARRE SYNDROME" AND demographic.dod_year <= "2138.0"
mimicsql_data
CREATE TABLE table_38764 ( "Entrants" real, "Winner" text, "Prize" text, "Runner-up" text, "Results" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What prize amount was awarded at the event with 453 entrants?
SELECT "Prize" FROM table_38764 WHERE "Entrants" = '453'
wikisql
CREATE TABLE table_57069 ( "Grand Prix" text, "Date" text, "Location" text, "Pole Position" text, "Fastest Lap" text, "Winning Driver" text, "Constructor" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Grand Prix is ...
SELECT "Grand Prix" FROM table_57069 WHERE "Location" = 'jerez'
wikisql