instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_56550 ( "Year" text, "Type" text, "Nos." text, "GSWR Class" real, "GSWR Nos." text, "GSR Class" text, "Inchicore Class" text, "Withdrawn" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is withdrawn with a GSR Clas...
SELECT "Withdrawn" FROM table_56550 WHERE "GSR Class" = '296'
wikisql
CREATE TABLE Movie ( mID int, title text, year int, director text ) CREATE TABLE Reviewer ( rID int, name text ) CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Retur...
SELECT name, AVG(T1.stars) FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID GROUP BY T2.name ORDER BY name
nvbench
CREATE TABLE table_68589 ( "Terminal" text, "Operator" text, "Depth (m)" text, "Berths" real, "Quay cranes" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the operator with berths more than 1 and depth of 12.5-15.5
SELECT "Operator" FROM table_68589 WHERE "Berths" > '1' AND "Depth (m)" = '12.5-15.5'
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 Founder, AVG(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder DESC
nvbench
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE labevents ( row...
SELECT outputevents.charttime FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 65582)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'urin...
mimic_iii
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '013-33898' AND patient.wardid = 559 AND patient.hospitaldischargetime IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1
eicu
CREATE TABLE table_name_36 ( time_retired VARCHAR, laps VARCHAR, grid VARCHAR, constructor VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the time/retired when the grid is less than 13, the constructor is alfa romeo and the laps is more than ...
SELECT time_retired FROM table_name_36 WHERE grid < 13 AND constructor = "alfa romeo" AND laps > 12
sql_create_context
CREATE TABLE table_30331 ( "Year" real, "Team" text, "Number" real, "Games" real, "Kicks" real, "Handballs" real, "Total Disposals" real, "Marks" real, "Tackles" real, "Goals" real, "Behinds" real, "Goal Accuracy %" text, "Brownlow Medal Votes" real ) -- Using valid...
SELECT "Goal Accuracy %" FROM table_30331 WHERE "Total Disposals" = '481'
wikisql
CREATE TABLE item ( title VARCHAR, i_id VARCHAR ) CREATE TABLE review ( rating INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the titles of items whose rating is higher than the average review rating of all items.
SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rating > (SELECT AVG(rating) FROM review)
sql_create_context
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE course ( c...
SELECT DISTINCT advisory_requirement, enforced_requirement, name FROM course WHERE department = 'EECS' AND number = 382
advising
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE txmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, K...
SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jyb...
css
CREATE TABLE DEPARTMENT ( DEPT_CODE varchar(10), DEPT_NAME varchar(30), SCHOOL_CODE varchar(8), EMP_NUM int, DEPT_ADDRESS varchar(20), DEPT_EXTENSION varchar(4) ) CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ...
SELECT EMP_HIREDATE, COUNT(EMP_HIREDATE) FROM EMPLOYEE AS T1 JOIN PROFESSOR AS T2 ON T1.EMP_NUM = T2.EMP_NUM WHERE T2.PROF_OFFICE = 'DRE 102' GROUP BY EMP_LNAME ORDER BY COUNT(EMP_HIREDATE)
nvbench
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) 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, ...
SELECT MZZYZDZZBM FROM zyjzjlb WHERE JZLSH = '90470855846'
css
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, C...
SELECT COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '9294223' GROUP BY t_kc21.MED_ORG_DEPT_CD HAVING AVG(t_kc21.IN_HOSP_DAYS) > 5) AS T
css
CREATE TABLE table_9960 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Silver medals for the Nation of Turkey with a Total of less than 2?
SELECT SUM("Silver") FROM table_9960 WHERE "Nation" = 'turkey' AND "Total" < '2'
wikisql
CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varc...
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 = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMO...
atis
CREATE TABLE table_29535057_4 ( time VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the time of the games that took place at the cassell coliseum blacksburg, va?
SELECT time FROM table_29535057_4 WHERE location = "Cassell Coliseum • Blacksburg, VA"
sql_create_context
CREATE TABLE table_68285 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the to par that has macdonald smith as the player?
SELECT "To par" FROM table_68285 WHERE "Player" = 'macdonald smith'
wikisql
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 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 <= '2020-10-11')
css
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "0" AND prescriptions.drug = "insulin"
mimicsql_data
CREATE TABLE table_name_99 ( time VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What time was the match that had an attendance of 22,329?
SELECT time FROM table_name_99 WHERE attendance = "22,329"
sql_create_context
CREATE TABLE table_name_70 ( opponent VARCHAR, event VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the match against at the PRIDE 31 event?
SELECT opponent FROM table_name_70 WHERE event = "pride 31"
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 jybgb.BGDH FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '蒋...
css
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime ti...
SELECT patients.dob FROM patients WHERE patients.subject_id = 28600
mimic_iii
CREATE TABLE table_201_48 ( id number, "title" text, "year" number, "peak chart positions\nus" number, "peak chart positions\nus\nalt." number, "peak chart positions\nus\nmain. rock" number, "peak chart positions\naus" number, "peak chart positions\naut" number, "peak chart positions...
SELECT "year" FROM table_201_48 WHERE "title" = '"drowning"' AND "peak chart positions\nus\nalt." = 24
squall
CREATE TABLE table_25214321_1 ( winner VARCHAR, third_place VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the winner when Mateus Rocha finished in 3rd place?
SELECT winner FROM table_25214321_1 WHERE third_place = "Mateus Rocha"
sql_create_context
CREATE TABLE table_19745 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Game Site" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the team's opponent of October 25, 1970?
SELECT "Opponent" FROM table_19745 WHERE "Date" = 'October 25, 1970'
wikisql
CREATE TABLE table_name_72 ( senator VARCHAR, state VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the senator in kentucky
SELECT senator FROM table_name_72 WHERE state = "kentucky"
sql_create_context
CREATE TABLE table_49424 ( "Player" text, "Team" text, "Matches" real, "Overs" real, "Wickets" real, "Economy Rate" real, "Average" real, "Strike Rate" real, "Best Bowling" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many matc...
SELECT SUM("Matches") FROM table_49424 WHERE "Overs" < '59.1' AND "Economy Rate" > '6.78'
wikisql
CREATE TABLE table_35712 ( "Province" text, "Kibaki" text, "Raila" text, "Wamalwa" text, "Ngilu" text, "Others" text, "Registered Voters" text, "Turnout %" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's listed for the Turnout % wi...
SELECT "Turnout %" FROM table_35712 WHERE "Ngilu" = '30,535'
wikisql
CREATE TABLE services ( service_name VARCHAR, service_id VARCHAR ) CREATE TABLE first_notification_of_loss ( service_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the name of services that have been used for more than 2 times in first notificat...
SELECT t2.service_name FROM first_notification_of_loss AS t1 JOIN services AS t2 ON t1.service_id = t2.service_id GROUP BY t1.service_id HAVING COUNT(*) > 2
sql_create_context
CREATE TABLE table_61124 ( "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. -- What Player won the PGA in 1989?
SELECT "Player" FROM table_61124 WHERE "Year(s) won" = '1989'
wikisql
CREATE TABLE table_name_85 ( population INTEGER, area_km_2 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Population of the Parish with an Area km 2 of 236.76?
SELECT MIN(population) FROM table_name_85 WHERE area_km_2 = 236.76
sql_create_context
CREATE TABLE table_name_73 ( series VARCHAR, visitor VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the series score of the game with Vancouver as the visiting team on April 16?
SELECT series FROM table_name_73 WHERE visitor = "vancouver" AND date = "april 16"
sql_create_context
CREATE TABLE table_name_92 ( region VARCHAR, label VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the region when the label was the universal music group?
SELECT region FROM table_name_92 WHERE label = "universal music group"
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 JZLX FROM jybgb WHERE BGDH = '10369980822'
css
CREATE TABLE table_18592 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many races involve incumbent Pat Cannon?
SELECT COUNT("Result") FROM table_18592 WHERE "Incumbent" = 'Pat Cannon'
wikisql
CREATE TABLE table_49397 ( "Class" text, "Part 1" text, "Part 2" text, "Part 3" text, "Part 4" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was part 2 when part 4 was *bl tanaz?
SELECT "Part 2" FROM table_49397 WHERE "Part 4" = '*blōtanaz'
wikisql
CREATE TABLE table_27479 ( "Rank" real, "Rank w/o Hydropower" real, "State" text, "% Renewable" text, "% Renewable w/o Hydro" text, "Renewable electricity (GW\u00b7h)" real, "Renewable electricity w/o Hydro (GW\u00b7h)" real, "Total electricity (GW\u00b7h)" real ) -- Using valid SQLite...
SELECT MIN("Renewable electricity (GW\u00b7h)") FROM table_27479 WHERE "Rank" = '36'
wikisql
CREATE TABLE table_13352 ( "Parameter" text, "Symbol" text, "Best fit (WMAP only)" text, "Best fit (WMAP, extra parameter)" text, "Best fit (all data)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the parameter when the best fit (WMAP only...
SELECT "Parameter" FROM table_13352 WHERE "Best fit (WMAP only)" = '.9 ± .1' AND "Symbol" = 'a'
wikisql
CREATE TABLE table_28286776_52 ( cap_s_ VARCHAR, club_s_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many caps figures for the Doncaster Rovers?
SELECT COUNT(cap_s_) FROM table_28286776_52 WHERE club_s_ = "Doncaster Rovers"
sql_create_context
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description t...
SELECT c.Table_Name, CASE WHEN '##PK:string?id##' = c.column_name THEN CONCAT(c.column_name, ' (PK)') ELSE c.column_name END AS column_name, data_type, is_nullable, COALESCE(CHARACTER_MAXIMUM_LENGTH, numeric_precision, datetime_precision) AS "length/precision" FROM INFORMATION_SCHEMA.Columns AS c WHERE c.table_name = '...
sede
CREATE TABLE ftxmzjzjlb ( 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, MZZYZD...
SELECT COUNT(*) FROM txmzjzjlb WHERE txmzjzjlb.JZKSMC = '新生儿外科' AND txmzjzjlb.JZKSRQ BETWEEN '2008-02-20' AND '2017-03-13' UNION SELECT COUNT(*) FROM ftxmzjzjlb WHERE ftxmzjzjlb.JZKSMC = '新生儿外科' AND ftxmzjzjlb.JZKSRQ BETWEEN '2008-02-20' AND '2017-03-13'
css
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
SELECT IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_ID = '81282369'
css
CREATE TABLE table_67917 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score for the 2014 FIFA World Cup Qual. competition?
SELECT "Score" FROM table_67917 WHERE "Competition" = '2014 fifa world cup qual.'
wikisql
CREATE TABLE table_name_4 ( opponent VARCHAR, points VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Opponent of the game with more than 13,567 in Attendance with more than 5 Points?
SELECT opponent FROM table_name_4 WHERE points > 5 AND attendance > 13 OFFSET 567
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 intakeoutput ( intakeo...
SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 20 AND 29) AND DATETIME(lab.labresulttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')...
eicu
CREATE TABLE table_name_41 ( number VARCHAR, males VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which number has 11 males?
SELECT number FROM table_name_41 WHERE males = "11"
sql_create_context
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.icd9_code = "3995"
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 jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE employees ( EMPLOYE...
SELECT JOB_ID, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY JOB_ID DESC
nvbench
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) 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, admi...
SELECT DISTINCT semester.semester, semester.year FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.number = 841 AND course_offering.semester = semester.semester_id AND instructor.name LIKE '%Stephen Rassi%' AND offering_instructor.instr...
advising
CREATE TABLE table_10032 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date with home team of Stockport County?
SELECT "Date" FROM table_10032 WHERE "Home team" = 'stockport county'
wikisql
CREATE TABLE table_2589963_1 ( institution VARCHAR, women VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What institution is represented by the lady saints?
SELECT institution FROM table_2589963_1 WHERE women = "Lady Saints"
sql_create_context
CREATE TABLE table_204_693 ( id number, "place" text, "total" number, "men" number, "women" number, "children" number, "elderly" number, "serbs" number, "jews" number, "romani" number, "rusyns" number, "hungarians" number, "russians" number ) -- Using valid SQLite, ...
SELECT "place" FROM table_204_693 WHERE "place" IN ('đurđevo', 'zabalj') ORDER BY "jews" DESC LIMIT 1
squall
CREATE TABLE table_6578 ( "Round" real, "Player" text, "Position" text, "Nationality" text, "College/Junior/Club Team (League)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who plays the right wing position?
SELECT "Player" FROM table_6578 WHERE "Position" = 'right wing'
wikisql
CREATE TABLE table_204_262 ( id number, "rank" number, "athlete" text, "time" text, "notes" text, "q" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which athlete belongs to rank 10 ?
SELECT "athlete" FROM table_204_262 WHERE "rank" = 10
squall
CREATE TABLE table_34131 ( "Year" real, "Location" text, "Gold" text, "Silver" text, "Bronze" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the Gold that has the Silver of south korea, and the Year of 1986?
SELECT "Gold" FROM table_34131 WHERE "Silver" = 'south korea' AND "Year" = '1986'
wikisql
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 (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-95970' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = 'calci...
eicu
CREATE TABLE table_25736 ( "Rank" real, "Team" text, "Total Points" real, "2008-09 Points" real, "2007-08 Points" real, "2006-07 Points" real, "2005-06 Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the points is 1, what is the to...
SELECT MIN("Total Points") FROM table_25736 WHERE "2005-06 Points" = '1'
wikisql
CREATE TABLE entrepreneur ( Entrepreneur_ID int, People_ID int, Company text, Money_Requested real, Investor text ) CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Date_of_Birth text ) -- Using valid SQLite, answer the following questions for the tabl...
SELECT Investor, COUNT(Investor) FROM entrepreneur GROUP BY Investor ORDER BY Investor DESC
nvbench
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId ...
SELECT DISTINCT u.Id AS "user_link", CONCAT('https://stackoverflow.com/users/', u.Id) AS "profile_link", u.DisplayName, u.Location, SUM(a.Score) AS "tag_scores" FROM Users AS u INNER JOIN Posts AS a ON a.OwnerUserId = u.Id INNER JOIN Posts AS q ON a.ParentId = q.Id INNER JOIN PostTags AS pt ON pt.PostId = q.Id INNER JO...
sede
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "34830" AND prescriptions.route = "DIALYS"
mimicsql_data
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
SELECT IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_ID = '37329044' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc24 WHERE MED_AMOUT >= 6376.37)
css
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Chronic combined systolic and diastolic heart failure" AND prescriptions.route = "ED"
mimicsql_data
CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTas...
SELECT Id AS "post_link" FROM Posts WHERE Body LIKE '%<li><blockquote>%' AND OwnerUserId = 106224
sede
CREATE TABLE table_1342338_5 ( district VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In how many districts was the incumbent David Delano Glover?
SELECT COUNT(district) FROM table_1342338_5 WHERE incumbent = "David Delano Glover"
sql_create_context
CREATE TABLE table_name_76 ( team VARCHAR, high_assists VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team has brad miller (8) as the high assists?
SELECT team FROM table_name_76 WHERE high_assists = "brad miller (8)"
sql_create_context
CREATE TABLE table_4718 ( "Player" text, "Nationality" text, "Position" text, "From" real, "School/Country" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average number of players from Duquesne?
SELECT AVG("From") FROM table_4718 WHERE "School/Country" = 'duquesne'
wikisql
CREATE TABLE table_name_44 ( date VARCHAR, tie_no VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what date did tie number 5 occur?
SELECT date FROM table_name_44 WHERE tie_no = "5"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic 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 = "Total Protein, Urine"
mimicsql_data
CREATE TABLE table_name_39 ( bulgarian_commander VARCHAR, battle VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Bulgarian Commander of the Battle of Rusion?
SELECT bulgarian_commander FROM table_name_39 WHERE battle = "battle of rusion"
sql_create_context
CREATE TABLE table_20745754_1 ( _number VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What game number had an attendance of 2813?
SELECT _number FROM table_20745754_1 WHERE attendance = 2813
sql_create_context
CREATE TABLE table_58156 ( "Draw" real, "Artist" text, "Song" text, "Points" real, "Place" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many points has a draw greater than 3 and 3rd place?
SELECT "Points" FROM table_58156 WHERE "Draw" > '3' AND "Place" = '3'
wikisql
CREATE TABLE Financial_Transactions ( transaction_id INTEGER, previous_transaction_id INTEGER, account_id INTEGER, card_id INTEGER, transaction_type VARCHAR(15), transaction_date DATETIME, transaction_amount DOUBLE, transaction_comment VARCHAR(255), other_transaction_details VARCHAR(...
SELECT card_type_code, COUNT(*) FROM Financial_Transactions AS T1 JOIN Customers_Cards AS T2 ON T1.card_id = T2.card_id GROUP BY T2.card_type_code ORDER BY COUNT(*)
nvbench
CREATE TABLE table_name_18 ( source VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the source for Laird?
SELECT source FROM table_name_18 WHERE name = "laird"
sql_create_context
CREATE TABLE table_49839 ( "Rank" real, "Player" text, "Country" text, "Events" real, "Prize money( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the prize money for the player ranked 1?
SELECT MAX("Prize money( $ )") FROM table_49839 WHERE "Rank" = '1'
wikisql
CREATE TABLE table_1553485_1 ( channel_tv___dt__ VARCHAR, station VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What channel tv (dt) plays the KPIX station?
SELECT channel_tv___dt__ FROM table_1553485_1 WHERE station = "KPIX"
sql_create_context
CREATE TABLE table_name_88 ( parent_magazine VARCHAR, first_published VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the parent magazine of the magazine that was first published on december 16, 2004?
SELECT parent_magazine FROM table_name_88 WHERE first_published = "december 16, 2004"
sql_create_context
CREATE TABLE table_3537 ( "Series #" real, "Season #" real, "Episode Title" text, "Original airdate" text, "Prod. No." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many episodes had production number 2x13?
SELECT COUNT("Season #") FROM table_3537 WHERE "Prod. No." = '2x13'
wikisql
CREATE TABLE table_48069 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Total has a Bronze larger than 2, a Gold smaller than 16, a Silver of 0, and a Rank of...
SELECT AVG("Total") FROM table_48069 WHERE "Bronze" > '2' AND "Gold" < '16' AND "Silver" = '0' AND "Rank" = '13'
wikisql
CREATE TABLE table_61804 ( "2010" text, "2009" real, "2008" real, "2007" text, "2006" real, "2005" real, "2004" real, "2003" real, "2002" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average 2003 with 2,154,170 in 2010 ...
SELECT AVG("2003") FROM table_61804 WHERE "2010" = '2,154,170' AND "2008" < '2,266,716'
wikisql
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'flecainide acetate' AND STRFTIME('%y', prescriptions.startdate) =...
mimic_iii
CREATE TABLE table_14143 ( "Manufacturer" text, "Transmission" text, "Engine Capacity" real, "Fuel Type" text, "L/100km Urban (Cold)" real, "L/100km Extra-Urban" real, "L/100km Combined" real, "mpg-UK Urban (Cold)" real, "mpg-UK Extra-Urban" real, "mpg-UK Combined" real, "mpg...
SELECT MIN("mpg-US Combined") FROM table_14143 WHERE "Green Rating" = 'e' AND "mpg-UK Combined" < '42.2' AND "Manufacturer" = 'volkswagen' AND "Transmission" = 'm6'
wikisql
CREATE TABLE table_79357 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date had a tie no of replay, and an away team of watford?
SELECT "Date" FROM table_79357 WHERE "Tie no" = 'replay' AND "Away team" = 'watford'
wikisql
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number...
SELECT * FROM Badges WHERE Name IN ('Copy Editor', 'Electorate', 'Fanatic', 'Illuminator', 'Legendary', 'Marshal', 'Socratic') OR Name IN ('Archaeologist', 'Civic Duty', 'Deputy', 'Enthusiast', 'Epic', 'Inquisitive', 'Necromancer', 'Refiner', 'Research Assistant', 'Sportsmanship', 'Strunk & White') LIMIT 500
sede
CREATE TABLE table_25277262_2 ( title VARCHAR, no_in_season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the episode # 11 in the season?
SELECT title FROM table_25277262_2 WHERE no_in_season = 11
sql_create_context
CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar ) CREATE TABLE days ( days_code varchar, day_name varchar ) CR...
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 = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHIN...
atis
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.short_title = "Regional lymph node exc"
mimicsql_data
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), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_...
SELECT EMPLOYEE_ID, DEPARTMENT_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
nvbench
CREATE TABLE table_24293 ( "Date" text, "Time" text, "ACC Team" text, "Big Ten Team" text, "Location" text, "Television" text, "Attendance" real, "Winner" text, "Challenge Leader" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is...
SELECT "Winner" FROM table_24293 WHERE "Challenge Leader" = 'BigTen (2-1)'
wikisql
CREATE TABLE pitching ( player_id text, year number, stint number, team_id text, league_id text, w number, l number, g number, gs number, cg number, sho number, sv number, ipouts number, h number, er number, hr number, bb number, so number, bao...
SELECT SUM(T1.games) FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year BETWEEN 1990 AND 2000
spider
CREATE TABLE table_name_63 ( release_price___usd__ VARCHAR, socket VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Socket of without quickassist has what release price?
SELECT release_price___usd__ FROM table_name_63 WHERE socket = "without quickassist"
sql_create_context
CREATE TABLE repair ( repair_ID int, name text, Launch_Date text, Notes text ) CREATE TABLE machine ( Machine_ID int, Making_Year int, Class text, Team text, Machine_series text, value_points real, quality_rank int ) CREATE TABLE technician ( technician_id real, Nam...
SELECT Team, COUNT(*) FROM technician GROUP BY Team ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_31989 ( "Sixes" text, "Player" text, "Opponent" text, "Venue" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date when Canada played?
SELECT "Date" FROM table_31989 WHERE "Opponent" = 'canada'
wikisql
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) 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, ...
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '52950661' AND t_kc21.MED_SER_ORG_NO = '7572010' AND t_kc21.IN_HOSP_DATE BETWEEN '2004-10-25' AND '2018-02-18')
css
CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE T...
SELECT vt.Name AS votetype, pt.Name AS posttype, COUNT(*) AS num FROM Votes AS v INNER JOIN VoteTypes AS vt ON v.VoteTypeId = vt.Id INNER JOIN Posts AS p ON p.Id = v.PostId INNER JOIN PostTypes AS pt ON p.PostTypeId = pt.Id GROUP BY vt.Name, pt.Name
sede
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 SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '1849548' AND gwyjzb.MED_ORG_DEPT_CD = '1081' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '1849548' AND fgwyjzb.MED_ORG_DEPT_CD = '1081') AND t...
css
CREATE TABLE table_44495 ( "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. -- When was the archbishop that...
SELECT "Ordained Bishop" FROM table_44495 WHERE "Born" = 'february 22, 1825'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetake...
SELECT COUNT(*) FROM treatment WHERE treatment.treatmentname = 'dressing change' AND STRFTIME('%y', treatment.treatmenttime) <= '2104'
eicu
CREATE TABLE table_15180 ( "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 average silver with a Rank smaller than 2 and more than 1 gold?
SELECT AVG("Silver") FROM table_15180 WHERE "Rank" < '2' AND "Gold" > '1'
wikisql