instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_6516 ( "Round" real, "Pick" real, "Player" text, "Position" text, "School" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what player went to ul-monroe
SELECT "Player" FROM table_6516 WHERE "School" = 'ul-monroe'
wikisql
CREATE TABLE table_31898 ( "Rank" real, "Name" text, "Team" text, "Goals" real, "Appearances" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the sum of ranks of those called Fernando Cavenaghi who appeared less than 7.
SELECT SUM("Rank") FROM table_31898 WHERE "Name" = 'fernando cavenaghi' AND "Appearances" < '7'
wikisql
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_labitems...
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 83225 AND STRFTIME('%y', admissions.admittime) = '2104' ORDER BY admissions.admittime LIMIT 1
mimic_iii
CREATE TABLE table_19400 ( "Round" real, "Circuit" text, "Date" text, "Length" text, "Pole Position" text, "GT3 Winner" text, "GT4 Winner" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the circuit for gt3 alex mortimer bradley ellis
SELECT "Circuit" FROM table_19400 WHERE "GT3 Winner" = 'Alex Mortimer Bradley Ellis'
wikisql
CREATE TABLE table_name_44 ( year INTEGER, entrant VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year featured lola motorsport as an entrant with over 0 points?
SELECT AVG(year) FROM table_name_44 WHERE entrant = "lola motorsport" AND points > 0
sql_create_context
CREATE TABLE table_name_6 ( erp_w INTEGER, frequency_mhz INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average value for ERP W when frequency is more than 100.1?
SELECT AVG(erp_w) FROM table_name_6 WHERE frequency_mhz > 100.1
sql_create_context
CREATE TABLE table_47948 ( "Institution" text, "Location" text, "Founded" real, "Affiliation" text, "Nickname" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the lowest Founded with the Name cougars?
SELECT MIN("Founded") FROM table_47948 WHERE "Nickname" = 'cougars'
wikisql
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '83001466' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2005-05-20' AND '2014-06-18' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE table_name_20 ( laps INTEGER, grid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many laps were completed in grid 18?
SELECT SUM(laps) FROM table_name_20 WHERE grid = 18
sql_create_context
CREATE TABLE table_name_8 ( owner VARCHAR, format VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the owner of the radio station that plays adult hits?
SELECT owner FROM table_name_8 WHERE format = "adult hits"
sql_create_context
CREATE TABLE table_name_25 ( name VARCHAR, sport VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the names for the medalist in the sport of canoeing?
SELECT name FROM table_name_25 WHERE sport = "canoeing"
sql_create_context
CREATE TABLE table_5928 ( "Country" text, "Project Name" text, "Year startup" text, "Operator" text, "Peak" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the startup year for the project with apache energy/inpex as the operator?
SELECT "Year startup" FROM table_5928 WHERE "Operator" = 'apache energy/inpex'
wikisql
CREATE TABLE table_203_272 ( id number, "title" text, "release" text, "consoles" text, "handheld" text, "pc" text, "arcade" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many gaming consoles in total were nfl blitz released for ?
SELECT COUNT(DISTINCT "consoles") FROM table_203_272
squall
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 All_Neutral, Team_ID FROM basketball_match ORDER BY Team_ID
nvbench
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.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Manufacturer DESC
nvbench
CREATE TABLE table_name_75 ( record VARCHAR, round VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was Diego Saraiva's record when he fought for 3 rounds against danny suarez?
SELECT record FROM table_name_75 WHERE round = "3" AND opponent = "danny suarez"
sql_create_context
CREATE TABLE table_name_34 ( purpose VARCHAR, callsign VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Callsign of 6nan has what purpose?
SELECT purpose FROM table_name_34 WHERE callsign = "6nan"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "NEWBORN" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE field ( fieldid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, ...
SELECT DISTINCT AUTHOR_1.authorid FROM author AS AUTHOR_0, author AS AUTHOR_1, writes AS WRITES_0, writes AS WRITES_1 WHERE AUTHOR_0.authorname = 'chasins' AND WRITES_0.authorid = AUTHOR_0.authorid AND WRITES_1.authorid = AUTHOR_1.authorid AND WRITES_1.paperid = WRITES_0.paperid
scholar
CREATE TABLE table_20350 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who sc...
SELECT "High rebounds" FROM table_20350 WHERE "Team" = 'Chicago'
wikisql
CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Dorm ( dormid INTEGER, dorm_name VARCHAR(20), student_capacity INTEGER, gender VARCHAR(1) ) CREATE TABLE Has_amenity ( dormid INTEGER, amenid INTEGER ) CREATE TABLE Student ( StuID INTEGE...
SELECT Fname, COUNT(Fname) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.dorm_name = 'Smith Hall' GROUP BY Fname
nvbench
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL v...
SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY AVG(SALARY)
nvbench
CREATE TABLE table_23201 ( "Institution" text, "Location" text, "Nickname" text, "Founded" real, "Type" text, "Enrollment" real, "Joined" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the school that was founded in 1950
SELECT "Institution" FROM table_23201 WHERE "Founded" = '1950'
wikisql
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 t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE STRFTIME('%y', diagnosis.diagnosistime) <= '2104' GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 3
eicu
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.RYBH = '...
css
CREATE TABLE table_name_12 ( nationality VARCHAR, round VARCHAR, nhl_team VARCHAR, college_junior_club_team__league_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the Nationality of Round 8 Vancouver Canucks NHL Team of Swift Current Broncos ...
SELECT nationality FROM table_name_12 WHERE nhl_team = "vancouver canucks" AND college_junior_club_team__league_ = "swift current broncos (whl)" AND round = 8
sql_create_context
CREATE TABLE table_69585 ( "Birth" text, "Marriage" text, "Became Consort" text, "Ceased to be Consort" text, "Death" text, "Spouse" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the became consort for ceased to be consort of 4 april 1588 ...
SELECT "Became Consort" FROM table_69585 WHERE "Ceased to be Consort" = '4 april 1588 husband''s death'
wikisql
CREATE TABLE table_204_268 ( id number, "album/single" text, "performer" text, "year" number, "variant" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many albums are performed by martin carthy or ewan maccoll ?
SELECT COUNT("album/single") FROM table_204_268 WHERE "performer" IN ('martin carthy', 'ewan maccoll')
squall
CREATE TABLE campuses ( id VARCHAR, campus VARCHAR ) CREATE TABLE faculty ( campus VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of faculty lines in campus 'Long Beach State University' in 2002?
SELECT faculty FROM faculty AS T1 JOIN campuses AS T2 ON T1.campus = T2.id WHERE T1.year = 2002 AND T2.campus = "Long Beach State University"
sql_create_context
CREATE TABLE Has_amenity ( dormid INTEGER, amenid INTEGER ) CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Dorm ( dormid INTEGER, dorm_name VARCHAR(20), student_capacity INTEGER, gender VARCHAR(1) ) CREATE TABLE Student ( StuID INTEGE...
SELECT city_code, COUNT(*) FROM Student GROUP BY city_code ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2175" AND diagnoses.short_title = "Poison-psychotropic agt"
mimicsql_data
CREATE TABLE table_11910 ( "Model" text, "Released" text, "Form factor" text, "Chipset" text, "Memory Type" text, "Max. Memory" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the memory type with a form factor of 15.4', and a Model of pr...
SELECT "Memory Type" FROM table_11910 WHERE "Form factor" = '15.4' AND "Model" = 'precision m65'
wikisql
CREATE TABLE table_34247 ( "Kanji" text, "Name" text, "Builder" text, "Laid down" text, "Launched" text, "Completed" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the launch date for the Ushio dd-54?
SELECT "Launched" FROM table_34247 WHERE "Name" = 'ushio dd-54'
wikisql
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE microbiologyeve...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.careunit = 'tsicu' AND DATETIME(transfers.intime) <= DATETIME(CURRENT_TIME(), '-2 year'))
mimic_iii
CREATE TABLE table_203_711 ( id number, "name" text, "age" number, "hometown" text, "occupation" text, "culinary p.o.v." text, "eliminated" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who was the top chef ?
SELECT "name" FROM table_203_711 ORDER BY id LIMIT 1
squall
CREATE TABLE table_name_27 ( engine VARCHAR, chassis VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What engine was in the lotus 44 f2 Chassis?
SELECT engine FROM table_name_27 WHERE chassis = "lotus 44 f2"
sql_create_context
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) 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 var...
SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EARTH' AND course.number = 259 AND semester.semester = 'Spring-Summer' AND semester.semester_id = course_offering.semester
advising
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 microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time,...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 95892 AND admissions.dischtime IS NULL)) AND transfers....
mimic_iii
CREATE TABLE table_15627 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the competition type when the score is 1-1?
SELECT "Competition" FROM table_15627 WHERE "Score" = '1-1'
wikisql
CREATE TABLE table_name_21 ( geo_id INTEGER, water__sqmi_ VARCHAR, township VARCHAR, land___sqmi__ VARCHAR, latitude VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the geo id when the land (sqmi) is less than 36.112, the latitude is more ...
SELECT SUM(geo_id) FROM table_name_21 WHERE land___sqmi__ < 36.112 AND latitude > 47.536618 AND township = "west bay" AND water__sqmi_ > 0.209
sql_create_context
CREATE TABLE table_51149 ( "Tribunal" text, "Number of autos da f\u00e9 with known sentences" text, "Executions in persona" text, "Executions in effigie" text, "Penanced" text, "Total" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many were...
SELECT "Penanced" FROM table_51149 WHERE "Number of autos da f\u00e9 with known sentences" = '71 (1600–1773)'
wikisql
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB ...
css
CREATE TABLE table_name_90 ( case_length VARCHAR, rim_diameter VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Case length has a Rim diameter of 13.20 (.518)?
SELECT case_length FROM table_name_90 WHERE rim_diameter = "13.20 (.518)"
sql_create_context
CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE field ( fieldid int ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE ...
SELECT DISTINCT AUTHOR_1.authorid FROM author AS AUTHOR_0, author AS AUTHOR_1, writes AS WRITES_0, writes AS WRITES_1 WHERE AUTHOR_0.authorname = 'chasins' AND WRITES_0.authorid = AUTHOR_0.authorid AND WRITES_1.authorid = AUTHOR_1.authorid AND WRITES_1.paperid = WRITES_0.paperid
scholar
CREATE TABLE Ref_Budget_Codes ( Budget_Type_code VARCHAR, budget_type_Description VARCHAR ) CREATE TABLE Documents_with_expenses ( document_id VARCHAR, Budget_Type_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show ids for all documents with b...
SELECT T1.document_id FROM Documents_with_expenses AS T1 JOIN Ref_Budget_Codes AS T2 ON T1.Budget_Type_code = T2.Budget_Type_code WHERE T2.budget_type_Description = "Government"
sql_create_context
CREATE TABLE table_1104312_5 ( english_name VARCHAR, area_in_km² VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many districts have an area of 17.72 KM2?
SELECT COUNT(english_name) FROM table_1104312_5 WHERE area_in_km² = "17.72"
sql_create_context
CREATE TABLE table_name_97 ( reported_death_date VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the reported death date for laura svehaug?
SELECT reported_death_date FROM table_name_97 WHERE name = "laura svehaug"
sql_create_context
CREATE TABLE table_14308895_2 ( country_territory VARCHAR, former_pageant VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which country has miss universe Hungary as former pageant?
SELECT country_territory FROM table_14308895_2 WHERE former_pageant = "Miss Universe Hungary"
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Infection with microorganisms resistant to penicillins" AND lab."CATEGORY" = "Chemistry"
mimicsql_data
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE bdmzjzjlb ( HXPLC number, HZX...
SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jyb...
css
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, De...
SELECT ProfileImageUrl FROM Users WHERE Id = '##UserID##'
sede
CREATE TABLE table_42104 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What i...
SELECT "Record" FROM table_42104 WHERE "Game" < '3' AND "Score" = 'l 91–96 (ot)'
wikisql
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 ...
WITH Raw AS (SELECT DAY(Votes.CreationDate) AS DoM, COUNT(*) AS Count FROM Posts, Votes, PostTags WHERE Votes.PostId = Posts.Id AND Posts.ParentId = PostTags.PostId AND Votes.VoteTypeId BETWEEN 1 AND 2 AND PostTags.TagId = @TagId GROUP BY DAY(Votes.CreationDate)), Raw2 AS (SELECT DoM, CASE WHEN DoM = 31 THEN 12.0 / 7 W...
sede
CREATE TABLE table_name_90 ( home VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the home team when the score was 0:1?
SELECT home FROM table_name_90 WHERE score = "0:1"
sql_create_context
CREATE TABLE table_18301 ( "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 was the outcome of the election in Pennsylvania 6 district?
SELECT "Result" FROM table_18301 WHERE "District" = 'Pennsylvania 6'
wikisql
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 All_Road, Team_ID FROM basketball_match ORDER BY All_Road DESC
nvbench
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT jybgb.JYLX FROM jybgb WHERE jybgb.BGDH = '33518078713'
css
CREATE TABLE table_name_33 ( date VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Date of the Crystal Palace Away game?
SELECT date FROM table_name_33 WHERE away_team = "crystal palace"
sql_create_context
CREATE TABLE table_16226584_1 ( length_feet VARCHAR, length_meters VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many feet in length are there when the length is 106.1 meters?
SELECT COUNT(length_feet) FROM table_16226584_1 WHERE length_meters = "106.1"
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 (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 = '002-44624' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi...
eicu
CREATE TABLE table_3990 ( "No. in series" text, "No. in season" text, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the epi...
SELECT "Title" FROM table_3990 WHERE "Production code" = '418'
wikisql
CREATE TABLE table_1912276_2 ( __500m VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the -500 number for Theo Bos?
SELECT __500m FROM table_1912276_2 WHERE name = "Theo Bos"
sql_create_context
CREATE TABLE county ( County_Id int, County_name text, Population real, Zip_code text ) CREATE TABLE party ( Party_ID int, Year real, Party text, Governor text, Lieutenant_Governor text, Comptroller text, Attorney_General text, US_Senate text ) CREATE TABLE election ( ...
SELECT Governor, COUNT(Governor) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1 GROUP BY Governor
nvbench
CREATE TABLE table_66334 ( "Name" text, "Height" text, "Weight" text, "Spike" text, "2008 club" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Name of the Gabeca Montichiari Club?
SELECT "Name" FROM table_66334 WHERE "2008 club" = 'gabeca montichiari'
wikisql
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, las...
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 60014) AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-40 month') ORDER BY prescriptions.startdate DESC LIMIT 1
mimic_iii
CREATE TABLE table_name_89 ( week VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many weeks have pittsburgh steelers as the opponent?
SELECT COUNT(week) FROM table_name_89 WHERE opponent = "pittsburgh steelers"
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "WHITE" AND diagnoses.short_title = "Pressure ulcer, stage II"
mimicsql_data
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, d...
SELECT MIN(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5878)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart...
mimic_iii
CREATE TABLE table_55213 ( "Number & Name" text, "Description" text, "Livery" text, "Owner(s)" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date for the Operational Livery?
SELECT "Date" FROM table_55213 WHERE "Livery" = 'operational'
wikisql
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jybgb_jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND jybgb_jyjgzbb.JYZBLSH = jyjgzbb.JY...
css
CREATE TABLE table_4631 ( "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. -- What day did the home side score 14.13 (97)?
SELECT "Date" FROM table_4631 WHERE "Home team score" = '14.13 (97)'
wikisql
CREATE TABLE table_32672 ( "Rank" text, "County" text, "% (1960)" real, "% (2000)" real, "% (2040)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the % (1960) of the county with a % (2040) of 3.4?
SELECT COUNT("% (1960)") FROM table_32672 WHERE "% (2040)" = '3.4'
wikisql
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT OUT_DIAG_DIS_CD, OUT_DIAG_DIS_NM FROM t_kc21 WHERE MED_CLINIC_ID = '13686436304'
css
CREATE TABLE table_58676 ( "Place (Posici\u00f3n)" real, "Team (Equipo)" text, "Played (PJ)" real, "Won (PG)" real, "Draw (PE)" real, "Lost (PP)" real, "Goals Scored (GF)" real, "Goals Conceded (GC)" real, "+/- (Dif.)" real, "Points (Pts.)" real ) -- Using valid SQLite, answer ...
SELECT SUM("Place (Posici\u00f3n)") FROM table_58676 WHERE "Points (Pts.)" > '49' AND "Goals Scored (GF)" < '54'
wikisql
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE job_history ( EMPLO...
SELECT FIRST_NAME, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY FIRST_NAME DESC
nvbench
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND 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_MZJZ...
css
CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops int,...
SELECT DISTINCT flight.flight_id FROM airport, airport_service, city, flight WHERE airport.airport_code = 'OAK' AND city.city_code = airport_service.city_code AND city.city_name = 'PITTSBURGH' AND flight.from_airport = airport_service.airport_code AND flight.to_airport = airport.airport_code
atis
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE allergy ( allergy...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', 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 =...
eicu
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 zzmzjzjlb.JZKSRQ FROM zzmzjzjlb WHERE zzmzjzjlb.JZLSH = '21018594065' UNION SELECT fzzmzjzjlb.JZKSRQ FROM fzzmzjzjlb WHERE fzzmzjzjlb.JZLSH = '21018594065'
css
CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE Comments ( Id number, PostId number, Score nu...
SELECT TAG.Id, TAG.TagName, COUNT(*) AS numPosts FROM Posts INNER JOIN PostTags AS PT ON PT.PostId = Posts.Id INNER JOIN Tags AS TAG ON TAG.Id = PT.TagId WHERE PostTypeId = 1 AND CreationDate >= '2019-01-01T00:00:00' GROUP BY TAG.Id, TAG.TagName ORDER BY numPosts DESC
sede
CREATE TABLE table_name_80 ( week_4 VARCHAR, week_3 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which week 4 had a week 3 of Cidney Carson?
SELECT week_4 FROM table_name_80 WHERE week_3 = "cidney carson"
sql_create_context
CREATE TABLE wrestler ( Wrestler_ID int, Name text, Reign text, Days_held text, Location text, Event text ) CREATE TABLE Elimination ( Elimination_ID text, Wrestler_ID text, Team text, Eliminated_By text, Elimination_Move text, Time text ) -- Using valid SQLite, answer...
SELECT Location, COUNT(Location) FROM wrestler GROUP BY Location ORDER BY Location
nvbench
CREATE TABLE Customers ( customer_id INTEGER, customer_details VARCHAR(255) ) CREATE TABLE Timed_Locations_of_Things ( thing_id INTEGER, Date_and_Time DATETIME, Location_Code CHAR(15) ) CREATE TABLE Things ( thing_id INTEGER, organization_id INTEGER, Type_of_Thing_Code CHAR(15), se...
SELECT organization_details, COUNT(organization_details) FROM Things AS T1 JOIN Organizations AS T2 ON T1.organization_id = T2.organization_id GROUP BY organization_details ORDER BY COUNT(organization_details)
nvbench
CREATE TABLE table_name_50 ( laps INTEGER, driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average number of laps for the driver Piero Taruffi?
SELECT AVG(laps) FROM table_name_50 WHERE driver = "piero taruffi"
sql_create_context
CREATE TABLE table_1250 ( "No. in series" text, "No. Disc" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Length (minutes)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the minimum number disc fo...
SELECT MIN("No. Disc") FROM table_1250 WHERE "No. in series" = '14'
wikisql
CREATE TABLE table_name_2 ( shuji_kondo VARCHAR, pepe_michinoku VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Shuji Kondo value related to a PEPE Michinoku value of sabin (14:43)?
SELECT shuji_kondo FROM table_name_2 WHERE pepe_michinoku = "sabin (14:43)"
sql_create_context
CREATE TABLE EMPLOYEE ( EMP_NUM int, EMP_LNAME varchar(15), EMP_FNAME varchar(12), EMP_INITIAL varchar(1), EMP_JOBCODE varchar(5), EMP_HIREDATE datetime, EMP_DOB datetime ) CREATE TABLE STUDENT ( STU_NUM int, STU_LNAME varchar(15), STU_FNAME varchar(15), STU_INIT varchar(1),...
SELECT DEPT_CODE, MAX(STU_GPA) FROM STUDENT GROUP BY DEPT_CODE ORDER BY MAX(STU_GPA)
nvbench
CREATE TABLE table_name_47 ( actor VARCHAR, soap_opera VARCHAR, character VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What actor has onderweg naar morgen, as the soap opera, with aafke couwenberg as the character?
SELECT actor FROM table_name_47 WHERE soap_opera = "onderweg naar morgen" AND character = "aafke couwenberg"
sql_create_context
CREATE TABLE table_5630 ( "Frequency (MHz)" real, "Call letters" text, "Licensed location" text, "Type" text, "Format" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Type of primary, and a Call letters of kbjs has what format?
SELECT "Format" FROM table_5630 WHERE "Type" = 'primary' AND "Call letters" = 'kbjs'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "80" AND diagnoses.long_title = "Tietze's disease"
mimicsql_data
CREATE TABLE table_6495 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Attendance has a Tie # of 32?
SELECT "Attendance" FROM table_6495 WHERE "Tie no" = '32'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE bdmzjzjlb ( 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 COUNT(hz_info.RYBH) FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE wdmzjzjlb.ZZYSGH = '59407914' AND wdmzjzjlb.JZKSRQ BETWEEN '2007-04-22' AND '2019-12-24' UNION SELECT COUNT(hz_info.RYBH) FROM hz_info JOIN bdmzjzjlb ON hz_info...
css
CREATE TABLE table_37541 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Against is the highest one that has a Dra...
SELECT MAX("Against") FROM table_37541 WHERE "Drawn" > '1' AND "Team" = 'corinthians' AND "Played" < '7'
wikisql
CREATE TABLE table_test_25 ( "id" int, "ejection_fraction_ef" int, "respiratory_tract_infection" bool, "left_ventricular_ejection_fraction_lvef" int, "intra_aortic_balloon_pump_iabp" bool, "systolic_blood_pressure_sbp" int, "central_diabetes_insipidus" bool, "hyponatremia" bool, "hea...
SELECT * FROM table_test_25 WHERE heart_disease = 1
criteria2sql
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId n...
SELECT Question.Id AS "post_link", Question.CreationDate AS QuestionCreationDate, LENGTH(Answer.Body) AS AnswerLength, Answer.Score AS AnswerScore, Answer.CommentCount AS AnswerCommentCount FROM Posts AS Answer INNER JOIN Posts AS Question ON (Answer.ParentId = Question.Id) WHERE Answer.OwnerUserId = '##UserId##' AND A...
sede
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, ...
SELECT t_kc24.ILL_PAY FROM t_kc24 JOIN t_kc21_t_kc24 JOIN t_kc21 ON t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID AND t_kc21_t_kc24.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '02828086375'
css
CREATE TABLE table_40485 ( "Tournament" text, "2004" text, "2005" text, "2006" text, "2007" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Tournament has a 2004 of 1r?
SELECT "Tournament" FROM table_40485 WHERE "2004" = '1r'
wikisql
CREATE TABLE plays_games ( stuid number, gameid number, hours_played number ) CREATE TABLE sportsinfo ( stuid number, sportname text, hoursperweek number, gamesplayed number, onscholarship text ) CREATE TABLE video_games ( gameid number, gname text, gtype text ) CREATE TAB...
SELECT stuid FROM student WHERE major = 600 INTERSECT SELECT stuid FROM sportsinfo WHERE onscholarship = 'Y'
spider
CREATE TABLE Customers ( customer_id INTEGER, payment_method VARCHAR(15), customer_name VARCHAR(80), date_became_customer DATETIME, other_customer_details VARCHAR(255) ) CREATE TABLE Customer_Addresses ( customer_id INTEGER, address_id INTEGER, date_address_from DATETIME, address_ty...
SELECT active_from_date, COUNT(active_from_date) FROM Customers AS t1 JOIN Customer_Contact_Channels AS t2 ON t1.customer_id = t2.customer_id WHERE t2.channel_code = 'Email' GROUP BY customer_name
nvbench
CREATE TABLE table_29929 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What i...
SELECT "Score" FROM table_29929 WHERE "Team" = '@ Dallas'
wikisql