instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE rating ( rid number, mid number, stars number, ratingdate time ) CREATE TABLE movie ( mid number, title text, year number, director text ) CREATE TABLE reviewer ( rid number, name text ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT T2.title, T1.mid FROM rating AS T1 JOIN movie AS T2 ON T1.mid = T2.mid GROUP BY T1.mid ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_name_60 ( drawn VARCHAR, lost VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you name the drawn with a Lost of 1?
SELECT drawn FROM table_name_60 WHERE lost = "1"
sql_create_context
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE gsi ( course_offeri...
SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN area ON course_offering.course_id = area.course_id WHERE area.area LIKE '%...
advising
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT t_kc21.IN_DIAG_DIS_CD, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '0987112' GROUP BY t_kc21.IN_DIAG_DIS_CD
css
CREATE TABLE Affiliated_With ( Physician INTEGER, Department INTEGER, PrimaryAffiliation BOOLEAN ) CREATE TABLE Block ( BlockFloor INTEGER, BlockCode INTEGER ) CREATE TABLE Appointment ( AppointmentID INTEGER, Patient INTEGER, PrepNurse INTEGER, Physician INTEGER, Start DATETIM...
SELECT Name, COUNT(Name) FROM Appointment AS T1 JOIN Patient AS T2 ON T1.Patient = T2.SSN GROUP BY Name ORDER BY COUNT(Name)
nvbench
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 * FROM person_info JOIN hz_info JOIN zyjzjlb 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 WHERE person_info.XM = '王涵菡' AND hz_info.YLJGDM = '0517581' AND NOT zyjzjlb.JZKSMC LIKE '%美容%'
css
CREATE TABLE table_name_12 ( attendance VARCHAR, loss VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the game had a loss of Koch (0-1) what was the attendance?
SELECT attendance FROM table_name_12 WHERE loss = "koch (0-1)"
sql_create_context
CREATE TABLE table_73653 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "U.S. viewers (million)" text, "Original air date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many millions o...
SELECT "U.S. viewers (million)" FROM table_73653 WHERE "Title" = 'Company Man'
wikisql
CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufac...
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, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ORLANDO' AND date_day.day_number = 23 AND date_day.month_number = 4 AND d...
atis
CREATE TABLE people ( people_id number, name text, age number, height number, hometown text ) CREATE TABLE gymnast ( gymnast_id number, floor_exercise_points number, pommel_horse_points number, rings_points number, vault_points number, parallel_bars_points number, horizo...
SELECT name FROM people ORDER BY name
spider
CREATE TABLE table_204_4 ( id number, "date" text, "race" text, "competition" text, "rider" text, "country" text, "location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what are the number of times tour of qatar is listed as the race ?
SELECT COUNT(*) FROM table_204_4 WHERE "race" = 'tour of qatar'
squall
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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "0" AND diagnoses.short_title = "Angioneurotic edema"
mimicsql_data
CREATE TABLE table_name_80 ( teams VARCHAR, season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which team had a season 1954-55?
SELECT teams FROM table_name_80 WHERE season = "1954-55"
sql_create_context
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), ...
SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history)
nvbench
CREATE TABLE table_name_62 ( population_112008 INTEGER, population_per_square_km VARCHAR, population_112006 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the least population 1.1.2008 with population per square km of 1.957 and population 1.1.2006 l...
SELECT MIN(population_112008) FROM table_name_62 WHERE population_per_square_km = 1.957 AND population_112006 < 12.67
sql_create_context
CREATE TABLE table_name_96 ( operator_s_ VARCHAR, reserves VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which operator has a Reserve of 100 bbbl?
SELECT operator_s_ FROM table_name_96 WHERE reserves = "100 bbbl"
sql_create_context
CREATE TABLE table_39617 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total round for a wide receiver with an overall of more than 145?
SELECT COUNT("Round") FROM table_39617 WHERE "Position" = 'wide receiver' AND "Overall" > '145'
wikisql
CREATE TABLE table_32055 ( "Title" text, "Year" real, "ISBN" text, "Volume" text, "Strips" text, "Pages" real, "Colors" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the title for pages of 96
SELECT "Title" FROM table_32055 WHERE "Pages" = '96'
wikisql
CREATE TABLE table_61693 ( "Date From" text, "Date To" text, "Position" text, "Name" text, "From" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date for the MF position and player Jennison Myrie-Williams?
SELECT "Date From" FROM table_61693 WHERE "Position" = 'mf' AND "Name" = 'jennison myrie-williams'
wikisql
CREATE TABLE table_203_724 ( 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. -- poland and south africa combined for how many total medals ?
SELECT SUM("total") FROM table_203_724 WHERE "nation" IN ('poland', 'south africa')
squall
CREATE TABLE table_name_74 ( finish VARCHAR, qual VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What finish qualified at 141.071?
SELECT finish FROM table_name_74 WHERE qual = "141.071"
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 COUNT(*) FROM mzjzjlb WHERE mzjzjlb.YLJGDM = '4671519' AND mzjzjlb.JZKSRQ BETWEEN '2001-01-01' AND '2021-09-10' AND mzjzjlb.TXBZ > 0
css
CREATE TABLE table_25017530_6 ( cfl_team VARCHAR, college VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the cfl team for saskatchewan
SELECT cfl_team FROM table_25017530_6 WHERE college = "Saskatchewan"
sql_create_context
CREATE TABLE table_75010 ( "Series Ep." text, "Episode" real, "Netflix" text, "Segment A" text, "Segment B" text, "Segment C" text, "Segment D" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Episode smaller than 210 had what segment c?
SELECT "Segment C" FROM table_75010 WHERE "Episode" < '210'
wikisql
CREATE TABLE table_name_63 ( turbo VARCHAR, frequency VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the turbo when the frequency is 2.2 ghz?
SELECT turbo FROM table_name_63 WHERE frequency = "2.2 ghz"
sql_create_context
CREATE TABLE table_name_78 ( race VARCHAR, jockey VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Race that Jockey of d. nikolic is in?
SELECT race FROM table_name_78 WHERE jockey = "d. nikolic"
sql_create_context
CREATE TABLE follows ( f1 int(11), f2 int(11) ) CREATE TABLE tweets ( id bigint(20), uid int(11), text char(140), createdate datetime ) CREATE TABLE user_profiles ( uid int(11), name varchar(255), email varchar(255), partitionid int(11), followers int(11) ) -- Using valid...
SELECT name, partitionid FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid = T2.uid
nvbench
CREATE TABLE table_name_49 ( weeks_on_chart INTEGER, peak_position VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the most weeks on chart when the peak position is less than 5 and from Sweden?
SELECT MAX(weeks_on_chart) FROM table_name_49 WHERE peak_position < 5 AND country = "sweden"
sql_create_context
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "DISC-TRAN CANCER/CHLDRN H" AND procedures.icd9_code = "8856"
mimicsql_data
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAd...
SELECT * FROM Votes, Users WHERE Votes.UserId = Users.Id AND Users.AccountId = '##UserId:int##'
sede
CREATE TABLE classification ( id int, msid int, gid int ) CREATE TABLE tags ( id int, msid int, kid int ) CREATE TABLE movie ( mid int, title text, release_year int, title_aka text, budget text ) CREATE TABLE tv_series ( sid int, title text, release_year int, ...
SELECT name FROM actor WHERE birth_city = 'Tehran'
imdb
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Personality disorder NOS" AND lab.flag = "delta"
mimicsql_data
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dod_year <= "2186.0" AND diagnoses.long_title = "Hyperacusis"
mimicsql_data
CREATE TABLE table_203_183 ( id number, "season" text, "tier" number, "division" number, "place" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the highest ranking the team has ever received ?
SELECT MIN("place") FROM table_203_183
squall
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 Tags ( Id number, TagName text, Count number, Ex...
SELECT q.Id, q.Score, q.AnswerCount AS "answers", CONCAT(q.OwnerDisplayName, u.DisplayName) AS "author", q.Title, q.Tags FROM Posts AS q LEFT JOIN Users AS u ON q.OwnerUserId = u.Id WHERE q.PostTypeId = 1 AND q.Tags LIKE '%<##Tag##>%' ORDER BY q.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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2131.0" AND procedures.long_title = "Infusion of vasopressor agent"
mimicsql_data
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE microlab ( microlabid number, ...
SELECT microlab.organism FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-23605')) AND microlab.culturesite = 'urine, catheter specimen' AND DA...
eicu
CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE paperfield ( ...
SELECT DISTINCT COUNT(cite.citedpaperid) FROM author, cite, paper, writes WHERE author.authorname = 'noah a smith' AND paper.paperid = cite.citedpaperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
scholar
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "MARRIED" AND lab."CATEGORY" = "Chemistry"
mimicsql_data
CREATE TABLE Office_locations ( building_id int, company_id int, move_in_year int ) CREATE TABLE Companies ( id int, name text, Headquarters text, Industry text, Sales_billion real, Profits_billion real, Assets_billion real, Market_Value_billion text ) CREATE TABLE building...
SELECT T2.name, COUNT(T2.name) FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T2.name
nvbench
CREATE TABLE table_10960039_1 ( pick__number INTEGER, college VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is McMaster College's pick number?
SELECT MIN(pick__number) FROM table_10960039_1 WHERE college = "McMaster"
sql_create_context
CREATE TABLE table_34438 ( "Date" text, "Label" text, "Region" text, "Format" text, "Catalog" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What shows as the format for catalog 11 135?
SELECT "Format" FROM table_34438 WHERE "Catalog" = '11 135'
wikisql
CREATE TABLE table_68154 ( "Place" text, "Name" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What place has a To par of +4 and a score of 74-70-74-74=292?
SELECT "Place" FROM table_68154 WHERE "To par" = '+4' AND "Score" = '74-70-74-74=292'
wikisql
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Medicaid" AND demographic.admityear < "2105"
mimicsql_data
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, ...
SELECT MIN(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 52736) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'albumin')
mimic_iii
CREATE TABLE table_name_72 ( total INTEGER, country VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the total for united states player phil mickelson?
SELECT MIN(total) FROM table_name_72 WHERE country = "united states" AND player = "phil mickelson"
sql_create_context
CREATE TABLE Documents ( document_type_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the document type code with fewer than 3 documents.
SELECT document_type_code FROM Documents GROUP BY document_type_code HAVING COUNT(*) < 3
sql_create_context
CREATE TABLE table_45502 ( "Original NFL team" text, "Player" text, "Pos." text, "College" text, "Conf." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player had a conference of PAC-10 and position of G?
SELECT "Player" FROM table_45502 WHERE "Conf." = 'pac-10' AND "Pos." = 'g'
wikisql
CREATE TABLE table_name_23 ( heat INTEGER, lane VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest heat for more than 3 lanes and a time of 2:09.12?
SELECT MAX(heat) FROM table_name_23 WHERE lane > 3 AND time = "2:09.12"
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 MED_SER_ORG_NO FROM t_kc21 WHERE PERSON_ID = '11260648' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE SOC_SRT_DIRE_NM = '氟哌啶醇片(糖衣)')
css
CREATE TABLE table_60075 ( "Team 1" text, "Agg." text, "Team 2" text, "1st leg" text, "2nd leg" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2nd leg of pelister team 2?
SELECT "2nd leg" FROM table_60075 WHERE "Team 2" = 'pelister'
wikisql
CREATE TABLE table_name_64 ( name VARCHAR, time VARCHAR, nationality VARCHAR, heat VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the name when the heat is less than 3, the rank is less than 18, the nationality is east germa...
SELECT name FROM table_name_64 WHERE heat < 3 AND rank < 18 AND nationality = "east germany" AND time = "2:35.31"
sql_create_context
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Code
nvbench
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 PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE varchar(50), PROF_EXTENSION varchar(4), ...
SELECT SCHOOL_CODE, COUNT(DISTINCT DEPT_ADDRESS) FROM DEPARTMENT
nvbench
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 COUNT(*) 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 mzjzjlb.JZKSRQ BETWEEN '2007-04-24' AND '2014-10-25' AND mzjzjlb.YLJGDM = '4381298'
css
CREATE TABLE table_203_376 ( id number, "no." number, "name" text, "term of office" text, "president(s) served under" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what were the number of directors that stayed in office more than three years ?
SELECT COUNT("name") FROM table_203_376 WHERE "term of office" - "term of office" > 3
squall
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, h...
SELECT t1.celllabel FROM (SELECT intakeoutput.celllabel, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM intakeoutput WHERE intakeoutput.cellpath LIKE '%output%' AND DATETIME(intakeoutput.intakeoutputtime) >= DATETIME(CURRENT_TIME(), '-1 year') GROUP BY intakeoutput.celllabel) AS t1 WHERE t1.c1 <= 3
eicu
CREATE TABLE table_name_41 ( points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many points does Club have?
SELECT points FROM table_name_41 WHERE "club" = "club"
sql_create_context
CREATE TABLE table_name_61 ( constructor VARCHAR, driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What company constructed the vehicle when the driver shows as not held?
SELECT constructor FROM table_name_61 WHERE driver = "not held"
sql_create_context
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId ...
SELECT Users.DisplayName, Users.Id AS "user_link" FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.Id = PostTags.PostId INNER JOIN Users ON Users.Id = Posts.OwnerUserId WHERE TagName = '##tagname##' AND LOWER(Location) = LOWER('##pais##') GROUP BY Users.Id, Users.DisplayName
sede
CREATE TABLE table_69107 ( "Match" text, "Date" text, "Location" text, "Lineup" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the lineup that resulted in 1-0 AET W?
SELECT "Lineup" FROM table_69107 WHERE "Result" = '1-0 aet w'
wikisql
CREATE TABLE table_1912713_2 ( 方位_direction VARCHAR, 性情_personality VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of gentle personalities?
SELECT COUNT(方位_direction) FROM table_1912713_2 WHERE 性情_personality = "Gentle"
sql_create_context
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 * 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 = '80814674' AND hz_info.YLJGDM = '0600104' AND mzjzjlb.JZZDSM LIKE '%牙龈%'
css
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 procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "Endovascular (total) embolization or occlusion of head and neck vessels" AND lab."CATEGORY" = "Blood Gas"
mimicsql_data
CREATE TABLE table_76418 ( "Season" text, "Series" text, "Team" text, "Races" text, "Wins" text, "Poles" text, "F/Laps" text, "Podiums" text, "Points" text, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were the ...
SELECT "Points" FROM table_76418 WHERE "Podiums" = '5'
wikisql
CREATE TABLE table_25037577_1 ( high_school_principal VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many high school principals were there in 2000-2001?
SELECT high_school_principal FROM table_25037577_1 WHERE year = "2000-2001"
sql_create_context
CREATE TABLE table_3978 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of colleges for jerome pathon
SELECT COUNT("College") FROM table_3978 WHERE "Player" = 'Jerome Pathon'
wikisql
CREATE TABLE table_name_87 ( gold INTEGER, silver INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- I want the sum of gold for silver being less than 0
SELECT SUM(gold) FROM table_name_87 WHERE silver < 0
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = "F" AND lab.label = "RBC"
mimicsql_data
CREATE TABLE table_name_30 ( to_par VARCHAR, money___£__ VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the to par with money of 200,000 for australia
SELECT to_par FROM table_name_30 WHERE money___£__ = "200,000" AND country = "australia"
sql_create_context
CREATE TABLE table_name_23 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What 1997 has grand slams for the 1999?
SELECT 1997 FROM table_name_23 WHERE 1999 = "grand slams"
sql_create_context
CREATE TABLE table_204_314 ( id number, "pos" number, "team" text, "played" number, "won" number, "draw" number, "lost" number, "goals for" number, "goals against" number, "goal difference" number, "points" number, "notes" text ) -- Using valid SQLite, answer the follow...
SELECT "draw" FROM table_204_314 WHERE "team" = 'ibv'
squall
CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE airline ( airline_code 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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANT...
atis
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE area ( course_id int, area varchar ) ...
SELECT COUNT(*) > 0 FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias0 WHERE COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id AND NOT COURSEalias0.course_id IN...
advising
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 mzjzjlb.SG, mzjzjlb.TZ 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 = '喻英锐'
css
CREATE TABLE table_name_32 ( to_par INTEGER, year_s__won VARCHAR, total VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much To par has a Total larger than 149, and a Country of united states, and a Year(s) won of 1997?
SELECT SUM(to_par) FROM table_name_32 WHERE total > 149 AND country = "united states" AND year_s__won = "1997"
sql_create_context
CREATE TABLE table_203_800 ( id number, "#" number, "president" text, "president's party" text, "senate with" number, "senate opposed" number, "house with" number, "house opposed" number, "years served" number, "elections won" number ) -- Using valid SQLite, answer the followin...
SELECT "elections won" FROM table_203_800 WHERE "president" = 'william mckinley'
squall
CREATE TABLE table_1341707_15 ( incumbent VARCHAR, first_elected VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which incumbent was first elected in 1964?
SELECT incumbent FROM table_1341707_15 WHERE first_elected = "1964"
sql_create_context
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 SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t2.diagnosistime) > 4 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOI...
eicu
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 COUNT(DISTINCT PERSON_ID) FROM t_kc21 WHERE MED_SER_ORG_NO = '7149475' AND (REMOTE_SETTLE_FLG = '异地1' OR REMOTE_SETTLE_FLG = '异地2')
css
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), ...
SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21'
nvbench
CREATE TABLE table_6214 ( "Election date" real, "Party leader" text, "Number of votes received" text, "Percentage of votes" text, "Number of deputies" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the average election year that has less th...
SELECT AVG("Election date") FROM table_6214 WHERE "Number of deputies" < '136' AND "Number of votes received" = '1,560,753'
wikisql
CREATE TABLE table_74771 ( "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. -- Who is the home team when melbourne is the away ...
SELECT "Home team score" FROM table_74771 WHERE "Away team" = 'melbourne'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
SELECT 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 = '022-98345')) AND lab.labname = '-lymphs' AND STRFTIME('%y-%m', lab.labresulttime) =...
eicu
CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, Du...
SELECT Score, SUM(CASE PostTypeId WHEN 1 THEN 1 ELSE 0 END) AS "Questions", SUM(CASE PostTypeId WHEN 2 THEN 1 ELSE 0 END) AS "Answers" FROM Posts WHERE OwnerUserId = '##UserId:int##' GROUP BY Score ORDER BY Score
sede
CREATE TABLE table_12094300_1 ( interview VARCHAR, state VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score for the interview for the state of New York?
SELECT interview FROM table_12094300_1 WHERE state = "New York"
sql_create_context
CREATE TABLE table_name_14 ( country VARCHAR, year_s__won VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What county won in 1991?
SELECT country FROM table_name_14 WHERE year_s__won = "1991"
sql_create_context
CREATE TABLE table_51666 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of the grid for mika h kkinen and more than 45 laps?
SELECT COUNT("Grid") FROM table_51666 WHERE "Driver" = 'mika häkkinen' AND "Laps" > '45'
wikisql
CREATE TABLE table_name_26 ( year INTEGER, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was in Aigburth?
SELECT MAX(year) FROM table_name_26 WHERE venue = "aigburth"
sql_create_context
CREATE TABLE table_45809 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Billy Ray Brown plays for what country?
SELECT "Country" FROM table_45809 WHERE "Player" = 'billy ray brown'
wikisql
CREATE TABLE table_name_24 ( race VARCHAR, track VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What race happened at pocono on 08-02-2008?
SELECT race FROM table_name_24 WHERE track = "pocono" AND date = "08-02-2008"
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 labevents ( row_id number, subject_id number, hadm_id number, itemid number, chart...
SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'oth perc proc bil trct')
mimic_iii
CREATE TABLE fielding ( player_id TEXT, year INTEGER, stint INTEGER, team_id TEXT, league_id TEXT, pos TEXT, g INTEGER, gs NUMERIC, inn_outs NUMERIC, po NUMERIC, a NUMERIC, e NUMERIC, dp NUMERIC, pb NUMERIC, wp NUMERIC, sb NUMERIC, cs NUMERIC, zr N...
SELECT yearid, COUNT(*) FROM hall_of_fame GROUP BY yearid ORDER BY yearid DESC
nvbench
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT; MYOMECTOMY/SDA" AND demographic.dod_year <= "2111.0"
mimicsql_data
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 CloseReasonTypes ( Id number, Name text, Description...
WITH firstpostids_cte AS (SELECT MIN(Id) AS MinId, OwnerUserId FROM Posts WHERE PostTypeId = 1 GROUP BY OwnerUserId), firstpostsclosed_cte AS (SELECT p.Id, p.CreationDate AS cre, p.ClosedDate AS clo FROM firstpostids_cte AS fp JOIN Posts AS p ON fp.MinId = p.Id) SELECT LAST_DATE_OF_MONTH(cre), ROUND((COUNT(clo)) * 100....
sede
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/HAITIAN" AND demographic.admityear < "2123"
mimicsql_data
CREATE TABLE table_31298 ( "Round" real, "Country" text, "Circuit" text, "Date" text, "Pole Position" text, "Fastest Lap" text, "Winning Rider" text, "Winning Team" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who ha...
SELECT "Fastest Lap" FROM table_31298 WHERE "Round" = '1'
wikisql
CREATE TABLE table_3735 ( "Club" text, "Played" text, "Won" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Bonus points" text, "Points" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many bonus points...
SELECT "Bonus points" FROM table_3735 WHERE "Points for" = '379'
wikisql
CREATE TABLE table_45289 ( "Rank" text, "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 Nation, when the number of Bronze is less than 17, and when the number of Gold i...
SELECT "Nation" FROM table_45289 WHERE "Bronze" < '17' AND "Gold" < '16'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number,...
SELECT SUM(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 = '015-33796') AND NOT patient.unitdischargetime IS...
eicu