instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_47 ( season VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What season had a 14th position?
SELECT season FROM table_name_47 WHERE position = "14th"
sql_create_context
CREATE TABLE table_23242958_1 ( us_viewers__millions_ VARCHAR, production_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many millions of U.S. viewers watched the episode with the production code of 3AJN01?
SELECT us_viewers__millions_ FROM table_23242958_1 WHERE production_code = "3AJN01"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) 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,...
SELECT COUNT(*) FROM mzjzjlb WHERE JZKSMC = '头颈肿瘤科' AND JZKSRQ BETWEEN '2014-12-31' AND '2021-01-18'
css
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE SuggestedEditVotes ( ...
SELECT u.Id AS "user_link", u.Location AS "location", u.LastAccessDate AS "last_access", u.WebsiteUrl AS "url", u.Reputation AS "rep", u.AboutMe AS AboutMe FROM Users AS u WHERE AboutMe LIKE '##aboutme##' ORDER BY Reputation DESC LIMIT 300
sede
CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE field ( fieldid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE dat...
SELECT DISTINCT writes.paperid FROM author, writes WHERE author.authorname = 'bevan jones' AND writes.authorid = author.authorid
scholar
CREATE TABLE table_12171145_1 ( mens_doubles VARCHAR, womens_doubles VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many mens doubles when womens doubles is catrine bengtsson margit borg?
SELECT COUNT(mens_doubles) FROM table_12171145_1 WHERE womens_doubles = "Catrine Bengtsson Margit Borg"
sql_create_context
CREATE TABLE table_34880 ( "Round" real, "Player" text, "Position" text, "Nationality" text, "College/Junior/Club Team (League)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the position of Pierre Daigneault?
SELECT "Position" FROM table_34880 WHERE "Player" = 'pierre daigneault'
wikisql
CREATE TABLE appellations ( No INTEGER, Appelation TEXT, County TEXT, State TEXT, Area TEXT, isAVA TEXT ) CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases IN...
SELECT Year, AVG(MAX(Price)) FROM wine
nvbench
CREATE TABLE table_7384 ( "Year" text, "Stamp duty reserve tax" text, "Standard Stamp Duty" text, "Standard Duties Total Revenue (in \u20acmillion)" real, "over Total Tax Revenue (in %)" text, "over GDP (in %)" real ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT "over Total Tax Revenue (in %)" FROM table_7384 WHERE "Stamp duty reserve tax" = 'n.a.' AND "Year" = '1995-96'
wikisql
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description...
SELECT Score, Text, PostId AS "post_link" FROM Comments WHERE UserId = @UserId ORDER BY Score DESC, Text
sede
CREATE TABLE table_name_69 ( team VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Team with a Date with december 11?
SELECT team FROM table_name_69 WHERE date = "december 11"
sql_create_context
CREATE TABLE table_17323092_7 ( high_points VARCHAR, location_attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many players had high points in the location/attendance FedexForum 11,498 respectively?
SELECT COUNT(high_points) FROM table_17323092_7 WHERE location_attendance = "FedExForum 11,498"
sql_create_context
CREATE TABLE table_name_2 ( national_titles VARCHAR, mascot VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of national titles for the team with doane tigers as the mascot?
SELECT COUNT(national_titles) FROM table_name_2 WHERE mascot = "doane tigers"
sql_create_context
CREATE TABLE table_32230 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which venue had the result 7-1?
SELECT "Venue" FROM table_32230 WHERE "Result" = '7-1'
wikisql
CREATE TABLE manager_half ( player_id text, year number, team_id text, league_id text, inseason number, half number, g number, w number, l number, rank number ) CREATE TABLE fielding_postseason ( player_id text, year number, team_id text, league_id text, roun...
SELECT COUNT(*) FROM player WHERE birth_country = 'USA' AND bats = 'R'
spider
CREATE TABLE table_9808 ( "Rank" real, "Title" text, "Studio" text, "Director" text, "Worldwide Gross" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What director has a worldwide gross of $149,022,650 and is ranked greater than 7?
SELECT "Director" FROM table_9808 WHERE "Rank" > '7' AND "Worldwide Gross" = '$149,022,650'
wikisql
CREATE TABLE table_18512 ( "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. -- Name the candidates for result of lost renomination democratic loss
SELECT "Candidates" FROM table_18512 WHERE "Result" = 'Lost renomination Democratic loss'
wikisql
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, ...
WITH t AS (SELECT SUM(Score) AS total, DisplayName AS name, Users.Id AS Uid FROM Posts INNER JOIN PostTags ON Posts.ParentId = PostTags.PostId INNER JOIN Tags ON PostTags.TagId = Tags.Id INNER JOIN Users ON Posts.OwnerUserId = Users.Id WHERE Tags.TagName = @Tag AND Score != 0 GROUP BY Users.Id, DisplayName), q AS (SELE...
sede
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_...
SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 24762) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND chartevents...
mimic_iii
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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "WHITE" AND prescriptions.drug = "Soln."
mimicsql_data
CREATE TABLE routes ( rid number, dst_apid number, dst_ap text, src_apid number, src_ap text, alid number, airline text, codeshare text ) CREATE TABLE airlines ( alid number, name text, iata text, icao text, callsign text, country text, active text ) CREATE ...
SELECT country FROM airlines GROUP BY country ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_31059 ( "Character" text, "Original Cast, 2009" text, "Revival Cast, 2010" text, "Wales Cast, 2012" text, "New Zealand Cast, 2012" text, "Australian Cast, 2012" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In the 2012 produc...
SELECT "Wales Cast, 2012" FROM table_31059 WHERE "Australian Cast, 2012" = 'Owen Little'
wikisql
CREATE TABLE table_12939 ( "Driver" text, "Team" text, "Laps" real, "Time/Retired" text, "Grid" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest number of laps with more than 16 points?
SELECT MIN("Laps") FROM table_12939 WHERE "Points" > '16'
wikisql
CREATE TABLE table_2159506_4 ( successor VARCHAR, reason_for_change VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who are all successors when reason for change is died May 12, 1964?
SELECT successor FROM table_2159506_4 WHERE reason_for_change = "Died May 12, 1964"
sql_create_context
CREATE TABLE table_name_28 ( location VARCHAR, ihsaa_class VARCHAR, mascot VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the location of the school having the panthers as a mascot with an AAA for the IHSAA Class?
SELECT location FROM table_name_28 WHERE ihsaa_class = "aaa" AND mascot = "panthers"
sql_create_context
CREATE TABLE table_name_22 ( losses INTEGER, draws VARCHAR, against VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the greatest number of losses when there are more than 0 draws and 1390 against matches?
SELECT MAX(losses) FROM table_name_22 WHERE draws > 0 AND against = 1390
sql_create_context
CREATE TABLE table_7244 ( "Year" real, "Actor" text, "Award" text, "Series" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average year that Idris Elba was nominated for or won an award?
SELECT AVG("Year") FROM table_7244 WHERE "Actor" = 'idris elba'
wikisql
CREATE TABLE table_32032 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was Jenson Button's constructor?
SELECT "Constructor" FROM table_32032 WHERE "Driver" = 'jenson button'
wikisql
CREATE TABLE greatermanchestercrime ( crimeid text, crimets time, location text, lsoa text, type text, outcome text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What s the most common type of crime?
SELECT type FROM greatermanchestercrime GROUP BY type ORDER BY COUNT(*) DESC LIMIT 1
greatermanchestercrime
CREATE TABLE table_32008 ( "Name" text, "Circuit" text, "Date" text, "Winning drivers" text, "Winning constructor" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the race on 9 July?
SELECT "Name" FROM table_32008 WHERE "Date" = '9 july'
wikisql
CREATE TABLE table_33037 ( "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 is the largest crowd for an away team score...
SELECT MAX("Crowd") FROM table_33037 WHERE "Away team score" = '8.7 (55)'
wikisql
CREATE TABLE table_18458 ( "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. -- Who is the candidate that was first elected in 1914?
SELECT "Candidates" FROM table_18458 WHERE "First elected" = '1914'
wikisql
CREATE TABLE table_name_97 ( total INTEGER, bronze VARCHAR, silver VARCHAR, nation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was Andorra's total with less than 10 silver and more than 5 bronze?
SELECT SUM(total) FROM table_name_97 WHERE silver < 10 AND nation = "andorra" AND bronze > 5
sql_create_context
CREATE TABLE race ( name VARCHAR, CLASS VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show name, class, and date for all races.
SELECT name, CLASS, date FROM race
sql_create_context
CREATE TABLE technician ( Team VARCHAR, Starting_Year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the team and starting year of technicians?
SELECT Team, Starting_Year FROM technician
sql_create_context
CREATE TABLE host ( Host_ID int, Name text, Nationality text, Age text ) CREATE TABLE party ( Party_ID int, Party_Theme text, Location text, First_year text, Last_year text, Number_of_hosts int ) CREATE TABLE party_host ( Party_ID int, Host_ID int, Is_Main_in_Charge...
SELECT Nationality, COUNT(*) FROM host GROUP BY Nationality ORDER BY COUNT(*)
nvbench
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsysto...
SELECT t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'esophagogastroduo...
eicu
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT t_kc24.t_kc21_MED_ORG_DEPT_NM, AVG(t_kc24.OVE_PAY) FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '3519389' GROUP BY t_kc24.t_kc21_MED_ORG_DEPT_NM
css
CREATE TABLE Player ( pID numeric(5,0), pName varchar(20), yCard varchar(3), HS numeric(5,0) ) CREATE TABLE Tryout ( pID numeric(5,0), cName varchar(20), pPos varchar(8), decision varchar(3) ) CREATE TABLE College ( cName varchar(20), state varchar(2), enr numeric(5,0) ) ...
SELECT cName, enr FROM College ORDER BY enr
nvbench
CREATE TABLE table_name_45 ( name VARCHAR, assists VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the Name that has the Assists of lake (154) lake (5.1 apg)?
SELECT name FROM table_name_45 WHERE assists = "lake (154) lake (5.1 apg)"
sql_create_context
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 MED_ORG_DEPT_NM, IN_DIAG_DIS_NM, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '4652099' GROUP BY MED_ORG_DEPT_NM, IN_DIAG_DIS_NM
css
CREATE TABLE table_4892 ( "Season" real, "Teams" real, "K League Classic" text, "K-League Cup" text, "FA Cup" text, "Manager" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What K League classic had less than 10 teams?
SELECT "K League Classic" FROM table_4892 WHERE "Teams" < '10'
wikisql
CREATE TABLE table_name_43 ( religion VARCHAR, scheduled_tribe VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE RELIGION WITH A SCHEDULED TRIBE OF 0.90%?
SELECT religion FROM table_name_43 WHERE scheduled_tribe = "0.90%"
sql_create_context
CREATE TABLE table_23377 ( "Year" text, "Division" text, "League" text, "Regular Season" text, "Playoffs" text, "Open Cup" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When final is the open cup what is the league?
SELECT "League" FROM table_23377 WHERE "Open Cup" = 'Final'
wikisql
CREATE TABLE table_72944 ( "Player" text, "Team" text, "Matches" real, "Overs" text, "Runs" real, "Wickets" real, "Best" text, "Econ" text, "S/Rate" text, "4/inns" real, "5+/inns" real, "Average" text ) -- Using valid SQLite, answer the following questions for the table...
SELECT MIN("Matches") FROM table_72944 WHERE "Runs" = '276'
wikisql
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
SELECT Founder, SUM(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY SUM(Revenue) DESC
nvbench
CREATE TABLE table_75564 ( "Name" text, "Pada 1" text, "Pada 2" text, "Pada 3" text, "Pada 4" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which Pada 3 has a Pada 2 of che?
SELECT "Pada 3" FROM table_75564 WHERE "Pada 2" = 'चे che'
wikisql
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instruc...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Intermediate Natural Resource Economics%' OR course.description LIKE '%Intermediate Natural Reso...
advising
CREATE TABLE table_27404 ( "Language" text, "Sorata Municipality" text, "Guanay Municipality" text, "Tacacoma Municipality" text, "Quiabaya Municipality" text, "Combaya Municipality" text, "Tipuani Municipality" text, "Mapiri Municipality" text, "Teoponte Municipality" text ) -- Us...
SELECT "Tipuani Municipality" FROM table_27404 WHERE "Tacacoma Municipality" = '6'
wikisql
CREATE TABLE table_16153 ( "Country" text, "Membership (from 2010)" real, "Name of member organization" text, "Year current Scouting organization joined WOSM" text, "Year member organization was founded" text, "Admits boys/girls" text ) -- Using valid SQLite, answer the following questions for...
SELECT "Admits boys/girls" FROM table_16153 WHERE "Name of member organization" = 'The Scout Association of Hong Kong'
wikisql
CREATE TABLE table_name_94 ( home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was Hawthorn's score as the home team?
SELECT home_team AS score FROM table_name_94 WHERE home_team = "hawthorn"
sql_create_context
CREATE TABLE diagnoses ( 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 ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Exceptionally large baby"
mimicsql_data
CREATE TABLE Documents_to_be_Destroyed ( Document_ID INTEGER, Destruction_Authorised_by_Employee_ID INTEGER, Destroyed_by_Employee_ID INTEGER, Planned_Destruction_Date DATETIME, Actual_Destruction_Date DATETIME, Other_Details VARCHAR(255) ) CREATE TABLE Ref_Document_Types ( Document_Type_Co...
SELECT Location_Code, COUNT(*) FROM Document_Locations GROUP BY Location_Code
nvbench
CREATE TABLE Products ( product_id INTEGER, product_type_code VARCHAR(15), product_name VARCHAR(80), product_price DOUBLE ) CREATE TABLE Contacts ( contact_id INTEGER, customer_id INTEGER, gender VARCHAR(1), first_name VARCHAR(80), last_name VARCHAR(50), contact_phone VARCHAR(80...
SELECT product_name, COUNT(product_name) FROM Products GROUP BY product_name ORDER BY COUNT(product_name) DESC
nvbench
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT t_kc24.PER_SOL 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 = '81937930304'
css
CREATE TABLE table_11514 ( "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. -- In the game where the home team was St Kilda, wh...
SELECT "Crowd" FROM table_11514 WHERE "Home team" = 'st kilda'
wikisql
CREATE TABLE table_16575609_5 ( cfl_team VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What teak was Brady Browne drafted onto?
SELECT cfl_team FROM table_16575609_5 WHERE player = "Brady Browne"
sql_create_context
CREATE TABLE table_name_12 ( tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What tournament has 1r as the 2011?
SELECT tournament FROM table_name_12 WHERE 2011 = "1r"
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( ...
SELECT COUNT(*) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-165214')) AND lab.labname = 'serum osmolality' AND DATETIME(lab.labresulttime, 'start of...
eicu
CREATE TABLE zzmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
SELECT zzmzjzjlb.SG, zzmzjzjlb.TZ FROM hz_info JOIN zzmzjzjlb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE hz_info.RYBH = '18593737' UNION SELECT fzzmzjzjlb.SG, fzzmzjzjlb.TZ FROM hz_info JOIN fzzmzjzjlb ON hz_info.YLJGDM = fzzmzjzjlb.YLJGDM AND hz_info.KH = f...
css
CREATE TABLE table_43273 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Total medals for the Nation with 1 Silver and 0 Golds?
SELECT COUNT("Total") FROM table_43273 WHERE "Silver" = '1' AND "Gold" < '0'
wikisql
CREATE TABLE constructorstandings ( constructorstandingsid number, raceid number, constructorid number, points number, position number, positiontext text, wins number ) CREATE TABLE constructorresults ( constructorresultsid number, raceid number, constructorid number, points...
SELECT DISTINCT T1.forename, T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds < 93000
spider
CREATE TABLE table_name_77 ( founded VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many different dates are there for founded teams for the venue of champion window field?
SELECT COUNT(founded) FROM table_name_77 WHERE venue = "champion window field"
sql_create_context
CREATE TABLE table_26736040_1 ( no_in_series INTEGER, directed_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest number in series with director as Phil Abraham?
SELECT MAX(no_in_series) FROM table_26736040_1 WHERE directed_by = "Phil Abraham"
sql_create_context
CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, basePrice INTEGER, decor TEXT ) CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adul...
SELECT decor, MIN(basePrice) FROM Rooms GROUP BY decor
nvbench
CREATE TABLE table_29295463_9 ( quarterfinalists VARCHAR, champion VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who were the quarter-finalists in the event where the champion was Terry Moor 3-6, 7-6, 6-2?
SELECT quarterfinalists FROM table_29295463_9 WHERE champion = "Terry Moor 3-6, 7-6, 6-2"
sql_create_context
CREATE TABLE table_69567 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the largest Attendance with a Loss of darling (0 1)?
SELECT MAX("Attendance") FROM table_69567 WHERE "Loss" = 'darling (0–1)'
wikisql
CREATE TABLE table_name_16 ( circuit VARCHAR, championship VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The 2001 NASCAR Winston Cup Series championship has what has a circuit?
SELECT circuit FROM table_name_16 WHERE championship = "2001 nascar winston cup series"
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid ...
SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'intracranial injury - no loss of consciousne...
eicu
CREATE TABLE table_31150 ( "Name/ designation" text, "Year of intro" real, "Country of origin" text, "Primary cartridge" text, "Major users" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country made the Flieger-Doppelpistole 1919?
SELECT "Country of origin" FROM table_31150 WHERE "Name/ designation" = 'Flieger-Doppelpistole 1919'
wikisql
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 patient ( uniquep...
SELECT (SELECT vitalperiodic.heartrate FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-23047') AND patient.unitdischargetime IS NULL...
eicu
CREATE TABLE table_name_35 ( money___ INTEGER, to_par VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest Money ($), when Top Par is E, and when Player is Ernie Els?
SELECT MAX(money___) AS $__ FROM table_name_35 WHERE to_par = "e" AND player = "ernie els"
sql_create_context
CREATE TABLE table_11623 ( "State" text, "Interview" real, "Swimsuit" real, "Evening Gown" real, "Average" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest evening gown number in North Carolina with less than 9.214 interviews?
SELECT MAX("Evening Gown") FROM table_11623 WHERE "State" = 'north carolina' AND "Interview" < '9.214'
wikisql
CREATE TABLE table_name_7 ( rank INTEGER, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's hale irwin's average rank?
SELECT AVG(rank) FROM table_name_7 WHERE player = "hale irwin"
sql_create_context
CREATE TABLE table_204_662 ( id number, "week" number, "date" text, "opponent" text, "result" text, "attendance" number, "bye" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many games were n october 1990 ?
SELECT COUNT(*) FROM table_204_662 WHERE "date" = 10 AND "date" = 1990
squall
CREATE TABLE table_27588823_2 ( power__kw_ VARCHAR, callsign VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much power does dwzf have?
SELECT power__kw_ FROM table_27588823_2 WHERE callsign = "DWZF"
sql_create_context
CREATE TABLE table_204_288 ( id number, "region" text, "seed" number, "team" text, "coach" text, "finished" text, "final opponent" text, "score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which region is above the west
SELECT "region" FROM table_204_288 WHERE id = (SELECT id FROM table_204_288 WHERE "region" = 'west') - 1
squall
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 procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Travis Hofman"
mimicsql_data
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 demographic.days_stay FROM demographic WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE diagnoses ( 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 ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "47" AND lab.fluid = "Other Body Fluid"
mimicsql_data
CREATE TABLE table_name_62 ( surface VARCHAR, tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Surface has a Tournament of olbia?
SELECT surface FROM table_name_62 WHERE tournament = "olbia"
sql_create_context
CREATE TABLE table_name_53 ( athlete VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On 11 July 2003, which athlete performed?
SELECT athlete FROM table_name_53 WHERE date = "11 july 2003"
sql_create_context
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 COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'diabetes mellitus - type ii' AND DATETIME(diagnosis.diagnosistime, 'start...
eicu
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.OUT_DIAG_DIS_CD, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '9733339' GROUP BY t_kc21.OUT_DIAG_DIS_CD
css
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 t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'nitroglycerin - intravenous' AND DATETIME(treatmen...
eicu
CREATE TABLE table_46961 ( "Name" text, "Premier League" real, "League Cup" real, "FA Cup" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest league cup with more than 0 FA cups, a premier league less than 34 and a tota...
SELECT MAX("League Cup") FROM table_46961 WHERE "FA Cup" > '0' AND "Premier League" < '34' AND "Total" = '11'
wikisql
CREATE TABLE Plays_Games ( StuID INTEGER, GameID INTEGER, Hours_Played INTEGER ) 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 SportsInfo ( Stu...
SELECT AVG(Age), MAX(Age) FROM Student GROUP BY Major
nvbench
CREATE TABLE table_204_335 ( id number, "outcome" text, "no." number, "date" number, "tournament" text, "surface" text, "partner" text, "opponents in the final" text, "score in the final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -...
SELECT COUNT("tournament") FROM table_204_335 WHERE "partner" = 'jim mcmanus'
squall
CREATE TABLE table_name_59 ( record VARCHAR, game VARCHAR, visitor VARCHAR, decision VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which game later than number 32 had both Ellis for the decision and Nashville as the visiting team?
SELECT record FROM table_name_59 WHERE visitor = "nashville" AND decision = "ellis" AND game > 32
sql_create_context
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 labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time,...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnoses_icd.charttime)) FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'chronic obst asthma nos') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM adm...
mimic_iii
CREATE TABLE table_name_31 ( date_made VARCHAR, type VARCHAR, gsr_class VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date of creation of the locomotive of type 0-6-0 and GSR class of 441?
SELECT date_made FROM table_name_31 WHERE type = "0-6-0" AND gsr_class = "441"
sql_create_context
CREATE TABLE table_26263322_1 ( age INTEGER, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the age when the result is fired in week 8
SELECT MIN(age) FROM table_26263322_1 WHERE result = "Fired in week 8"
sql_create_context
CREATE TABLE table_name_60 ( number_of_issues VARCHAR, end_month VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of Issues has a End month of oct-80?
SELECT COUNT(number_of_issues) FROM table_name_60 WHERE end_month = "oct-80"
sql_create_context
CREATE TABLE table_name_46 ( college VARCHAR, position VARCHAR, overall VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the college that has an overall larger than 187 and a round smaller than 7 for the defensive end position.
SELECT college FROM table_name_46 WHERE overall > 187 AND round < 7 AND position = "defensive end"
sql_create_context
CREATE TABLE table_21212 ( "No." real, "Hanyu" text, "Tongyong" text, "Pe\u030dh-\u014de-j\u012b" text, "Chinese" text, "Area (km\u00b2)" text, "No. of villages" real, "Population (2010)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Na...
SELECT COUNT("Tongyong") FROM table_21212 WHERE "Hanyu" = 'Qiaotou'
wikisql
CREATE TABLE table_203_375 ( id number, "name" text, "year built" text, "country" text, "town" text, "height" text, "remarks" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what year was the last pylon in germany built ?
SELECT MAX("year built") FROM table_203_375 WHERE "country" = 'germany'
squall
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "10" AND diagnoses.icd9_code = "76513"
mimicsql_data
CREATE TABLE table_4442 ( "Season" text, "Div." text, "Pos." text, "Pld." text, "Pts." text, "Play-offs" text, "Trophy" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the season for quarter-final position of 4th
SELECT "Season" FROM table_4442 WHERE "Play-offs" = 'quarter-final' AND "Pos." = '4th'
wikisql
CREATE TABLE captain ( Captain_ID int, Name text, Ship_ID int, age text, Class text, Rank text ) CREATE TABLE Ship ( Ship_ID int, Name text, Type text, Built_Year real, Class text, Flag text ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT Class, COUNT(Class) FROM captain GROUP BY Class ORDER BY Class
nvbench
CREATE TABLE table_name_69 ( record VARCHAR, week VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Week larger than 5, and an opponent of at new york giants had what record?
SELECT record FROM table_name_69 WHERE week > 5 AND opponent = "at new york giants"
sql_create_context