instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_36385 ( "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. -- What largest episode number's Netflix is S05E23?
SELECT MAX("Episode") FROM table_36385 WHERE "Netflix" = 's05e23'
wikisql
CREATE TABLE table_62185 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What visiting team has a record of 4-3?
SELECT "Visitor" FROM table_62185 WHERE "Record" = '4-3'
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.ethnicity = "WHITE" AND demographic.diagnosis = "ATRIAL SEPTAL DEFECT\MITRAL VALVE REPLACEMENT;REPAIR ATRIAL-SEPTAL DEFECT/SDA"
mimicsql_data
CREATE TABLE table_19753079_12 ( candidates VARCHAR, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who are the candidates in Florida 13 district?
SELECT candidates FROM table_19753079_12 WHERE district = "Florida 13"
sql_create_context
CREATE TABLE table_name_37 ( week VARCHAR, eastern__number2 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the wekk for eastern #2 of houston
SELECT week FROM table_name_37 WHERE eastern__number2 = "houston"
sql_create_context
CREATE TABLE table_203_543 ( id number, "year" text, "show" text, "role" text, "channel" text, "extra" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which show was the last to air ?
SELECT "show" FROM table_203_543 ORDER BY "year" DESC LIMIT 1
squall
CREATE TABLE table_74613 ( "Player" text, "Nationality" text, "Position" text, "From" text, "School/Country" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player started in 2001?
SELECT "Player" FROM table_74613 WHERE "From" = '2001'
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 admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, ...
SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'other lacrimal gland ops') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25523) AND DATETIME(pr...
mimic_iii
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar...
SELECT DISTINCT airline_code FROM airline WHERE airline_code = 'US'
atis
CREATE TABLE table_name_2 ( january INTEGER, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which January has a Game of 50?
SELECT AVG(january) FROM table_name_2 WHERE game = 50
sql_create_context
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDat...
SELECT COUNT(a.Id) AS "# answers", SUM(CASE WHEN q.AcceptedAnswerId = a.Id THEN 1 ELSE 0 END) AS "# accepted answers", CAST(1.0 * COUNT(q.AcceptedAnswerId) / COUNT(a.Id) AS FLOAT(3, 2)) AS "fraction accepted" FROM Posts AS q JOIN Posts AS a ON a.ParentId = q.Id JOIN Votes AS v ON v.PostId = a.Id WHERE q.PostTypeId = 1 ...
sede
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE VoteTypes ( Id number, Name text ) C...
SELECT Id, DisplayName, Reputation, Views, UpVotes, DownVotes FROM Users ORDER BY Reputation DESC
sede
CREATE TABLE table_name_34 ( manner_of_departure VARCHAR, replaced_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the manner of departure replaced by tita?
SELECT manner_of_departure FROM table_name_34 WHERE replaced_by = "tita"
sql_create_context
CREATE TABLE table_26609958_1 ( groundwater_discharge__million_m_3__ INTEGER, hydrographic_basin VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When cabarita river is the hydrographic basin what is the lowest groundwater discharge (million m 3)?
SELECT MIN(groundwater_discharge__million_m_3__) FROM table_26609958_1 WHERE hydrographic_basin = "Cabarita River"
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 WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND demographic.admityear < "2170"
mimicsql_data
CREATE TABLE table_48200 ( "Period" text, "Team" text, "Goal" text, "Time" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT SCORE HAS A TIME OF 18:27?
SELECT "Score" FROM table_48200 WHERE "Time" = '18:27'
wikisql
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(4...
SELECT T1.FIRST_NAME, T1.MANAGER_ID FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID WHERE T1.EMPLOYEE_ID = T2.MANAGER_ID
nvbench
CREATE TABLE table_26914076_3 ( us_viewers__millions_ VARCHAR, story_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many viewers watched the episode with a story by david simon & mari kornhauser?
SELECT us_viewers__millions_ FROM table_26914076_3 WHERE story_by = "David Simon & Mari Kornhauser"
sql_create_context
CREATE TABLE table_50112 ( "Date" text, "H/A/N" text, "Opponent" text, "Score" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is H/A/N when Date is February 24?
SELECT "H/A/N" FROM table_50112 WHERE "Date" = 'february 24'
wikisql
CREATE TABLE table_name_31 ( opponent VARCHAR, surface VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who played on clay and had a score of 6 1, 7 6?
SELECT opponent FROM table_name_31 WHERE surface = "clay" AND score = "6–1, 7–6"
sql_create_context
CREATE TABLE table_name_24 ( outcome VARCHAR, year VARCHAR, opponent_in_the_final VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the outcome when the opponent in the final is william renshaw after year 1882?
SELECT outcome FROM table_name_24 WHERE year > 1882 AND opponent_in_the_final = "william renshaw"
sql_create_context
CREATE TABLE table_57790 ( "Phoneme" text, "Realization" text, "Environment" text, "Example" text, "Gloss" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the phoneme when the realizationis [ ]
SELECT "Phoneme" FROM table_57790 WHERE "Realization" = '[ɑ]'
wikisql
CREATE TABLE channel ( Channel_ID int, Name text, Owner text, Share_in_percent real, Rating_in_percent real ) CREATE TABLE broadcast ( Channel_ID int, Program_ID int, Time_of_day text ) CREATE TABLE program ( Program_ID int, Name text, Origin text, Launch real, Owne...
SELECT Time_of_day, COUNT(*) FROM broadcast GROUP BY Time_of_day ORDER BY Time_of_day
nvbench
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "76" AND lab.label = "Hyaline Casts"
mimicsql_data
CREATE TABLE table_name_89 ( player VARCHAR, nhl_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- I want the player for NHL team for mighty ducks of anaheim
SELECT player FROM table_name_89 WHERE nhl_team = "mighty ducks of anaheim"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Robert Clayton"
mimicsql_data
CREATE TABLE prereq ( course_id varchar(8), prereq_id varchar(8) ) CREATE TABLE student ( ID varchar(5), name varchar(20), dept_name varchar(20), tot_cred numeric(3,0) ) CREATE TABLE teaches ( ID varchar(5), course_id varchar(8), sec_id varchar(8), semester varchar(6), year...
SELECT name, COUNT(name) FROM course AS T1 JOIN teaches AS T2 ON T1.course_id = T2.course_id JOIN instructor AS T3 ON T2.ID = T3.ID WHERE year = 2008 GROUP BY name ORDER BY name DESC
nvbench
CREATE TABLE Customers ( Customer_ID INTEGER, Customer_Details VARCHAR(255) ) CREATE TABLE Settlements ( Settlement_ID INTEGER, Claim_ID INTEGER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed INTEGER, Amount_Settled INTEGER, Customer_Policy_ID INTEGER ) CREATE TABLE...
SELECT Date_Payment_Made, AVG(Amount_Payment) FROM Payments WHERE Payment_Method_Code = 'Visa' ORDER BY AVG(Amount_Payment) DESC
nvbench
CREATE TABLE certificate ( eid number(9,0), aid number(9,0) ) CREATE TABLE aircraft ( aid number(9,0), name varchar2(30), distance number(6,0) ) CREATE TABLE flight ( flno number(4,0), origin varchar2(20), destination varchar2(20), distance number(6,0), departure_date date, ...
SELECT destination, COUNT(destination) FROM flight GROUP BY destination ORDER BY COUNT(destination)
nvbench
CREATE TABLE table_204_514 ( id number, "date" text, "sub" number, "flight" text, "dead" number, "hurt" number, "pax." number, "type" text, "perpetrator" text, "description" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is ...
SELECT SUM("hurt") FROM table_204_514
squall
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( la...
SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-142835')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput.c...
eicu
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, g...
SELECT DISTINCT advisory_requirement FROM course WHERE department = 'ROMLANG' AND number = 498
advising
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE hz_info_zyjzjlb ( JZLSH number, YLJGDM number, zyjzjlb_id number ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, ...
SELECT COUNT(hz_info.RYBH) FROM hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_in...
css
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost numbe...
SELECT t2.drugname FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033-10145') AND treatment.treatme...
eicu
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, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
(SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '61732704' AND NOT jybgb.BGDH IN (SELECT BGDH FROM jyjgzbb WHERE JCZ...
css
CREATE TABLE table_75375 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many attendances have w 48-10 as the result?
SELECT SUM("Attendance") FROM table_75375 WHERE "Result" = 'w 48-10'
wikisql
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId numb...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%munich%' ORDER BY Reputation DESC LIMIT 200
sede
CREATE TABLE table_1924975_1 ( q1 VARCHAR, q2_time VARCHAR, q1_time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the q1+q2 time in which q1 is 1:18.574?
SELECT q1 + q2_time FROM table_1924975_1 WHERE q1_time = "1:18.574"
sql_create_context
CREATE TABLE table_2668243_22 ( candidates VARCHAR, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who were the 'candidate' of South Carolina 6?
SELECT candidates FROM table_2668243_22 WHERE district = "South Carolina 6"
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 DISTINCT patient.gender FROM patient WHERE patient.uniquepid = '032-2747'
eicu
CREATE TABLE table_name_52 ( score VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Score, when Opponent is 'Ivo Min '?
SELECT score FROM table_name_52 WHERE opponent = "ivo minář"
sql_create_context
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAno...
SELECT c.Id AS "comment_link", c.Score, c.UserId AS "user_link", c.UserDisplayName, c.Text FROM Comments AS c WHERE c.PostId = '##id?4447##' ORDER BY c.Id
sede
CREATE TABLE table_11222744_3 ( studio VARCHAR, catalog_number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many studios have the catalog number 'cal03 / 0091037137333'?
SELECT COUNT(studio) FROM table_11222744_3 WHERE catalog_number = "CAL03 / 0091037137333"
sql_create_context
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT question.Id AS QuestionId, question.Score AS QuestionScore, question.Title AS QuestionTitle, question.Body AS QuestionBody, question.Tags, answer.Id AS AcceptedAnswerId, answer.Score AS AnswerScore, answer.Body AS AnswerBody FROM Posts AS question JOIN Posts AS answer ON question.AcceptedAnswerId = answer.Id INN...
sede
CREATE TABLE table_10322 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score when Minnesota visited?
SELECT "Score" FROM table_10322 WHERE "Visitor" = 'minnesota'
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_Home, AVG(Team_ID) FROM basketball_match GROUP BY All_Home
nvbench
CREATE TABLE submission ( Submission_ID int, Scores real, Author text, College text ) CREATE TABLE Acceptance ( Submission_ID int, Workshop_ID int, Result text ) CREATE TABLE workshop ( Workshop_ID int, Date text, Venue text, Name text ) -- Using valid SQLite, answer the ...
SELECT Author, COUNT(Author) FROM submission GROUP BY Author ORDER BY COUNT(Author) DESC
nvbench
CREATE TABLE table_68627 ( "Year" real, "Team" text, "Chassis" text, "Engine" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was a Rial Arc2 chassis used?
SELECT SUM("Year") FROM table_68627 WHERE "Chassis" = 'rial arc2'
wikisql
CREATE TABLE table_53300 ( "D 50 O" text, "D 49 \u221a" text, "D 48 \u221a" text, "D 47 \u221a" text, "D 46 \u221a" text, "D 45 \u221a" text, "D 44 \u221a" text, "D 43 \u221a" text, "D 42 \u221a" text, "D 41 \u221a" text ) -- Using valid SQLite, answer the following questions f...
SELECT "D 49 \u221a" FROM table_53300 WHERE "D 46 \u221a" = 'i 1 @'
wikisql
CREATE TABLE table_name_1 ( years VARCHAR, jersey_number_s_ INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What years was the jersey number(s) smaller than 3?
SELECT years FROM table_name_1 WHERE jersey_number_s_ < 3
sql_create_context
CREATE TABLE table_11603006_1 ( score VARCHAR, tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many different scores are there for the Verizon Classic?
SELECT COUNT(score) FROM table_11603006_1 WHERE tournament = "Verizon Classic"
sql_create_context
CREATE TABLE table_62226 ( "Battle No." real, "Broadcast Date" text, "Name of Battle" text, "Theme" text, "Celebrities Taking Part" text, "Winner" text, "Runner-up" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the...
SELECT "Theme" FROM table_62226 WHERE "Winner" = 'dani'
wikisql
CREATE TABLE table_name_22 ( framed_size VARCHAR, date_completed VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the frame size in 08/87?
SELECT framed_size FROM table_name_22 WHERE date_completed = "08/87"
sql_create_context
CREATE TABLE table_name_7 ( time VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Time of the Rowers in Rank 1?
SELECT time FROM table_name_7 WHERE rank = 1
sql_create_context
CREATE TABLE table_55585 ( "Stage (Winner)" text, "General Classification" text, "Mountains Classification" text, "Points Classification" text, "Sprints classification" text, "Team Classification" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- W...
SELECT "Stage (Winner)" FROM table_55585 WHERE "General Classification" = 'vladimir karpets' AND "Team Classification" = 'relax-gam' AND "Points Classification" = 'denis menchov'
wikisql
CREATE TABLE table_name_58 ( colour_commentator_s_ VARCHAR, play_by_play VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the colour commentator when the play-by-play announcer was Bob Cole?
SELECT colour_commentator_s_ FROM table_name_58 WHERE play_by_play = "bob cole"
sql_create_context
CREATE TABLE table_54579 ( "Week" text, "Date" text, "Opponent" text, "Home/Away Game" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent on week 7?
SELECT "Opponent" FROM table_54579 WHERE "Week" = '7'
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 flight_stop ( flight_id int, stop_number int, stop_days text, stop_...
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, days, flight WHERE (((((flight.arrival_time < 41 OR flight.time_elapsed >= 60) AND flight.departure_time > flight.arrival_time) AND days.day_name = 'SATURDAY' AND flight.flig...
atis
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'acute respiratory failure - due to obstructive lung disease')
eicu
CREATE TABLE table_10454 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which CFL Team has a College of montreal, and a Player of marc trepanier?
SELECT "CFL Team" FROM table_10454 WHERE "College" = 'montreal' AND "Player" = 'marc trepanier'
wikisql
CREATE TABLE mzjzjlb_jybgb ( YLJGDM_MZJZJLB text, BGDH number, YLJGDM number ) 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, X...
SELECT mzjzjlb.JLSJ FROM mzjzjlb WHERE mzjzjlb.JZLSH = '16392541751'
css
CREATE TABLE table_2803 ( "Season" text, "Mittelfranken Nord" text, "Mittelfranken S\u00fcd" text, "Unterfranken West" text, "Unterfranken Ost" text, "Oberfranken West" text, "Oberfranken Ost" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- W...
SELECT "Season" FROM table_2803 WHERE "Mittelfranken S\u00fcd" = 'ASV Nürnberg-Süd'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime...
SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t2.diagnosistime) > 1 * 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 table_26826304_2 ( timeslot VARCHAR, air_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- A what time was the title aired in October 22, 2009
SELECT timeslot FROM table_26826304_2 WHERE air_date = "October 22, 2009"
sql_create_context
CREATE TABLE table_17088705_2 ( interview VARCHAR, preliminary VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Number of participants with a score 8.895 in preliminary
SELECT COUNT(interview) FROM table_17088705_2 WHERE preliminary = "8.895"
sql_create_context
CREATE TABLE table_203_303 ( id number, "tribunal" text, "number of autos da fe" number, "executions in persona" number, "executions in effigie" number, "penanced" number, "total" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the ...
SELECT ABS(SUM("executions in persona") - SUM("executions in effigie")) FROM table_203_303
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 demographic.diagnosis, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "25543"
mimicsql_data
CREATE TABLE table_12271718_1 ( station VARCHAR, network_affiliation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What station has a univision network affiliation?
SELECT station FROM table_12271718_1 WHERE network_affiliation = "Univision"
sql_create_context
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course ( course_id int, name varchar, dep...
SELECT DISTINCT course_offering.end_time, course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.start_time, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM semester INNER JOIN course_offering ON semester.semester_id = course_o...
advising
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2101" AND prescriptions.drug = "Mexiletine"
mimicsql_data
CREATE TABLE table_17538810_10 ( lead_margin VARCHAR, dates_administered VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many different lead margins were stated in the poll administered on September 11, 2008?
SELECT COUNT(lead_margin) FROM table_17538810_10 WHERE dates_administered = "September 11, 2008"
sql_create_context
CREATE TABLE table_15761 ( "Position" real, "Club" text, "Played" real, "Points" text, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real ) -- Using valid SQLite, answer the following questions for the tables provided above....
SELECT COUNT("Goals for") FROM table_15761 WHERE "Played" > '44'
wikisql
CREATE TABLE table_name_58 ( games VARCHAR, position VARCHAR, number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the games number when the Position was wr, and a Number larger than 17?
SELECT COUNT(games) AS ↑ FROM table_name_58 WHERE position = "wr" AND number > 17
sql_create_context
CREATE TABLE Guests ( guest_id INTEGER, gender_code CHAR(1), guest_first_name VARCHAR(80), guest_last_name VARCHAR(80), date_of_birth DATETIME ) CREATE TABLE Apartments ( apt_id INTEGER, building_id INTEGER, apt_type_code CHAR(15), apt_number CHAR(10), bathroom_count INTEGER, ...
SELECT date_of_birth, COUNT(date_of_birth) FROM Guests WHERE gender_code = "Male" ORDER BY COUNT(date_of_birth)
nvbench
CREATE TABLE table_25052 ( "Rank Subcontinent" real, "Rank Asia" real, "Rank World" real, "Country" text, "2011 GDP (PPP) billions of USD" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the 2011 gdp for 65 rank world
SELECT "2011 GDP (PPP) billions of USD" FROM table_25052 WHERE "Rank World" = '65'
wikisql
CREATE TABLE airports ( apid number, name text, city text, country text, x number, y number, elevation number, iata text, icao text ) CREATE TABLE routes ( rid number, dst_apid number, dst_ap text, src_apid number, src_ap text, alid number, airline text, ...
SELECT T1.name, T1.city, T2.dst_apid FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid GROUP BY T2.dst_apid ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_203_777 ( id number, "years" text, "building" text, "city" text, "height (ctbuh)" text, "floors" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which is the only to hold the record for a year ?
SELECT "building" FROM table_203_777 WHERE "years" - "years" = 0
squall
CREATE TABLE table_name_90 ( project_name VARCHAR, country VARCHAR, peak VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Project Name with a Country that is kazakhstan and a Peak that is 150?
SELECT project_name FROM table_name_90 WHERE country = "kazakhstan" AND peak = "150"
sql_create_context
CREATE TABLE table_204_584 ( id number, "pos" text, "no" number, "driver" text, "constructor" text, "laps" number, "time/retired" text, "grid" number, "points" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many drivers complet...
SELECT COUNT("driver") FROM table_204_584 WHERE "laps" >= 52
squall
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, COUNT(*) FROM Rooms WHERE bedType = "King" GROUP BY decor
nvbench
CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE voting_record ( stuid number, registration_date text, election_cycle text, president_vote number, vice_president_vote number...
SELECT fname FROM student WHERE age > 22
spider
CREATE TABLE table_train_232 ( "id" int, "metastatic_cancer" bool, "hemoglobin_a1c_hba1c" float, "diabetic" string, "short_life_expectancy" bool, "body_mass_index_bmi" float, "a1c" float, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided abov...
SELECT * FROM table_train_232 WHERE hemoglobin_a1c_hba1c < 8
criteria2sql
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 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_54154 ( "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 number of the crowd when the away te...
SELECT COUNT("Crowd") FROM table_54154 WHERE "Away team score" = '10.18 (78)'
wikisql
CREATE TABLE table_name_48 ( dutch VARCHAR, crimean_gothic VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the Dutch word for Apel?
SELECT dutch FROM table_name_48 WHERE crimean_gothic = "apel"
sql_create_context
CREATE TABLE program_course ( program_id int, course_id int, workload int, category 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, tes...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course_offering.friday = 'N' AND course.department = 'KINESLGY' AND semester.semester = 'WN' A...
advising
CREATE TABLE table_name_77 ( position VARCHAR, overall VARCHAR, school_club_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was Cal State-Los Angeles' position with an Overall above 22?
SELECT position FROM table_name_77 WHERE overall > 22 AND school_club_team = "cal state-los angeles"
sql_create_context
CREATE TABLE table_36069 ( "Place" text, "Player" text, "Nation" text, "Score" text, "To par" text, "Money ( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score for a match where Sophie Gustafson played?
SELECT "Score" FROM table_36069 WHERE "Player" = 'sophie gustafson'
wikisql
CREATE TABLE table_204_629 ( id number, "first tops" text, "second tops" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many first tops class numbers are less than 200 ?
SELECT COUNT("first tops") FROM table_204_629 WHERE "first tops" < 200
squall
CREATE TABLE table_61240 ( "Date" text, "Opponent#" text, "Site" text, "Result" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who were the opponents when there was an attendance of 48,165?
SELECT "Opponent#" FROM table_61240 WHERE "Attendance" = '48,165'
wikisql
CREATE TABLE table_name_77 ( type VARCHAR, population VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What type has a population of 370?
SELECT type FROM table_name_77 WHERE population = 370
sql_create_context
CREATE TABLE table_name_65 ( draw INTEGER, place INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Draw when the Place is larger than 5?
SELECT AVG(draw) FROM table_name_65 WHERE place > 5
sql_create_context
CREATE TABLE table_46383 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Series" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Decision has a Visitor of calgary, a Score of 2 1, and a Series of 4 3?
SELECT "Decision" FROM table_46383 WHERE "Visitor" = 'calgary' AND "Score" = '2 – 1' AND "Series" = '4 – 3'
wikisql
CREATE TABLE Player ( player_name VARCHAR, player_api_id VARCHAR ) CREATE TABLE Player_Attributes ( player_api_id VARCHAR, crossing VARCHAR, preferred_foot VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the names of all players who have a c...
SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.crossing > 90 AND T2.preferred_foot = "right"
sql_create_context
CREATE TABLE table_name_70 ( original_title VARCHAR, english_title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the Original Title of the English title A Judgement in Stone?
SELECT original_title FROM table_name_70 WHERE english_title = "a judgement in stone"
sql_create_context
CREATE TABLE table_22117 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Results" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- During what year was Representative Spencer Bachus first elected?
SELECT COUNT("First elected") FROM table_22117 WHERE "Incumbent" = 'Spencer Bachus'
wikisql
CREATE TABLE table_8363 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location/Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Score, when Game is greater than 49, and when Opponent is 'Pittsburgh ...
SELECT "Score" FROM table_8363 WHERE "Game" > '49' AND "Opponent" = 'pittsburgh ironmen'
wikisql
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, H...
SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '9229187' AND t_kc21.IN_HOSP_DATE BETWEEN '2011-11-11' AND '2014-01-05' AND t_kc21.INSURED_STS = '未就业' AND t_kc21.MED_AMOUT >= 3685.16
css
CREATE TABLE table_42605 ( "Week" real, "Date" text, "Result" text, "Record" text, "Opponent" text, "Points For" real, "Points Against" real, "First Downs" real, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the...
SELECT MAX("Points For") FROM table_42605 WHERE "Record" = '12–2' AND "Points Against" > '6'
wikisql
CREATE TABLE table_name_58 ( goals_against INTEGER, points_1 VARCHAR, drawn VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest number of goals against when there are 1 of 18 points, and more than 8 are drawn?
SELECT MIN(goals_against) FROM table_name_58 WHERE points_1 = "18" AND drawn > 8
sql_create_context