instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_11808 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Round" text, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the method used when the opponent was Tyson Griffin?
SELECT "Method" FROM table_11808 WHERE "Opponent" = 'tyson griffin'
wikisql
CREATE TABLE table_72330 ( "Club" text, "Played" text, "Won" 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 follo...
SELECT "Losing bonus" FROM table_72330 WHERE "Points" = '96'
wikisql
CREATE TABLE table_name_89 ( attendance VARCHAR, week VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the attendance at the week 2 game?
SELECT attendance FROM table_name_89 WHERE week = 2
sql_create_context
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TAB...
SELECT u.Id, u.DisplayName, u.Location FROM Users AS u JOIN (SELECT DISTINCT UserId FROM Badges WHERE LOWER(Name) IN ('java') AND Class IN (2, 3) AND TagBased = 1) AS tag_badges ON tag_badges.UserId = u.Id WHERE LOWER(Location) LIKE '%paris%'
sede
CREATE TABLE table_name_73 ( conference_semifinals VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Conference Semifinals has a Record of 55 27?
SELECT conference_semifinals FROM table_name_73 WHERE record = "55–27"
sql_create_context
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT T2.Name, COUNT(T2.Name) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name
nvbench
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT hz_info_mzjzjlb.YLJGDM FROM hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz...
css
CREATE TABLE table_60378 ( "Date" text, "Time" text, "Round" text, "Opponent" text, "Ground" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What opponent has 32 as the round?
SELECT "Opponent" FROM table_60378 WHERE "Round" = '32'
wikisql
CREATE TABLE table_name_10 ( round INTEGER, position VARCHAR, overall VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the sum of the rounds for the player who had a position of LS and an overall draft pick bigger than 230?
SELECT SUM(round) FROM table_name_10 WHERE position = "ls" AND overall > 230
sql_create_context
CREATE TABLE table_46145 ( "Date" text, "Round" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Date has a Result of 2 2, and a Venue of H?
SELECT "Date" FROM table_46145 WHERE "Result" = '2–2' AND "Venue" = 'h'
wikisql
CREATE TABLE table_19387 ( "Region" text, "Capital" text, "Area (km\u00b2)" real, "Area (sq mi)" real, "Population" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the region where Milan is located?
SELECT "Region" FROM table_19387 WHERE "Capital" = 'Milan'
wikisql
CREATE TABLE table_71205 ( "Outcome" text, "Date" text, "Surface" text, "Opponent in the final" text, "Score in the final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score in the final with runner-up as the outcome and hard (i) as th...
SELECT "Score in the final" FROM table_71205 WHERE "Outcome" = 'runner-up' AND "Surface" = 'hard (i)'
wikisql
CREATE TABLE table_75325 ( "NTFA Div 2" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest number of draws of the NTFA Div 2 Lilydale?
SELECT MIN("Draws") FROM table_75325 WHERE "NTFA Div 2" = 'lilydale'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREAT...
SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-16123' AND NOT patient.hospitaldischargetime IS NULL ORDER BY...
eicu
CREATE TABLE table_2562572_52 ( cyrillic_name VARCHAR, settlement VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the cyrillic name when the settlement is a anja?
SELECT cyrillic_name FROM table_2562572_52 WHERE settlement = "Ašanja"
sql_create_context
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.dob_year < "2053" AND prescriptions.route = "IVPCA"
mimicsql_data
CREATE TABLE ROLES ( role_code VARCHAR, role_name VARCHAR ) CREATE TABLE Employees ( employee_id VARCHAR, role_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the employee ids for all employees with role name 'Human Resource' or 'Manager'.
SELECT T1.employee_id FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_code WHERE T2.role_name = "Human Resource" OR T2.role_name = "Manager"
sql_create_context
CREATE TABLE table_15475116_1 ( league VARCHAR, school VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What league does Delaware Military Academy belong to
SELECT league FROM table_15475116_1 WHERE school = "Delaware Military Academy"
sql_create_context
CREATE TABLE table_name_19 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What shows for 2000 when 2013 shows 3rd?
SELECT 2000 FROM table_name_19 WHERE 2013 = "3rd"
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_CLINIC_ID text, MED_DIRE_CD tex...
SELECT qtb.IN_DIAG_DIS_CD, qtb.IN_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_ID = '77164356' AND qtb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 6696.69) UNION SELECT gyb.IN_DIAG_DIS_CD, gyb.IN_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_ID = '77164356' AND gyb.MED_CLINIC_ID IN (SELECT t_kc2...
css
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Hemorrhage complic proc"
mimicsql_data
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT microbiologyevents.hadm_id FROM microbiologyevents WHERE microbiologyevents.spec_type_desc = 'fluid received in blood culture bottles' AND STRFTIME('%y', microbiologyevents.charttime) <= '2101')
mimic_iii
CREATE TABLE table_74995 ( "Year" real, "Date" text, "Winner" text, "Result" text, "Loser" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the Loser when the winner was new england patriots, and a Location of ...
SELECT "Loser" FROM table_74995 WHERE "Winner" = 'new england patriots' AND "Location" = 'giants stadium' AND "Result" = '30–28'
wikisql
CREATE TABLE table_name_74 ( score VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the Score for the Game of 75?
SELECT score FROM table_name_74 WHERE game = 75
sql_create_context
CREATE TABLE table_50616 ( "Game" text, "Day, Date" text, "Anand" text, "Gelfand" text, "Standing" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the day and date of game 2?
SELECT "Day, Date" FROM table_50616 WHERE "Game" = '2'
wikisql
CREATE TABLE table_682 ( "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. -- What was the result of the election in which the incumbent was first elec...
SELECT "Results" FROM table_682 WHERE "First elected" = '1984'
wikisql
CREATE TABLE table_33227 ( "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 was the smallest crowd that Melbourne playe...
SELECT MIN("Crowd") FROM table_33227 WHERE "Home team" = 'melbourne'
wikisql
CREATE TABLE table_7519 ( "Heat" real, "Lane" real, "Name" text, "Country" text, "Mark" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest heat for Ihor Bodrov when the mark is 6.76 and the lane is less than 1?
SELECT MAX("Heat") FROM table_7519 WHERE "Mark" = '6.76' AND "Name" = 'ihor bodrov' AND "Lane" < '1'
wikisql
CREATE TABLE table_28947 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the district with the candidates leven powell (f) 63.8% roger we...
SELECT "District" FROM table_28947 WHERE "Candidates" = 'Leven Powell (F) 63.8% Roger West (DR) 36.4%'
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.short_title = "Paralytic ileus"
mimicsql_data
CREATE TABLE Catalog_Contents_Additional_Attributes ( catalog_entry_id INTEGER, catalog_level_number INTEGER, attribute_id INTEGER, attribute_value VARCHAR(255) ) CREATE TABLE Catalog_Contents ( catalog_entry_id INTEGER, catalog_level_number INTEGER, parent_entry_id INTEGER, previous_en...
SELECT attribute_name, COUNT(attribute_name) FROM Attribute_Definitions AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.attribute_id = t2.attribute_id WHERE t2.attribute_value = 0 GROUP BY attribute_name ORDER BY attribute_name
nvbench
CREATE TABLE table_19481 ( "Pick #" real, "NFL Team" text, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What college did the defensive back attend?
SELECT "College" FROM table_19481 WHERE "Position" = 'Defensive Back'
wikisql
CREATE TABLE table_20434 ( "Result" text, "Date" text, "Race" text, "Venue" text, "Group" text, "Distance" text, "Weight (kg)" text, "Time" text, "Jockey" text, "Winner/2nd" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is ...
SELECT "Weight (kg)" FROM table_20434 WHERE "Jockey" = 'D. Nikolic'
wikisql
CREATE TABLE table_204_208 ( id number, "year" text, "title" text, "role" text, "episodes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what title came directly after this morning ?
SELECT "title" FROM table_204_208 WHERE id = (SELECT id FROM table_204_208 WHERE "title" = 'this morning') + 1
squall
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 t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_CD, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '5091059' GROUP BY t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_CD
css
CREATE TABLE table_name_24 ( lost VARCHAR, points_difference VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of losses for the team with a points difference of -25?
SELECT lost FROM table_name_24 WHERE points_difference = "-25"
sql_create_context
CREATE TABLE table_28803 ( "English" text, "Galician ( Official )" text, "Galician ( Reintegrationist )" text, "Portuguese" text, "Spanish" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Galician (reintegrationist) word of the Galician (...
SELECT "Galician ( Reintegrationist )" FROM table_28803 WHERE "Galician ( Official )" = 'Bo día / Bos días'
wikisql
CREATE TABLE table_24915874_1 ( placing VARCHAR, jockey VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the placing when the jockey was Damien Oliver?
SELECT placing FROM table_24915874_1 WHERE jockey = "Damien Oliver"
sql_create_context
CREATE TABLE table_8423 ( "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 is the score of the United States, which has a to par of +5?
SELECT "Score" FROM table_8423 WHERE "Country" = 'united states' AND "To par" = '+5'
wikisql
CREATE TABLE table_72529 ( "Player" text, "Position" text, "Starter" text, "Touchdowns" real, "Extra points" real, "Field goals" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of points for field goals being 1
SELECT COUNT("Points") FROM table_72529 WHERE "Field goals" = '1'
wikisql
CREATE TABLE table_name_83 ( tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the 2012 during Wimbledon and had a Q3 in 2008?
SELECT 2012 FROM table_name_83 WHERE 2008 = "q3" AND tournament = "wimbledon"
sql_create_context
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_cred...
SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.friday = 'N' AND course_offering.monday = 'Y' AND course_offering.thursday = 'N' AND course_offering.tuesday = 'N' AND course_offering.wednesday = 'Y' AND course.course_id = course_offering.course_id AND course.department = 'EECS' AND cour...
advising
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 COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '5136139' AND t_kc21.IN_HOSP_DATE BETWEEN '2012-09-20' AND '2019-05-04' AND t_kc21.CLINIC_TYPE = '门诊'
css
CREATE TABLE table_14189 ( "Constituency number" text, "Name" text, "Reserved for ( SC / ST /None)" text, "District" text, "Number of electorates (2009)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Name has a Number of electorates (2009) gr...
SELECT "Name" FROM table_14189 WHERE "Number of electorates (2009)" > '188,799'
wikisql
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS Rank, DisplayName, Age, CreationDate, Reputation, CONCAT('http://stackoverflow.com/users/', Id) AS Profile FROM Users WHERE Age <= 25 AND Reputation > 8000 ORDER BY Reputation DESC
sede
CREATE TABLE mzjybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH number, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, ...
SELECT COUNT(*) FROM (SELECT zyjybgb.KSBM FROM mzjzjlb JOIN zyjybgb ON mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE mzjzjlb.YLJGDM = '1771451' AND zyjybgb.BGRQ BETWEEN '2003-09-14' AND '2010-01-28' GROUP BY zyjybgb.KSBM HAVING COUNT(*) <= 20 UNION SELECT mzjybgb.KSBM FROM mzjz...
css
CREATE TABLE table_name_78 ( record VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the record of the game for game 31?
SELECT record FROM table_name_78 WHERE game = 31
sql_create_context
CREATE TABLE table_67669 ( "Position" text, "Player" text, "County team" text, "Club team(s)" text, "Team Number" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which county team has jimmy finn as the player?
SELECT "County team" FROM table_67669 WHERE "Player" = 'jimmy finn'
wikisql
CREATE TABLE table_name_71 ( game INTEGER, november VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the record is listed as 2-0-0, and the November date is less than 27, what is the sum of the game?
SELECT SUM(game) FROM table_name_71 WHERE november < 27 AND record = "2-0-0"
sql_create_context
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 COUNT(DISTINCT patient.uniquepid) FROM patient WHERE NOT patient.hospitaldischargetime IS NULL AND STRFTIME('%y', patient.hospitaldischargetime) = '2102'
eicu
CREATE TABLE table_51817 ( "Tournament" text, "1968" text, "1969" text, "1970" text, "1971" text, "1972" text, "1973" text, "1974" text, "1975" text, "1976" text, "1977" text, "1978" text, "1979" text, "Career SR" text, "Career W\u2013L" text, "Career Win ...
SELECT "Career W\u2013L" FROM table_51817 WHERE "1976" = 'a'
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 microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name te...
SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 40435) AND prescriptions.drug = 'neo*iv*gentamicin' AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month')...
mimic_iii
CREATE TABLE table_name_63 ( date VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was there a record of 13 17 3?
SELECT date FROM table_name_63 WHERE record = "13–17–3"
sql_create_context
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE admissions ( row_id num...
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.i...
mimic_iii
CREATE TABLE table_28750142_1 ( jockey VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the jockey for Pink Gin?
SELECT jockey FROM table_28750142_1 WHERE name = "Pink Gin"
sql_create_context
CREATE TABLE customers ( customer_id number, customer_first_name text, customer_middle_initial text, customer_last_name text, gender text, email_address text, login_name text, login_password text, phone_number text, town_city text, state_county_province text, country text...
SELECT T1.invoice_date, T1.order_id, T2.order_details FROM invoices AS T1 JOIN orders AS T2 ON T1.order_id = T2.order_id
spider
CREATE TABLE table_22457674_1 ( european_tier VARCHAR, artist VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the european tier for rick springfield
SELECT european_tier FROM table_22457674_1 WHERE artist = "Rick Springfield"
sql_create_context
CREATE TABLE table_12792876_3 ( drawn VARCHAR, tries_against VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the drawn when the tries against was 89?
SELECT drawn FROM table_12792876_3 WHERE tries_against = "89"
sql_create_context
CREATE TABLE table_10797 ( "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. -- Which Away team has a Home team score of 7.8 (50...
SELECT "Away team" FROM table_10797 WHERE "Home team score" = '7.8 (50)'
wikisql
CREATE TABLE table_12265 ( "Draft" real, "Round" text, "Pick" real, "Player" text, "Nationality" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the round of player brad winton with a draft before 1983 and a pick less than 132?
SELECT "Round" FROM table_12265 WHERE "Draft" < '1983' AND "Pick" < '132' AND "Player" = 'brad winton'
wikisql
CREATE TABLE table_28970 ( "Species" text, "Common Name" text, "Protein Name" text, "Accession Number" text, "NT Length" text, "NT Identity" text, "AA Length" text, "AA Identity" text, "E-Value" text ) -- Using valid SQLite, answer the following questions for the tables provided ab...
SELECT "Protein Name" FROM table_28970 WHERE "E-Value" = '2.50E-41'
wikisql
CREATE TABLE bdmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
SELECT * FROM person_info JOIN hz_info JOIN wdmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE person_info.XM = '孙和煦' AND hz_info.YLJGDM = '4311972' AND wdmzjzjlb.JZZDSM LIKE '%脑血管病%' UNION SELECT * FROM person_info JOIN...
css
CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departure_flight_number int, stop_time int ) CREATE TABLE date_day ( ...
SELECT DISTINCT FLIGHT_0.arrival_time, FLIGHT_0.departure_time FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight AS FLIGHT_0, flight AS FLIGHT_1, flight_leg WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE' AND C...
atis
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRA...
atis
CREATE TABLE table_1346 ( "Num" real, "Team" text, "W" real, "L" real, "PCT" text, "PF" real, "PA" real, "Last appearance" real, "Last championship" real, "HOME games" real, "Home wins" real, "Home losses" real, "Home Win Pct." text, "ROAD games" real, "Road w...
SELECT MAX("Num") FROM table_1346 WHERE "L" < '6.0'
wikisql
CREATE TABLE table_name_5 ( points INTEGER, february INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Points a February smaller than 1 have?
SELECT MIN(points) FROM table_name_5 WHERE february < 1
sql_create_context
CREATE TABLE table_name_91 ( completed VARCHAR, builder VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did chatham complete the Hmsmedusa?
SELECT completed FROM table_name_91 WHERE builder = "chatham" AND name = "hmsmedusa"
sql_create_context
CREATE TABLE table_14209245_9 ( nationality VARCHAR, college_junior_club_team__league_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the nationality of the player whose college/junior/club team (league) is Seattle Thunderbirds (WHL)?
SELECT nationality FROM table_14209245_9 WHERE college_junior_club_team__league_ = "Seattle Thunderbirds (WHL)"
sql_create_context
CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE plays_games ( stuid number, gameid number, hours_played number ) CREATE TABLE sportsinfo ( stuid number, sportname text, ...
SELECT gtype FROM video_games WHERE gname = "Call of Destiny"
spider
CREATE TABLE department ( dept_code text, dept_name text, school_code text, emp_num number, dept_address text, dept_extension text ) CREATE TABLE class ( class_code text, crs_code text, class_section text, class_time text, class_room text, prof_num number ) CREATE TABLE...
SELECT COUNT(DISTINCT dept_address), school_code FROM department GROUP BY school_code
spider
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "81" AND diagnoses.short_title = "Polymyalgia rheumatica"
mimicsql_data
CREATE TABLE table_25887826_17 ( avg VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many figures for 08 A points for the team with 1.1863 average?
SELECT COUNT(08 AS _a_pts) FROM table_25887826_17 WHERE avg = "1.1863"
sql_create_context
CREATE TABLE table_name_95 ( tournament VARCHAR, score VARCHAR, outcome VARCHAR, surface VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which tournament has an Outcome of runner-up, a Surface of hard, and a Score of 6 4, 6 2?
SELECT tournament FROM table_name_95 WHERE outcome = "runner-up" AND surface = "hard" AND score = "6–4, 6–2"
sql_create_context
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Code DESC
nvbench
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.icd9_code = "9672"
mimicsql_data
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TA...
SELECT t3.treatmentname FROM (SELECT t2.treatmentname, 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 = 'oxygen therapy (40% to 60%) - reduce fio...
eicu
CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adults INTEGER, Kids INTEGER ) CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, baseP...
SELECT bedType, COUNT(*) FROM Rooms GROUP BY bedType
nvbench
CREATE TABLE broadcast_share ( Channel_ID int, Program_ID int, Date text, Share_in_percent real ) CREATE TABLE program ( Program_ID int, Name text, Origin text, Launch real, Owner text ) CREATE TABLE broadcast ( Channel_ID int, Program_ID int, Time_of_day text ) CREATE...
SELECT Time_of_day, COUNT(*) FROM broadcast GROUP BY Time_of_day ORDER BY COUNT(*)
nvbench
CREATE TABLE table_16226 ( "1st players choice" text, "2nd players choice" text, "Probability 1st player wins" text, "Probability 2nd player wins" text, "Probability of a draw" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In Penney's game what is ...
SELECT "Probability 1st player wins" FROM table_16226 WHERE "Probability of a draw" = '8.28%' AND "2nd players choice" = 'B BR'
wikisql
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 * FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '81533659' AND hz_info.YLJGDM = '4316976' AND mzjzjlb.JZZDSM LIKE '%相%'
css
CREATE TABLE table_14160327_4 ( family_friendly VARCHAR, decade VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many family friendly games are in the 1990s?
SELECT COUNT(family_friendly) FROM table_14160327_4 WHERE decade = "1990s"
sql_create_context
CREATE TABLE table_name_59 ( height VARCHAR, year VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Height of Junior Meghan Austin?
SELECT height FROM table_name_59 WHERE year = "junior" AND name = "meghan austin"
sql_create_context
CREATE TABLE table_name_32 ( position VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position is Sal Martinez?
SELECT position FROM table_name_32 WHERE player = "sal martinez"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2167" AND procedures.icd9_code = "3532"
mimicsql_data
CREATE TABLE table_55269 ( "Round" text, "Date" text, "Matches" real, "Clubs" text, "New entries this round" text, "Prize money" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many matches were there in the round with 1,000,000 in prize mone...
SELECT COUNT("Matches") FROM table_55269 WHERE "Prize money" = '£1,000,000'
wikisql
CREATE TABLE table_name_89 ( grid INTEGER, laps VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the highest grid for Laps more than 137 and rank is less than 8
SELECT MAX(grid) FROM table_name_89 WHERE laps > 137 AND rank < 8
sql_create_context
CREATE TABLE table_name_56 ( role VARCHAR, festival_organization VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What role was nominated at the Sydney Film Festival?
SELECT role FROM table_name_56 WHERE festival_organization = "sydney film festival"
sql_create_context
CREATE TABLE table_26688 ( "Episode number Production number" text, "Title" text, "Original airdate" text, "Time of airing" text, "Total viewers on Hallmark" real, "Total viewers on Hallmark+1" real, "Total viewers" real, "Rank on channel" text ) -- Using valid SQLite, answer the follo...
SELECT "Rank on channel" FROM table_26688 WHERE "Title" = 'Pilot'
wikisql
CREATE TABLE table_name_64 ( opponent VARCHAR, time VARCHAR, ground VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the Opponent playing at 20:00 GMT at Camp Nou?
SELECT opponent FROM table_name_64 WHERE time = "20:00 gmt" AND ground = "camp nou"
sql_create_context
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 COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '苗星河' AND t_kc22.STA_DATE BETWEEN '2000-07-11' AND '2017-06-02' AND t_kc22.t_kc21_MED_SER_ORG_NO = '0680435' AND t_kc22.MED_INV_ITEM_TYPE = '西药费'
css
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE cost ( row_id number, subject_id number, hadm...
SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime, t1.hadm_id FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FRO...
mimic_iii
CREATE TABLE table_name_94 ( blackpool INTEGER, draw VARCHAR, preston_north_end VARCHAR, competition VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Blackpool has a Preston North End smaller than 46, and a Competition of other, and a Draw larger...
SELECT SUM(blackpool) FROM table_name_94 WHERE preston_north_end < 46 AND competition = "other" AND draw > 1
sql_create_context
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number,...
SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-36108')) AND intakeoutput.cellpath LIKE '%output%...
eicu
CREATE TABLE wdmzjzjlb ( 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 wdmzjzjlb.JZJSSJ FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '51309268056' UNION SELECT bdmzjzjlb.JZJSSJ FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '51309268056'
css
CREATE TABLE table_name_25 ( record VARCHAR, home VARCHAR, decision VARCHAR, visitor VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the team's record when the NY rangers are at home with atlanta visting and lehtonen getting the decision?
SELECT record FROM table_name_25 WHERE decision = "lehtonen" AND visitor = "atlanta" AND home = "ny rangers"
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospit...
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-52327')) AND NOT vitalperiodic.heartrate IS NUL...
eicu
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, ...
SELECT AVG(vitalperiodic.systemicmean) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-4987') AND NOT patient.unitdischargetime IS N...
eicu
CREATE TABLE table_16081 ( "Headstamp ID" text, "Primer Annulus Color" text, "Bullet Tip Color" text, "Other Features" text, "Functional Type" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For the headstamp id of h2, what was the color of the bulle...
SELECT "Bullet Tip Color" FROM table_16081 WHERE "Headstamp ID" = 'H2'
wikisql
CREATE TABLE table_54456 ( "Episode" text, "Rating" real, "Share" real, "Rating/Share (18-49)" text, "Viewers (millions)" real, "Rank (timeslot)" real, "Rank (night)" real, "Rank (week)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- wha...
SELECT AVG("Rank (night)") FROM table_54456 WHERE "Rating" > '4.3' AND "Viewers (millions)" > '10.72'
wikisql
CREATE TABLE Customers_Cards ( card_id INTEGER, customer_id INTEGER, card_type_code VARCHAR(15), card_number VARCHAR(80), date_valid_from DATETIME, date_valid_to DATETIME, other_card_details VARCHAR(255) ) CREATE TABLE Accounts ( account_id INTEGER, customer_id INTEGER, account_...
SELECT card_type_code, COUNT(*) FROM Customers_Cards GROUP BY card_type_code ORDER BY COUNT(*) DESC
nvbench