instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE wdmzjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH number, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZD...
SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '62645586' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM jyjgzbb WH...
css
CREATE TABLE table_41584 ( "Residence Hall" text, "Established" real, "Rector" text, "Campus" text, "Capacity" real, "Colors" text, "Mascot" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which capacity has a purple and white colors?
SELECT "Capacity" FROM table_41584 WHERE "Colors" = 'purple and white'
wikisql
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number...
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 = 'status-post ptca')...
mimic_iii
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND prescriptions.drug = "Glucagon"
mimicsql_data
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text ) CREATE TABLE person_info_hz_info ( RYBH text, KH number, KLX number, YLJGDM number ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, J...
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info JOIN person_info 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 = ...
css
CREATE TABLE Course_Authors_and_Tutors ( personal_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List all the information about course authors and tutors in alphabetical order of the personal name.
SELECT * FROM Course_Authors_and_Tutors ORDER BY personal_name
sql_create_context
CREATE TABLE school_details ( school_id number, nickname text, colors text, league text, class text, division text ) CREATE TABLE school ( school_id number, school text, location text, enrollment number, founded number, denomination text, boys_or_girls text, day_...
SELECT school_colors FROM school ORDER BY enrollment DESC LIMIT 1
spider
CREATE TABLE table_46828 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the catalog with the region of the United States?
SELECT "Catalog" FROM table_46828 WHERE "Region" = 'united states'
wikisql
CREATE TABLE table_35561 ( "Game" real, "Date" real, "Opponent" text, "Score" text, "Location/attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the earliest date of the game with a score of 2-2?
SELECT MIN("Date") FROM table_35561 WHERE "Score" = '2-2'
wikisql
CREATE TABLE table_20170644_3 ( pick__number VARCHAR, college VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What number picks were the players who went to Calgary?
SELECT pick__number FROM table_20170644_3 WHERE college = "Calgary"
sql_create_context
CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE airline ( airline_co...
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 = 'TORONTO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND flight.from_airport = AIR...
atis
CREATE TABLE table_64325 ( "Name" text, "Career" text, "Matches" real, "Overs" real, "Maidens" real, "Runs" real, "Wickets" real, "Average" real, "Best" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who has fewer than 2047.3 overs, ...
SELECT "Name" FROM table_64325 WHERE "Overs" < '2047.3' AND "Wickets" > '200' AND "Average" > '29.02'
wikisql
CREATE TABLE table_name_51 ( points INTEGER, year INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the lowest points past the year 1978?
SELECT MIN(points) FROM table_name_51 WHERE year > 1978
sql_create_context
CREATE TABLE table_36897 ( "Round" text, "Name" text, "Circuit" text, "Date" text, "Winning driver" text, "Winning car" text, "Winning team" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the winning team of the Sou...
SELECT "Winning team" FROM table_36897 WHERE "Name" = 'south pacific trophy'
wikisql
CREATE TABLE Employee ( EmployeeId integer, LastName varchar(20), FirstName varchar(20), Title varchar(30), ReportsTo integer, BirthDate datetime, HireDate datetime, Address varchar(70), City varchar(40), State varchar(40), Country varchar(40), PostalCode varchar(10), ...
SELECT T1.Title, T1.AlbumId FROM Album AS T1 JOIN Track AS T2 ON T1.AlbumId = T2.AlbumId WHERE T2.UnitPrice > 1
nvbench
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT * FROM t_kc21 WHERE PERSON_ID = '18039764' AND MED_SER_ORG_NO = '6690866' AND NOT MED_ORG_DEPT_NM LIKE '%营养%'
css
CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Has_Allergy ( StuID INTEGE...
SELECT AllergyType, COUNT(*) FROM Allergy_Type GROUP BY AllergyType
nvbench
CREATE TABLE table_name_94 ( recipient VARCHAR, award VARCHAR, film VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the recipient for jamaica and award of 6,947
SELECT recipient FROM table_name_94 WHERE award = "£6,947" AND film = "jamaica"
sql_create_context
CREATE TABLE table_55001 ( "Year" text, "Make & Model" text, "Length" text, "Engine Type" text, "Numbers" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the length for years 2012-2013?
SELECT "Length" FROM table_55001 WHERE "Year" = '2012-2013'
wikisql
CREATE TABLE table_name_64 ( moving_to VARCHAR, transfer_fee VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is Odjidja-Ofoe, with an undisclosed transfer fee, moving to?
SELECT moving_to FROM table_name_64 WHERE transfer_fee = "undisclosed" AND name = "odjidja-ofoe"
sql_create_context
CREATE TABLE table_1601792_3 ( frequency VARCHAR, station VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the frequency of hot fm?
SELECT COUNT(frequency) FROM table_1601792_3 WHERE station = "Hot FM"
sql_create_context
CREATE TABLE table_204_585 ( id number, "year" text, "player" text, "high school" text, "college" text, "nba/aba draft" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who the only player who went to georgetown ?
SELECT "player" FROM table_204_585 WHERE "college" = 'georgetown'
squall
CREATE TABLE table_204_325 ( id number, "class" text, "name" text, "company" text, "residence" text, "term expires dec 31" number, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- number of current vacancies
SELECT COUNT(*) FROM table_204_325 WHERE "name" = 'vacancy'
squall
CREATE TABLE table_39421 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of the game on week 1?
SELECT "Result" FROM table_39421 WHERE "Week" = '1'
wikisql
CREATE TABLE table_203_771 ( id number, "#" number, "artist" text, "featuring" text, "title" text, "version" text, "length" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which title has the most length ?
SELECT "title" FROM table_203_771 ORDER BY "length" DESC LIMIT 1
squall
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE T...
SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY HIRE_DATE DESC
nvbench
CREATE TABLE table_name_38 ( venue VARCHAR, host VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the venue that Saint Joseph's University hosted at?
SELECT venue FROM table_name_38 WHERE host = "saint joseph's university"
sql_create_context
CREATE TABLE table_name_54 ( location VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the location when the opponent is aleksandr pitchkounov?
SELECT location FROM table_name_54 WHERE opponent = "aleksandr pitchkounov"
sql_create_context
CREATE TABLE table_name_23 ( year_2007 INTEGER, year_2005 INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of Year 2007(s), when the Year 2005 is greater than 29,377?
SELECT SUM(year_2007) FROM table_name_23 WHERE year_2005 > 29 OFFSET 377
sql_create_context
CREATE TABLE table_name_20 ( multiplier VARCHAR, frequency VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the multiplier for the processor with a frequency of 733MHz?
SELECT multiplier FROM table_name_20 WHERE frequency = "733mhz"
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 mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '48679933' AND NOT mzjzjlb.JZLSH IN (SELECT JZLSH FROM jybgb WHERE BGRQ >= '2011-03-05')
css
CREATE TABLE table_77182 ( "Outcome" text, "Date" text, "Championship" text, "Surface" text, "Opponent" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the score when the championship is rome and the opponent is richard kraj...
SELECT "Score" FROM table_77182 WHERE "Championship" = 'rome' AND "Opponent" = 'richard krajicek'
wikisql
CREATE TABLE table_47840 ( "Tournament" text, "1998" text, "1999" text, "2000" text, "2001" text, "2002" text, "2003" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text, "2013" text...
SELECT "2010" FROM table_47840 WHERE "2009" = 'w' AND "2007" = 'qf'
wikisql
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE comment_instructor ( instructor_id int...
SELECT DISTINCT program.name FROM course INNER JOIN program_course ON program_course.course_id = course.course_id INNER JOIN program ON program.program_id = program_course.program_id WHERE course.department = 'ORGSTUDY' AND course.number = 202
advising
CREATE TABLE table_37184 ( "State" text, "Name" text, "Hometown" text, "Age 1" real, "Talent" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What state has lincoln, de as the hometown?
SELECT "State" FROM table_37184 WHERE "Hometown" = 'lincoln, de'
wikisql
CREATE TABLE table_204_186 ( id number, "season" text, "tier" number, "division" text, "place" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- name a season they did not place higher than 18th .
SELECT "season" FROM table_204_186 WHERE "place" > 18
squall
CREATE TABLE table_23858 ( "No. in series" real, "No. in season" real, "Title" text, "Directedby" text, "Writtenby" text, "Originalairdate" text, "Production code" text, "U.S.viewers (million)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. ...
SELECT COUNT("No. in season") FROM table_23858 WHERE "Writtenby" = 'Brett Conrad & Liz Sagal'
wikisql
CREATE TABLE table_27537870_5 ( opponent VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the opponent for record 10-13-3
SELECT opponent FROM table_27537870_5 WHERE record = "10-13-3"
sql_create_context
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 text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT procedures.short_title, procedures.long_title FROM procedures WHERE procedures.icd9_code = "45"
mimicsql_data
CREATE TABLE table_name_94 ( score VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the record was 7-2, what was the score for the game?
SELECT score FROM table_name_94 WHERE record = "7-2"
sql_create_context
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 T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Name
nvbench
CREATE TABLE table_79466 ( "Event" text, "Class" text, "Gold" text, "Silver" text, "Bronze" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who received gold when the event is road race details and silver is max weber germany (ger)?
SELECT "Gold" FROM table_79466 WHERE "Event" = 'road race details' AND "Silver" = 'max weber germany (ger)'
wikisql
CREATE TABLE table_58841 ( "Season" text, "Club" text, "Country" text, "Apps." text, "Goals" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What season had Belgium and 1 goal?
SELECT "Season" FROM table_58841 WHERE "Country" = 'belgium' AND "Goals" = '1'
wikisql
CREATE TABLE table_name_6 ( winning_driver VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was Kraco Twin 125 (R2)'s Winning Driver?
SELECT winning_driver FROM table_name_6 WHERE name = "kraco twin 125 (r2)"
sql_create_context
CREATE TABLE table_name_1 ( state VARCHAR, electorate VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what state was the electorate fowler?
SELECT state FROM table_name_1 WHERE electorate = "fowler"
sql_create_context
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( c...
SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-23724')) AND DATETIME(microlab.culturetakentime, 'start of ye...
eicu
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, Cr...
SELECT TIME_TO_STR(QuestionWithT.CDate, '%-HOUR') AS AskingHour, AVG(QuestionWithT.T) AS AvgWaitTimeForFirstResponse FROM (SELECT Question.Id AS Id, MIN(Question.CreationDate) AS CDate, MIN(CAST((JULIANDAY(CreationDate) - JULIANDAY(Question.CreationDate)) * 1440.0 AS INT)) / (24.0 * 60) AS T FROM Posts AS Question, Pos...
sede
CREATE TABLE table_name_79 ( authority VARCHAR, roll VARCHAR, area VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the authority when the roll is less than 234 for the massey east area?
SELECT authority FROM table_name_79 WHERE roll < 234 AND area = "massey east"
sql_create_context
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.friday = 'N' AND course_offering.monday = 'Y' AND course_offering.thursday = 'N' AND course_offering.tuesday = 'N' AND course_offering.wednesday = 'Y' AND course.course_id = course_offering.course_id AND course.department = 'EECS' AND cour...
advising
CREATE TABLE table_9193 ( "Member" text, "Party" text, "Electorate" text, "State" text, "Term of office" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the electorate when the member was rex connor?
SELECT "Electorate" FROM table_9193 WHERE "Member" = 'rex connor'
wikisql
CREATE TABLE table_55648 ( "English Name" text, "Japanese orthography" text, "Pronouciation" text, "abbreviation" text, "Provider(IAI)" text, "Foundation" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of the Foundation with J...
SELECT SUM("Foundation") FROM table_55648 WHERE "Japanese orthography" = '国立看護大学校'
wikisql
CREATE TABLE table_203_61 ( 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 gold medals did the ivory coast and namibia win combined ...
SELECT SUM("gold") FROM table_203_61 WHERE "nation" IN ('ivory coast', 'namibia')
squall
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, d...
SELECT DISTINCT t1.c1 FROM (SELECT lab.labresult, PERCENT_RANK() OVER (ORDER BY lab.labresult) AS c1 FROM lab WHERE lab.labname = 'chloride' AND lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age = (SELECT patient.age FROM patient WHERE patient.uniquepid = '015-52724' AND patient....
eicu
CREATE TABLE table_1341472_49 ( first_elected INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the latest first elected year
SELECT MAX(first_elected) FROM table_1341472_49
sql_create_context
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD ...
SELECT t_kc21.MED_ORG_DEPT_NM, AVG(t_kc24.OVE_PAY) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '2371026' GROUP BY t_kc21.MED_ORG_DEPT_NM
css
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREA...
SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-37317')) AND intakeoutput.cellpath LIKE '%output%...
eicu
CREATE TABLE table_name_42 ( events VARCHAR, player VARCHAR, earnings___$__ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of events that Al Geiberger has played with earnings larger than 527,033?
SELECT COUNT(events) FROM table_name_42 WHERE player = "al geiberger" AND earnings___$__ > 527 OFFSET 033
sql_create_context
CREATE TABLE table_name_89 ( venue VARCHAR, competition VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the venue for friendly competition october 16, 2012
SELECT venue FROM table_name_89 WHERE competition = "friendly" AND date = "october 16, 2012"
sql_create_context
CREATE TABLE table_name_65 ( date VARCHAR, week VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the date that week 9 started?
SELECT date FROM table_name_65 WHERE week = "9"
sql_create_context
CREATE TABLE table_name_41 ( surface VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which surface has an Opponent of fernando verdasco?
SELECT surface FROM table_name_41 WHERE opponent = "fernando verdasco"
sql_create_context
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugsto...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', lab.labresulttime)) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-157753' AND patient.hosp...
eicu
CREATE TABLE table_name_52 ( win__percentage INTEGER, lost VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Lost of 18 had what sum of win %?
SELECT SUM(win__percentage) FROM table_name_52 WHERE lost = 18
sql_create_context
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT SUM(t_kc24.OVE_PAY) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '柏嘉纳' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2003-05-08' AND '2018-09-10' UNION SELECT SUM(t_kc24.OVE_PAY) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE fgwyjzb.PERSON...
css
CREATE TABLE table_32661 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who did the Jets play in the Meadowlands on week 14?
SELECT "Opponent" FROM table_32661 WHERE "Game site" = 'the meadowlands' AND "Week" = '14'
wikisql
CREATE TABLE table_98 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position did Calvin Mccarty play?
SELECT "Position" FROM table_98 WHERE "Player" = 'Calvin McCarty'
wikisql
CREATE TABLE table_name_8 ( arranger_s_ VARCHAR, lyricist_s_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the arranger for the song that had a lyricist of Sirapatara Kalayapanid?
SELECT arranger_s_ FROM table_name_8 WHERE lyricist_s_ = "sirapatara kalayapanid"
sql_create_context
CREATE TABLE railway_manage ( Railway_ID int, Manager_ID int, From_Year text ) CREATE TABLE train ( Train_ID int, Train_Num text, Name text, From text, Arrival text, Railway_ID int ) CREATE TABLE manager ( Manager_ID int, Name text, Country text, Working_year_starts...
SELECT Name, COUNT(Name) FROM train GROUP BY Name ORDER BY COUNT(Name) DESC
nvbench
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT gwyjzb.MED_ORG_DEPT_CD, gwyjzb.OUT_DIAG_DIS_CD, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '4313090' GROUP BY gwyjzb.MED_ORG_DEPT_CD, gwyjzb.OUT_DIAG_DIS_CD UNION SELECT fgwyjzb.MED_ORG_DEPT_CD, fgwyjzb.OUT_DIAG_DIS_CD, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '43...
css
CREATE TABLE table_25384 ( "Player" text, "Games Played" real, "Field Goals" real, "Three Pointers" real, "Free Throws" real, "Rebounds" real, "Assists" real, "Blocks" real, "Steals" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables prov...
SELECT COUNT("Player") FROM table_25384 WHERE "Points" = '51'
wikisql
CREATE TABLE table_name_85 ( time VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the time of the rider with a 398cc yamaha?
SELECT time FROM table_name_85 WHERE team = "398cc yamaha"
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 demographic.gender FROM demographic WHERE demographic.name = "Tiffany Williams"
mimicsql_data
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, a...
SELECT MIN(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-73243')) AND intakeoutput.celllabel = 'outpu...
eicu
CREATE TABLE table_10263 ( "Player" text, "No.(s)" text, "Height in Ft." text, "Position" text, "Years for Rockets" text, "School/Club Team/Country" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the height in feet of the Illinois player...
SELECT "Height in Ft." FROM table_10263 WHERE "School/Club Team/Country" = 'illinois'
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 COUNT(*) FROM jybgb WHERE jybgb.JZLSH = '91340380252'
css
CREATE TABLE table_name_86 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the maximum in 2004 when 2009 is higher than 26.1?
SELECT MAX(2004) FROM table_name_86 WHERE 2009 > 26.1
sql_create_context
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE T...
WITH FirstQuestions AS (SELECT MIN(p.Id) AS "postid" FROM Posts AS p WHERE p.PostTypeId = @Question GROUP BY p.OwnerUserId) SELECT fq.PostId AS "post_link", p.OwnerUserId AS "user_link", p.Score, p.CreationDate FROM FirstQuestions AS fq JOIN Posts AS p ON fq.PostId = p.Id WHERE TIME_TO_STR(CreationDate, '%YEAR') = @Tar...
sede
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT demographic.diagnosis, prescriptions.drug FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Marilyn Norvell"
mimicsql_data
CREATE TABLE table_16229 ( "1st players choice" text, "2nd players choice" text, "Probability 1st player wins" text, "Probability 2nd player wins" text, "Probability of a draw" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the chances the ...
SELECT "Probability 1st player wins" FROM table_16229 WHERE "Probability 2nd player wins" = '80.11%' AND "2nd players choice" = 'R RB'
wikisql
CREATE TABLE table_74603 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which venue's home team is geelong?
SELECT "Venue" FROM table_74603 WHERE "Home team" = 'geelong'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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...
SELECT mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND 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 ...
css
CREATE TABLE table_31620 ( "Year" text, "Men's singles" text, "Women's singles" text, "Men's doubles" text, "Women's doubles" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who played men's singles in 1951?
SELECT "Men's singles" FROM table_31620 WHERE "Year" = '1951'
wikisql
CREATE TABLE table_41324 ( "Draw" real, "Song" text, "Performer" text, "Points" real, "Rank" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Points has a Performer of rob burke band?
SELECT COUNT("Points") FROM table_41324 WHERE "Performer" = 'rob burke band'
wikisql
CREATE TABLE ndecoreexcel_math_grade8 ( year number, state text, all_students text, average_scale_score number ) CREATE TABLE finrev_fed_17 ( state_code number, idcensus number, school_district text, nces_id text, yr_data number, t_fed_rev number, c14 number, c25 number ...
SELECT state FROM ndecoreexcel_math_grade8 ORDER BY average_scale_score LIMIT 1
studentmathscore
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text ) 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 te...
SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info JOIN person_info 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.YLJ...
css
CREATE TABLE table_name_25 ( venue VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where was the game with a result of won 5-0?
SELECT venue FROM table_name_25 WHERE result = "won 5-0"
sql_create_context
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 text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND diagnoses.long_title = "Personal history of malignant neoplasm of rectum, rectosigmoid junction, and anus"
mimicsql_data
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT ACC_Regular_Season, School_ID FROM basketball_match ORDER BY School_ID DESC
nvbench
CREATE TABLE table_71792 ( "Rank" real, "Heat" real, "Lane" real, "Name" text, "Nationality" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the total lanes that have a rank larger than 22?
SELECT SUM("Lane") FROM table_71792 WHERE "Rank" > '22'
wikisql
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE TagSynonyms ( Id number...
SELECT Badges.Class, COUNT(Users.DisplayName) AS NumberOfUsers FROM Badges INNER JOIN Users ON Badges.UserId = Users.Id WHERE Badges.Date LIKE '%2015%' GROUP BY Badges.Class
sede
CREATE TABLE table_1185 ( "No." real, "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. -- What was the margin of victory at the Mercedes...
SELECT "Margin of victory" FROM table_1185 WHERE "Tournament" = 'Mercedes Championships'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE intakeoutput ( ...
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'acute renal failure - etiology unknown' AND STRFTI...
eicu
CREATE TABLE table_33603 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where was the game played when the away team sco...
SELECT "Venue" FROM table_33603 WHERE "Away team score" = '9.14 (68)'
wikisql
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE swimme...
SELECT Time, ID FROM swimmer
nvbench
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), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
SELECT JOB_ID, SUM(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID
nvbench
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownV...
SELECT * FROM Users WHERE Reputation >= 100000 ORDER BY Reputation DESC
sede
CREATE TABLE table_6675 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position did the player play in the european cross country championships in 2008?
SELECT "Position" FROM table_6675 WHERE "Competition" = 'european cross country championships' AND "Year" = '2008'
wikisql
CREATE TABLE table_18285 ( "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. -- What year were the election results tom loeffler (r) 80.6% joe sullivan ...
SELECT MIN("First elected") FROM table_18285 WHERE "Candidates" = 'Tom Loeffler (R) 80.6% Joe Sullivan (D) 19.4%'
wikisql
CREATE TABLE table_27319183_5 ( episode VARCHAR, official_itv1_hd_rating__millions_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which episode had an official ITV1 HD rating of 1.185 million?
SELECT episode FROM table_27319183_5 WHERE official_itv1_hd_rating__millions_ = "1.185"
sql_create_context
CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId numb...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%siddhapur%' OR UPPER(Location) LIKE '%SIDDHAPUR' ORDER BY Reputation DESC LIMIT 30
sede
CREATE TABLE table_25664518_4 ( viewers__millions_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who were the 3rd couple that were viewed by 4.89 million viewers?
SELECT 3 AS rd_couple FROM table_25664518_4 WHERE viewers__millions_ = "4.89"
sql_create_context