instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_32 ( west VARCHAR, east VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was in the West when ESV Gebensbach was in the East?
SELECT west FROM table_name_32 WHERE east = "esv gebensbach"
sql_create_context
CREATE TABLE table_name_46 ( total VARCHAR, to_par VARCHAR, year_won VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Total of the player who won before 1983 with a smaller than 4 To par?
SELECT COUNT(total) FROM table_name_46 WHERE to_par < 4 AND year_won < 1983
sql_create_context
CREATE TABLE table_name_93 ( country VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which country has a rank of 2?
SELECT country FROM table_name_93 WHERE rank = 2
sql_create_context
CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description...
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, fare, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY...
atis
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE treatment ( treatmentid...
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-74343')) AND medication.drugname = 'sodium chloride 0.9% s...
eicu
CREATE TABLE table_68415 ( "Game" real, "Date" text, "Location" text, "Time" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the date for game 3?
SELECT "Date" FROM table_68415 WHERE "Game" = '3'
wikisql
CREATE TABLE table_name_93 ( tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the tournament for 2010 of grand slam tournaments
SELECT tournament FROM table_name_93 WHERE 2010 = "grand slam tournaments"
sql_create_context
CREATE TABLE table_14960574_6 ( german_voice_actor VARCHAR, spanish_voice_actor VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the german voice actor for rafael torres
SELECT german_voice_actor FROM table_14960574_6 WHERE spanish_voice_actor = "Rafael Torres"
sql_create_context
CREATE TABLE table_38266 ( "Driver" text, "Season" text, "Entries" real, "Front row starts" real, "Percentage" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were the total number of entries in 2001 that had a front row smaller than 13?
SELECT COUNT("Entries") FROM table_38266 WHERE "Season" = '2001' AND "Front row starts" < '13'
wikisql
CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
SELECT DISTINCT instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'BIOINF' AND course.number = 545 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering...
advising
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 WHERE demographic.diagnosis = "CONGESTIVE HEART FAILURE"
mimicsql_data
CREATE TABLE table_12156 ( "Draft" real, "Round" text, "Pick" real, "Player" text, "Nationality" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Draft, when Round is '9', when Pick is '171', and when Player is 'Dan Wiebe Category:Articles wit...
SELECT "Draft" FROM table_12156 WHERE "Round" = '9' AND "Pick" = '171' AND "Player" = 'dan wiebe category:articles with hcards'
wikisql
CREATE TABLE table_name_34 ( venue VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE VENUE ON MARCH 28, 2008?
SELECT venue FROM table_name_34 WHERE date = "march 28, 2008"
sql_create_context
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 demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.religion = "GREEK ORTHODOX"
mimicsql_data
CREATE TABLE table_name_29 ( total INTEGER, gold INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Total has a Gold smaller than 0?
SELECT SUM(total) FROM table_name_29 WHERE gold < 0
sql_create_context
CREATE TABLE Customers ( customer_id INTEGER, customer_details VARCHAR(255) ) CREATE TABLE Organizations ( organization_id INTEGER, parent_organization_id INTEGER, organization_details VARCHAR(255) ) CREATE TABLE Customer_Event_Notes ( Customer_Event_Note_ID INTEGER, Customer_Event_ID INTE...
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 organization_details DESC
nvbench
CREATE TABLE table_7085 ( "Rank" real, "Celebrity" text, "Professional Partner" text, "Season" real, "Average" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which season's average was 37.5?
SELECT "Season" FROM table_7085 WHERE "Average" = '37.5'
wikisql
CREATE TABLE table_name_86 ( drivers VARCHAR, laps VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What driver had 101 laps?
SELECT drivers FROM table_name_86 WHERE laps = 101
sql_create_context
CREATE TABLE table_65514 ( "Rank" real, "Rowers" text, "Country" text, "Time" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the time for the race with the United States?
SELECT "Time" FROM table_65514 WHERE "Country" = 'united states'
wikisql
CREATE TABLE table_name_25 ( region VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What region has a 5 rank?
SELECT region FROM table_name_25 WHERE rank = 5
sql_create_context
CREATE TABLE table_69149 ( "Rank" real, "Lane" real, "Name" text, "Nationality" text, "Time" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- for the rank of 3 for the united states, what is the average lane?
SELECT AVG("Lane") FROM table_69149 WHERE "Nationality" = 'united states' AND "Rank" = '3'
wikisql
CREATE TABLE table_18788823_5 ( team VARCHAR, date_of_appointment VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which team appointed a person on 23 December 2008?
SELECT team FROM table_18788823_5 WHERE date_of_appointment = "23 December 2008"
sql_create_context
CREATE TABLE table_35161 ( "Congress" text, "Bill number(s)" text, "Date introduced" text, "Sponsor(s)" text, "# of cosponsors" real, "Latest status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who sponsored the bill introduced on June 9, 201...
SELECT "Sponsor(s)" FROM table_35161 WHERE "Date introduced" = 'june 9, 2011'
wikisql
CREATE TABLE table_204_36 ( id number, "date" text, "opponent" text, "site" text, "result" text, "attendance" number, "record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many times was there a loss by more than 5 points ?
SELECT COUNT(*) FROM table_204_36 WHERE ABS("result" - "result") > 5
squall
CREATE TABLE table_49629 ( "Year" text, "Gold" text, "Silver" text, "Bronze" text, "Host city / cities" text, "Host country / countries" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the host country when bronze is [[|]] (1) and host ci...
SELECT "Host country / countries" FROM table_49629 WHERE "Bronze" = '[[|]] (1)' AND "Host city / cities" = 'krynica'
wikisql
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 medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-7988')) AND medication.routeadmin = 'mucous membrane' AND ...
eicu
CREATE TABLE table_21551 ( "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 w...
SELECT "Score" FROM table_21551 WHERE "Team" = 'Boston'
wikisql
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2180" AND procedures.long_title = "Initial insertion of transvenous leads [electrodes] into atrium and ventricle"
mimicsql_data
CREATE TABLE table_204_413 ( id number, "medal" text, "name" text, "sport" text, "event" text, "date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- name the only medalist to receive a medal in the men 's javelin throw
SELECT "name" FROM table_204_413 WHERE "event" = "men's javelin throw"
squall
CREATE TABLE table_name_8 ( agg VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What 1st leg has 52-70 as the agg.?
SELECT 1 AS st_leg FROM table_name_8 WHERE agg = "52-70"
sql_create_context
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '郑英武' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT < 2518.38)
css
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 zyjzjlb ( CYBQDM text, CYBQMC...
SELECT person_info.XM FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE jybgb.BGDH = '2...
css
CREATE TABLE table_name_80 ( track VARCHAR, pole_winner VARCHAR, event_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- At which track was Frank Kimmel the Pole Winner of the Pennsylvania 200?
SELECT track FROM table_name_80 WHERE pole_winner = "frank kimmel" AND event_name = "pennsylvania 200"
sql_create_context
CREATE TABLE table_name_13 ( wins INTEGER, events VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the fewest wins for Thomas in events he had entered exactly 9 times?
SELECT MIN(wins) FROM table_name_13 WHERE events = 9
sql_create_context
CREATE TABLE Accounts ( Account_details INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the account details with the largest value or with value having char '5' in it?
SELECT MAX(Account_details) FROM Accounts UNION SELECT Account_details FROM Accounts WHERE Account_details LIKE "%5%"
sql_create_context
CREATE TABLE table_203_160 ( id number, "rank" number, "heat" number, "nation" text, "competitors" text, "time" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which nation placed above russia ?
SELECT "nation" FROM table_203_160 WHERE "rank" = (SELECT "rank" FROM table_203_160 WHERE "nation" = 'russia') - 1
squall
CREATE TABLE table_name_38 ( date VARCHAR, venue VARCHAR, opponents VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On which date did they play Leicester City in Venue A?
SELECT date FROM table_name_38 WHERE venue = "a" AND opponents = "leicester city"
sql_create_context
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 prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CELO-VESSICLE FISTULA"
mimicsql_data
CREATE TABLE table_19249 ( "Year" real, "Boys singles" text, "Girls singles" text, "Boys doubles" text, "Girls doubles" text, "Mixed doubles" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When mixed doubles is didit juang indrianto yayu rahayu ...
SELECT MAX("Year") FROM table_19249 WHERE "Mixed doubles" = 'Didit Juang Indrianto Yayu Rahayu'
wikisql
CREATE TABLE table_54926 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the Away team when the Home team scored 7.8 (5...
SELECT "Away team" FROM table_54926 WHERE "Home team score" = '7.8 (50)'
wikisql
CREATE TABLE table_name_24 ( location VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where was the location for Arras Paul Arras?
SELECT location FROM table_name_24 WHERE opponent = "arras paul arras"
sql_create_context
CREATE TABLE table_19629 ( "Position" real, "Team" text, "Played" real, "Wins" real, "Draws" real, "Losses" real, "Scored" real, "Conceded" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest conceded v...
SELECT MIN("Conceded") FROM table_19629 WHERE "Team" = '12 de Octubre'
wikisql
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propul...
SELECT DISTINCT flight.flight_id FROM airport, airport_service, city, flight WHERE airport.airport_code = 'BWI' AND city.city_code = airport_service.city_code AND city.city_name = 'ATLANTA' AND flight.from_airport = airport_service.airport_code AND flight.to_airport = airport.airport_code
atis
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, ...
SELECT * FROM Posts WHERE (Title LIKE '%internet of thing%' OR Body LIKE '%internet of thing%') AND YEAR(Posts.CreationDate) BETWEEN 2018 AND 2019
sede
CREATE TABLE table_name_1 ( season VARCHAR, winner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What season did the Rangers win?
SELECT season FROM table_name_1 WHERE winner = "rangers"
sql_create_context
CREATE TABLE table_39928 ( "Date" text, "Centerfold model" text, "Interview subject" text, "20 Questions" text, "Pictorials" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Interview subject has a Pictorials of vida guerra?
SELECT "Interview subject" FROM table_39928 WHERE "Pictorials" = 'vida guerra'
wikisql
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 PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE varchar(50), PROF_EXTENSION v...
SELECT CRS_DESCRIPTION, COUNT(CRS_DESCRIPTION) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE JOIN PROFESSOR AS T4 ON T2.EMP_NUM = T4.EMP_NUM GROUP BY PROF_OFFICE, CRS_DESCRIPTION ORDER BY CRS_DESCRIPTION
nvbench
CREATE TABLE table_name_96 ( class VARCHAR, chassis VARCHAR, driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Driver Shaun Jones with a viper as a chassis is in what class?
SELECT class FROM table_name_96 WHERE chassis = "viper" AND driver = "shaun jones"
sql_create_context
CREATE TABLE table_47019 ( "Class" text, "Part 1" text, "Part 2" text, "Part 3" text, "Part 4" text, "Verb meaning" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the part 2 entry for class 3a?
SELECT "Part 2" FROM table_47019 WHERE "Class" = '3a'
wikisql
CREATE TABLE table_77147 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was Marty Furgol's place when he was paid less than $3,000?
SELECT "Place" FROM table_77147 WHERE "Money ( $ )" < '3,000' AND "Player" = 'marty furgol'
wikisql
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId num...
SELECT * FROM Tags WHERE TagName = 'identification'
sede
CREATE TABLE table_2803662_3 ( town VARCHAR, tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When grand prix de sar la princesse lalla meryem is the tournament what is the town?
SELECT town FROM table_2803662_3 WHERE tournament = "Grand Prix De SAR La Princesse Lalla Meryem"
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 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '025-44842' AND patient.wardid = 925 AND patient.hospitaldischargetime IS NULL ORDER BY patient.unitadmittime LIMIT 1
eicu
CREATE TABLE domain_publication ( did int, pid int ) CREATE TABLE journal ( homepage varchar, jid int, name varchar ) CREATE TABLE organization ( continent varchar, homepage varchar, name varchar, oid int ) CREATE TABLE publication ( abstract varchar, cid int, citation...
SELECT publication.title FROM journal, keyword, publication, publication_keyword WHERE journal.name = 'PVLDB' AND keyword.keyword = 'Keyword search' AND publication_keyword.kid = keyword.kid AND publication.jid = journal.jid AND publication.pid = publication_keyword.pid
academic
CREATE TABLE table_8485 ( "Date" text, "Home team" text, "Score" text, "Away team" text, "Venue" text, "Crowd" real, "Box Score" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people attended the game when sydney ...
SELECT "Crowd" FROM table_8485 WHERE "Home team" = 'sydney spirit'
wikisql
CREATE TABLE table_1756284_1 ( kerry_percentage VARCHAR, kerry_number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When Kerry# was 199060, what was the percentage?
SELECT kerry_percentage FROM table_1756284_1 WHERE kerry_number = 199060
sql_create_context
CREATE TABLE table_68478 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the entrant for year of 1952
SELECT "Entrant" FROM table_68478 WHERE "Year" = '1952'
wikisql
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 (SELECT COUNT(*) FROM hz_info JOIN txmzjzjlb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE hz_info.RYBH = '98519847' AND txmzjzjlb.JZKSRQ BETWEEN '2005-12-14' AND '2010-02-05' UNION SELECT COUNT(*) FROM hz_info JOIN ftxmzjzjlb ON hz_info.YLJGDM = ftxmzjz...
css
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
nvbench
CREATE TABLE table_33937 ( "Rank" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the silver number when gold is more than 4, and the total is less than 24?
SELECT AVG("Silver") FROM table_33937 WHERE "Gold" > '4' AND "Total" < '24'
wikisql
CREATE TABLE table_name_61 ( train_name VARCHAR, frequency__inbound_outbound_ VARCHAR, destination VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the train name of the rail with a daily frequency and Jammutawi as the destination?
SELECT train_name FROM table_name_61 WHERE frequency__inbound_outbound_ = "daily" AND destination = "jammutawi"
sql_create_context
CREATE TABLE table_name_66 ( player VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who plays the right wing position?
SELECT player FROM table_name_66 WHERE position = "right wing"
sql_create_context
CREATE TABLE table_name_59 ( attendance VARCHAR, home VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the attendance of the game with the NY Islanders as home team?
SELECT COUNT(attendance) FROM table_name_59 WHERE home = "ny islanders"
sql_create_context
CREATE TABLE table_37922 ( "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 was the segment b for Netflix s01e21?
SELECT "Segment B" FROM table_37922 WHERE "Netflix" = 's01e21'
wikisql
CREATE TABLE journal_committee ( Editor_ID int, Journal_ID int, Work_Type text ) CREATE TABLE editor ( Editor_ID int, Name text, Age real ) CREATE TABLE journal ( Journal_ID int, Date text, Theme text, Sales int ) -- Using valid SQLite, answer the following questions for the ...
SELECT Theme, Age FROM journal_committee AS T1 JOIN editor AS T2 ON T1.Editor_ID = T2.Editor_ID JOIN journal AS T3 ON T1.Journal_ID = T3.Journal_ID ORDER BY T3.Theme
nvbench
CREATE TABLE table_25551880_2 ( mountains_classification VARCHAR, winner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was awarded mountains classification when Alessandro petacchi won?
SELECT mountains_classification FROM table_25551880_2 WHERE winner = "Alessandro Petacchi"
sql_create_context
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, ...
SELECT DISTINCT instructor.name FROM instructor, course, course_offering, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course_offering.offering_id = offering_instructor.offering_id AND instructor.instructor_id = offering_instructor.instructor_id AND NOT instr...
advising
CREATE TABLE table_name_94 ( area_served VARCHAR, frequency VARCHAR, on_air_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what Area has the frequency of 100.3 and an On-air ID of yass fm?
SELECT area_served FROM table_name_94 WHERE frequency = "100.3" AND on_air_id = "yass fm"
sql_create_context
CREATE TABLE table_204_58 ( id number, "year" number, "position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the total amount that a team did not enter ?
SELECT COUNT(*) FROM table_204_58 WHERE "position" = 'did not enter'
squall
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( ...
SELECT demographic.age, demographic.days_stay FROM demographic WHERE demographic.subject_id = "23602"
mimicsql_data
CREATE TABLE table_11444 ( "Date" text, "Winning Team" text, "Losing Team" text, "Score" text, "Venue" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the losing team on June 16?
SELECT "Losing Team" FROM table_11444 WHERE "Date" = 'june 16'
wikisql
CREATE TABLE table_13109 ( "Elected" text, "Assembled" text, "Dissolved" text, "1st member" text, "2nd member" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Elected has a 1st member of thomas fanshawe?
SELECT "Elected" FROM table_13109 WHERE "1st member" = 'thomas fanshawe'
wikisql
CREATE TABLE table_dev_20 ( "id" int, "anemia" bool, "gender" string, "systolic_blood_pressure_sbp" int, "hemoglobin_a1c_hba1c" float, "platelets" int, "dyslipidemia" bool, "renal_disease" bool, "creatinine_clearance_cl" float, "neutropenia" int, "estimated_glomerular_filtrat...
SELECT * FROM table_dev_20 WHERE kidney_disease = 1 OR (creatinine_clearance_cl > 1.6 OR estimated_glomerular_filtration_rate_egfr < 60)
criteria2sql
CREATE TABLE table_40212 ( "Event" text, "2007\u201308" text, "2008\u201309" text, "2009\u201310" text, "2010\u201311" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Event when the 2008 09 is sf?
SELECT "Event" FROM table_40212 WHERE "2008\u201309" = 'sf'
wikisql
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, E...
SELECT Id AS "post_link", Score, Body, CreationDate FROM Posts WHERE Body LIKE '%it sounds good, it is good%' ORDER BY Score
sede
CREATE TABLE table_name_24 ( date VARCHAR, method VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did the technical knockout against Fatu Tuimanono happen?
SELECT date FROM table_name_24 WHERE method = "technical knockout" AND opponent = "fatu tuimanono"
sql_create_context
CREATE TABLE table_24440 ( "Day" text, "Stage" text, "Time (CET)" text, "Name" text, "Length" text, "Winner" text, "Time" text, "Avg. spd." text, "Rally leader" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is every time(cet) f...
SELECT "Time (CET)" FROM table_24440 WHERE "Name" = 'Lillehammer 2'
wikisql
CREATE TABLE table_name_49 ( money___£__ VARCHAR, to_par VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the money for the to par of -6
SELECT money___£__ FROM table_name_49 WHERE to_par = "-6"
sql_create_context
CREATE TABLE table_57139 ( "Year" text, "Security Forces" text, "Insurgents" text, "Civilians" text, "Total:" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the security forces for 2009
SELECT "Security Forces" FROM table_57139 WHERE "Year" = '2009'
wikisql
CREATE TABLE table_4939 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text ) -- Using valid SQLite, answer the following questions fo...
SELECT "Tries for" FROM table_4939 WHERE "Lost" = '7'
wikisql
CREATE TABLE table_64155 ( "Date" text, "Label" text, "Format" text, "Country" text, "Catalog" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the format for Catalog CL 2372?
SELECT "Format" FROM table_64155 WHERE "Catalog" = 'cl 2372'
wikisql
CREATE TABLE table_train_191 ( "id" int, "gender" string, "hemoglobin_a1c_hba1c" float, "diabetic" string, "serum_creatinine" float, "allergy_to_glyburide" bool, "kidney_disease" bool, "drug_abuse" bool, "age" float, "NOUSE" float ) -- Using valid SQLite, answer the following q...
SELECT * FROM table_train_191 WHERE drug_abuse = 1
criteria2sql
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
SELECT COUNT(*) > 0 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 = 20207) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.itemid IN (SELECT d_...
mimic_iii
CREATE TABLE table_name_37 ( name VARCHAR, lane VARCHAR, mark VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the name when the lane is less than 4 and mark is 52.64?
SELECT name FROM table_name_37 WHERE lane < 4 AND mark = "52.64"
sql_create_context
CREATE TABLE table_18823 ( "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 is...
SELECT "High rebounds" FROM table_18823 WHERE "Team" = 'Vancouver'
wikisql
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T1.Code DESC
nvbench
CREATE TABLE table_9218 ( "Tournament" text, "Surface" text, "Week" text, "Winner and score" text, "Finalist" text, "Semifinalists" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the surface for the week of october 25?
SELECT "Surface" FROM table_9218 WHERE "Week" = 'october 25'
wikisql
CREATE TABLE table_204_81 ( id number, "rank" number, "bib" number, "name" text, "country" text, "time" text, "deficit" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many skiers represented norway in the men 's 15 kilometre classical ?
SELECT COUNT("name") FROM table_204_81 WHERE "country" = 'norway'
squall
CREATE TABLE table_3979 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of cfl teams for jeff traversy
SELECT COUNT("CFL Team") FROM table_3979 WHERE "Player" = 'Jeff Traversy'
wikisql
CREATE TABLE table_69217 ( "Goalkeeper" text, "Goals" real, "Matches" real, "Average" real, "Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average goals less than 41 that goalkeeper Claudio Bravo had?
SELECT COUNT("Average") FROM table_69217 WHERE "Goals" < '41' AND "Goalkeeper" = 'claudio bravo'
wikisql
CREATE TABLE table_name_31 ( laps VARCHAR, grid VARCHAR, time_retired VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many laps for a grid larger than 1 with a Time/Retired of halfshaft?
SELECT laps FROM table_name_31 WHERE grid > 1 AND time_retired = "halfshaft"
sql_create_context
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId numbe...
SELECT * FROM (SELECT Id FROM Users WHERE Reputation > 100000) AS userProfile INNER JOIN (SELECT * FROM Posts WHERE Score > 200) AS postsProfile ON userProfile.Id = postsProfile.OwnerUserId
sede
CREATE TABLE table_name_78 ( location VARCHAR, opponent_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where was the game when Police S.A. was the opponent?
SELECT location FROM table_name_78 WHERE opponent_team = "police s.a."
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.ethnicity = "BLACK/HAITIAN" AND demographic.dob_year < "2090"
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 zyjzjlb ( CYBQDM text, CYBQMC...
SELECT zyjybgb.JYKSBM, zyjybgb.JYKSMC FROM zyjybgb WHERE zyjybgb.JZLSH = '05238824503' UNION SELECT mzjybgb.JYKSBM, mzjybgb.JYKSMC FROM mzjybgb WHERE mzjybgb.JZLSH = '05238824503'
css
CREATE TABLE table_name_84 ( city VARCHAR, county VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what city is brule in
SELECT city FROM table_name_84 WHERE county = "brule"
sql_create_context
CREATE TABLE zyb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '78964308' AND t_kc22.STA_DATE BETWEEN '2012-03-26' AND '2018-10-14' AND t_kc22.SELF_PAY_PRO < 0.65 UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.PERSON_ID = '7896430...
css
CREATE TABLE table_75912 ( "Rank" real, "Name" text, "Built" real, "Height" text, "Floors" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest Floors, when Built is greater than 1970, and when Name is NV Building 3?
SELECT MIN("Floors") FROM table_75912 WHERE "Built" > '1970' AND "Name" = 'nv building 3'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "M" AND prescriptions.drug = "Heparin Flush (10 units/ml)"
mimicsql_data
CREATE TABLE table_204_648 ( id number, "title" text, "contents" text, "pages" number, "published" text, "isbn" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how long , in pages , is volume 6 of doctor who classics ?
SELECT "pages" FROM table_204_648 WHERE "title" = 'volume 6'
squall