instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_55696 ( "D 41" text, "D 42" text, "D 43" text, "D 44" text, "D 45" text, "D 46" text, "D 47" text, "R 53" text, "R 52" text, "R 51" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- I want the D 46 which has a D 4...
SELECT "D 46" FROM table_55696 WHERE "D 44" = 'r 17'
wikisql
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int,...
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 = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'S...
atis
CREATE TABLE table_7421 ( "Home team" text, "Away team" text, "Match score" text, "\"Pick The Winners\" score" text, "FootyTAB winner" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Match score when the FootyTAB winner was norths?
SELECT "Match score" FROM table_7421 WHERE "FootyTAB winner" = 'norths'
wikisql
CREATE TABLE table_74200 ( "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. -- How ma...
SELECT COUNT("Date") FROM table_74200 WHERE "High points" = 'Kevin Love (22)'
wikisql
CREATE TABLE table_26071 ( "Period" text, "Live births per year" text, "Deaths per year" text, "Natural change per year" text, "CBR*" text, "CDR*" text, "NC*" text, "TFR*" text, "IMR*" real, "Life expectancy total" text, "Life expectancy males" text, "Life expectancy fema...
SELECT COUNT("IMR*") FROM table_26071 WHERE "TFR*" = '5.35'
wikisql
CREATE TABLE table_name_9 ( draft VARCHAR, pick VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In which year was the Pick #46?
SELECT draft FROM table_name_9 WHERE pick = "46"
sql_create_context
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE diagnoses_icd ( row_id number, ...
SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'benztropine mesylate') AND DATETIME(cost.chargetime) >= DATETIME(CURRENT_TIME(), '-1 year') GROUP BY cost.hadm_id) AS t1
mimic_iii
CREATE TABLE table_27442 ( "Prefecture" text, "City/Town" text, "High School Name" text, "Year of Previous Participation" text, "Total Number of Participation" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what prefecture is Susaki located?
SELECT "Prefecture" FROM table_27442 WHERE "City/Town" = 'Susaki'
wikisql
CREATE TABLE table_name_73 ( points INTEGER, team VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average point total for arrows racing team before 1983?
SELECT AVG(points) FROM table_name_73 WHERE team = "arrows racing team" AND year < 1983
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND prescriptions.drug = "NEO*PO*Vitamin E Drops"
mimicsql_data
CREATE TABLE table_name_13 ( silver INTEGER, bronze VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many total Silver has a Bronze larger than 19 and a Total smaller than 125?
SELECT SUM(silver) FROM table_name_13 WHERE bronze > 19 AND total < 125
sql_create_context
CREATE TABLE table_name_77 ( venue VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What venue had a draw?
SELECT venue FROM table_name_77 WHERE result = "draw"
sql_create_context
CREATE TABLE table_32860 ( "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. -- Who was the away team for the game where the hom...
SELECT "Away team" FROM table_32860 WHERE "Home team score" = '13.11 (89)'
wikisql
CREATE TABLE table_name_25 ( rank INTEGER, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the top rank with a time of 2:19.86?
SELECT MAX(rank) FROM table_name_25 WHERE time = "2:19.86"
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.expire_flag = "0" AND lab.label = "Cortisol"
mimicsql_data
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT * FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '23984748' AND hz_info.YLJGDM = '0159261' AND wdmzjzjlb.JZZDSM LIKE '%白内障%' UNION SELECT * FROM hz_info JOIN bdmzjzjlb ON hz_info.YLJGDM = bdmzjzjlb.YLJGDM AND hz_...
css
CREATE TABLE table_69419 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Pick # smaller than 11, and a Name of von hutchins belongs to what college?
SELECT "College" FROM table_69419 WHERE "Pick #" < '11' AND "Name" = 'von hutchins'
wikisql
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) 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,...
SELECT COUNT(*) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'AERO' AND course.number = 311 AND semester.semester = 'WN' AND semester.semester_id = course_offering.semester AND semester.year = 2016
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 MAX(demographic.age) FROM demographic WHERE demographic.gender = "F" AND demographic.ethnicity = "ASIAN"
mimicsql_data
CREATE TABLE table_name_69 ( torque VARCHAR, notes VARCHAR, engine VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the torque when the notes are laredo, limited, overland and the engine is 5.7l hemi v8?
SELECT torque FROM table_name_69 WHERE notes = "laredo, limited, overland" AND engine = "5.7l hemi v8"
sql_create_context
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decima...
SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40
nvbench
CREATE TABLE table_name_37 ( hindi VARCHAR, tamil VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT HINDI HAS Tamil of vyazhan?
SELECT hindi FROM table_name_37 WHERE tamil = "vyazhan"
sql_create_context
CREATE TABLE table_58373 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score of the game that had a visiting team of Edmonton?
SELECT "Score" FROM table_58373 WHERE "Visitor" = 'edmonton'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND procedures.icd9_code = "3806"
mimicsql_data
CREATE TABLE table_name_69 ( region VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the region for tv vtv?
SELECT region FROM table_name_69 WHERE name = "tv vtv"
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.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T2.Headquarter
nvbench
CREATE TABLE table_36223 ( "Surname" text, "First" text, "D.O.B." text, "Bats" text, "Throws" text, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Position has Throws of r, and a DOB of 12 february 1983?
SELECT "Position" FROM table_36223 WHERE "Throws" = 'r' AND "D.O.B." = '12 february 1983'
wikisql
CREATE TABLE Apartment_Facilities ( apt_id VARCHAR ) CREATE TABLE Apartments ( apt_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many apartments do not have any facility?
SELECT COUNT(*) FROM Apartments WHERE NOT apt_id IN (SELECT apt_id FROM Apartment_Facilities)
sql_create_context
CREATE TABLE table_49906 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the Score of craig stadler?
SELECT "Score" FROM table_49906 WHERE "Player" = 'craig stadler'
wikisql
CREATE TABLE table_45745 ( "Date" text, "at/vs." text, "Opponent'" text, "Score'" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the at/vs against the New York Saints with over 16,042 in attendance?
SELECT "at/vs." FROM table_45745 WHERE "Opponent'" = 'new york saints' AND "Attendance" > '16,042'
wikisql
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_NM = '彭金鑫' AND MED_SER_ORG_NO = '2214743' AND NOT OUT_DIAG_DIS_NM LIKE '%精神%'
css
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(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'heparin flush hickman (100 units/ml)' AND STRFTIME('%y', prescriptions.startdate) >= '2101')
mimic_iii
CREATE TABLE table_33272 ( "Dance" text, "Best dancer" text, "Best score" real, "Worst dancer" text, "Worst score" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the Best dancer with the Worst dancer of Jerry Springer, a Best score of 29, and...
SELECT "Best dancer" FROM table_33272 WHERE "Worst dancer" = 'jerry springer' AND "Best score" = '29' AND "Dance" = 'quickstep'
wikisql
CREATE TABLE table_name_20 ( silver VARCHAR, nation VARCHAR, gold VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many silver medals did Estonia, which won more than 1 gold and less than 97 medals total, win?
SELECT silver FROM table_name_20 WHERE gold > 1 AND total < 97 AND nation = "estonia"
sql_create_context
CREATE TABLE table_48014 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What tournament did Thomaz Bellucci become runner-up on a clay surface?
SELECT "Tournament" FROM table_48014 WHERE "Outcome" = 'runner-up' AND "Surface" = 'clay'
wikisql
CREATE TABLE Scientists ( SSN int, Name Char(30) ) CREATE TABLE Projects ( Code Char(4), Name Char(50), Hours int ) CREATE TABLE AssignedTo ( Scientist int, Project char(4) ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the ...
SELECT T2.Name, COUNT(T2.Name) FROM AssignedTo AS T1 JOIN Projects AS T2 ON T1.Project = T2.Code JOIN Scientists AS T3 ON T1.Scientist = T3.SSN WHERE T3.Name LIKE '%Smith%' GROUP BY T2.Name ORDER BY T2.Name
nvbench
CREATE TABLE table_10020178_1 ( name VARCHAR, crest_length__meters_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the 375 crest length?
SELECT name FROM table_10020178_1 WHERE crest_length__meters_ = 375
sql_create_context
CREATE TABLE table_name_18 ( t20_matches VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What T20 Match has a total of 23?
SELECT t20_matches FROM table_name_18 WHERE total = "23"
sql_create_context
CREATE TABLE table_65649 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the largest amount of bronze medals when the silver medals are less than 1, and Belg...
SELECT MAX("Bronze") FROM table_65649 WHERE "Silver" < '1' AND "Nation" = 'belgium (bel)' AND "Gold" < '0'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "7242" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE table_name_39 ( driver VARCHAR, time_retired VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which driver had a time off course?
SELECT driver FROM table_name_39 WHERE time_retired = "off course"
sql_create_context
CREATE TABLE table_name_68 ( medal VARCHAR, event VARCHAR, games VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What medal was won in the men's light welterweight event at the 1996 Atlanta games?
SELECT medal FROM table_name_68 WHERE event = "men's light welterweight" AND games = "1996 atlanta"
sql_create_context
CREATE TABLE table_61262 ( "Military deaths" text, "Civilian deaths" text, "Total deaths (not including foreigners)" text, "Military and/or Civilian wounded" text, "Total casualties" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many civilians ...
SELECT "Civilian deaths" FROM table_61262 WHERE "Total deaths (not including foreigners)" = '178'
wikisql
CREATE TABLE table_15700367_6 ( runs_conceded VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many players named sanath jayasuriya?
SELECT COUNT(runs_conceded) FROM table_15700367_6 WHERE name = "Sanath Jayasuriya"
sql_create_context
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT All_Road, Team_ID FROM basketball_match ORDER BY All_Road
nvbench
CREATE TABLE restaurant ( id int, name varchar, food_type varchar, city_name varchar, rating "decimal ) CREATE TABLE location ( restaurant_id int, house_number int, street_name varchar, city_name varchar ) CREATE TABLE geographic ( city_name varchar, county varchar, reg...
SELECT location.house_number, restaurant.name FROM geographic, location, restaurant WHERE geographic.region = 'yosemite and mono lake area' AND restaurant.city_name = geographic.city_name AND restaurant.food_type = 'french' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5
restaurants
CREATE TABLE table_16677738_1 ( inns_of_court_and_chancery VARCHAR, without_the_walls VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 70489 is without walls what is the inns of court and chancery?
SELECT inns_of_court_and_chancery FROM table_16677738_1 WHERE without_the_walls = 70489
sql_create_context
CREATE TABLE table_name_62 ( winning_party_2003 VARCHAR, constituency VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the Winning party of 2003 that has the Constituency of aberdeen north?
SELECT winning_party_2003 FROM table_name_62 WHERE constituency = "aberdeen north"
sql_create_context
CREATE TABLE table_52409 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who built the car that has a Time/Retired of 1:36:38.887?
SELECT "Constructor" FROM table_52409 WHERE "Time/Retired" = '1:36:38.887'
wikisql
CREATE TABLE files ( f_id VARCHAR, formats VARCHAR, resolution INTEGER ) CREATE TABLE song ( f_id VARCHAR, formats VARCHAR, resolution INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the ids of songs that are available in either mp4 ...
SELECT f_id FROM files WHERE formats = "mp4" UNION SELECT f_id FROM song WHERE resolution > 720
sql_create_context
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time )...
SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '003-10438' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi...
eicu
CREATE TABLE table_name_70 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who attended the school in 2006, that Jasmine Wilson attended in 2005?
SELECT 2006 FROM table_name_70 WHERE 2005 = "jasmine wilson"
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 T1.Code, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code
nvbench
CREATE TABLE table_77584 ( "Rank" real, "Rider" text, "Team" text, "Speed" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the rank of the rider with time of 1:41.40.55?
SELECT SUM("Rank") FROM table_77584 WHERE "Time" = '1:41.40.55'
wikisql
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 PostNoticeTypes ( Id number, ClassId ...
SELECT Q.Id AS "post_link", MAX(A1.Id) AS "post_link", Q.Score, Q.AnswerCount, Q.ClosedDate FROM Posts AS Q, Posts AS A1 WHERE Q.PostTypeId = 1 AND Q.Tags LIKE '%code-golf%' AND NOT Q.Tags LIKE '%tips%' AND A1.ParentId = Q.Id AND A1.PostTypeId = 2 AND LOWER(A1.Body) LIKE CONCAT('%', LOWER('##Language1:string##'), '%') ...
sede
CREATE TABLE table_name_74 ( team VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Team has a Record of 17 8?
SELECT team FROM table_name_74 WHERE record = "17–8"
sql_create_context
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) 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 pat...
SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_di...
mimic_iii
CREATE TABLE table_67022 ( "Year" real, "Chassis" text, "Engine" text, "Start" text, "Finish" text, "Entrant" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Engine had a chassis of March 85c?
SELECT "Engine" FROM table_67022 WHERE "Chassis" = 'march 85c'
wikisql
CREATE TABLE table_name_54 ( silver VARCHAR, gold VARCHAR, bronze VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many silver medals were won by the participant(s) that had more than 12 gold medals and 11 bronze medals?
SELECT silver FROM table_name_54 WHERE gold > 12 AND bronze = 11
sql_create_context
CREATE TABLE table_204_256 ( id number, "position" number, "club" text, "played" number, "points" number, "wins" number, "draws" number, "losses" number, "goals for" number, "goals against" number, "goal difference" number ) -- Using valid SQLite, answer the following quest...
SELECT "club" FROM table_204_256 ORDER BY "points" DESC LIMIT 1
squall
CREATE TABLE table_name_23 ( rank__number VARCHAR, opponent_number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the rank when the opponent was Wisconsin (played at Wisconsin)?
SELECT rank__number FROM table_name_23 WHERE opponent_number = "at wisconsin"
sql_create_context
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE fare ( fare_id int, ...
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 = 'ST. LOUIS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'COL...
atis
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
SELECT Name, COUNT(Name) FROM Products GROUP BY Name ORDER BY Name
nvbench
CREATE TABLE table_name_12 ( place VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the place when the score was 70-69-74=213?
SELECT place FROM table_name_12 WHERE score = 70 - 69 - 74 = 213
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 COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.MED_SER_ORG_NO = '9352968' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2003-04-09' AND '2005-01-31' GROUP B...
css
CREATE TABLE table_59384 ( "Week 2" text, "Week 3" text, "Week 4" text, "Week 5" text, "Week 6" text, "Week 7" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is week 6 when week 7, week 4, and week 3 are evicted and week 2 29.35?
SELECT "Week 6" FROM table_59384 WHERE "Week 7" = 'evicted' AND "Week 4" = 'evicted' AND "Week 3" = 'evicted' AND "Week 2" = '29.35'
wikisql
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.discharge_location = "LONG TERM CARE HOSPITAL" AND demographic.admityear < "2178"
mimicsql_data
CREATE TABLE table_60540 ( "Country" text, "Date" text, "Label" text, "Format" text, "Catalogue number(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Country has a Catalogue number(s) of eredv711?
SELECT "Country" FROM table_60540 WHERE "Catalogue number(s)" = 'eredv711'
wikisql
CREATE TABLE table_name_5 ( winning_score VARCHAR, tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the winning score in the mazda senior tournament players championship?
SELECT winning_score FROM table_name_5 WHERE tournament = "mazda senior tournament players championship"
sql_create_context
CREATE TABLE table_name_64 ( award VARCHAR, writer_s_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the name of the award that Edward Jeffreys was the writer?
SELECT award FROM table_name_64 WHERE writer_s_ = "edward jeffreys"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2122.0" AND prescriptions.formulary_drug_cd = "PRED5SM"
mimicsql_data
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 * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM...
css
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE patients ( row_id number, subj...
SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 18866) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_i...
mimic_iii
CREATE TABLE table_name_12 ( total VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Total, when Player is 'Hale Irwin'?
SELECT total FROM table_name_12 WHERE player = "hale irwin"
sql_create_context
CREATE TABLE Participants ( Participant_ID INTEGER, Participant_Type_Code CHAR(15), Participant_Details VARCHAR(255) ) CREATE TABLE Events ( Event_ID INTEGER, Service_ID INTEGER, Event_Details VARCHAR(255) ) CREATE TABLE Services ( Service_ID INTEGER, Service_Type_Code CHAR(15) ) CREA...
SELECT Event_Details, COUNT(Event_Details) FROM Events AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID = T2.Event_ID GROUP BY Event_Details ORDER BY Event_Details
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 AVG(demographic.days_stay) FROM demographic WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM"
mimicsql_data
CREATE TABLE table_25989 ( "Player" text, "Games Played" real, "Minutes" real, "Field Goals" real, "Three Pointers" real, "Free Throws" real, "Rebounds" real, "Assists" real, "Blocks" real, "Steals" real, "Points" real ) -- Using valid SQLite, answer the following questions...
SELECT "Steals" FROM table_25989 WHERE "Player" = 'Jasmine Wynne'
wikisql
CREATE TABLE table_78994 ( "Time" text, "Show Name" text, "Local/Networked" text, "Ad Freq" text, "News Freq" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Local/Networked has a Show Name of nightline?
SELECT "Local/Networked" FROM table_78994 WHERE "Show Name" = 'nightline'
wikisql
CREATE TABLE table_name_14 ( winner VARCHAR, race VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who won the Food World 250?
SELECT winner FROM table_name_14 WHERE race = "food world 250"
sql_create_context
CREATE TABLE table_204_169 ( id number, "athlete" text, "event" text, "race 1\ntime" text, "race 2\ntime" text, "total\ntime" text, "total\nrank" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the difference in time for petar popan...
SELECT ABS((SELECT "race 1\ntime" FROM table_204_169 WHERE "athlete" = 'petar popangelov') - (SELECT "race 2\ntime" FROM table_204_169 WHERE "athlete" = 'petar popangelov'))
squall
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT SOC_SRT_DIRE_CD, SOC_SRT_DIRE_NM, UNIVALENT FROM t_kc22 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '52511910' AND MED_SER_ORG_NO = '4903807') ORDER BY UNIVALENT DESC LIMIT 1
css
CREATE TABLE table_32183 ( "Round" real, "Overall" real, "Player" text, "Position" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the overall draft number of Tom Fleming, a wide receiver?
SELECT COUNT("Overall") FROM table_32183 WHERE "Position" = 'wide receiver' AND "Player" = 'tom fleming'
wikisql
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT zyjybgb.JYKSBM, zyjybgb.JYKSMC FROM zyjybgb WHERE zyjybgb.JZLSH = '07371082275' UNION SELECT mzjybgb.JYKSBM, mzjybgb.JYKSMC FROM mzjybgb WHERE mzjybgb.JZLSH = '07371082275'
css
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jybgb_jyjgzbb.Y...
css
CREATE TABLE table_65881 ( "Source" text, "Chrome" text, "Internet Explorer" text, "Firefox" text, "Safari" text, "Opera" text, "Other" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What percentage of users were using other browsers accordi...
SELECT "Other" FROM table_65881 WHERE "Firefox" = '21.22%'
wikisql
CREATE TABLE Addresses ( Address_ID VARCHAR(100), Line_1 VARCHAR(255), Line_2 VARCHAR(255), City_Town VARCHAR(255), State_County VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Performers ( Performer_ID INTEGER, Address_ID INTEGER, Customer_Name VARCHAR(255), Customer_Ph...
SELECT Service_Type_Description, COUNT(Service_Type_Description) FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Price > 100 GROUP BY Service_Type_Description
nvbench
CREATE TABLE table_10477224_1 ( sepal_width VARCHAR, species VARCHAR, petal_length VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the sepal width for i.virginica with petal length of 5.1
SELECT sepal_width FROM table_10477224_1 WHERE species = "I.virginica" AND petal_length = "5.1"
sql_create_context
CREATE TABLE COURSE ( CName VARCHAR, Credits VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the course name of courses sorted by credits.
SELECT CName FROM COURSE ORDER BY Credits
sql_create_context
CREATE TABLE table_55991 ( "School's name" text, "School's namesake" text, "Year opened" text, "Principal" text, "Mascot" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the school namesake for Lincoln Junior High School?
SELECT "School's namesake" FROM table_55991 WHERE "School's name" = 'lincoln junior high school'
wikisql
CREATE TABLE table_53811 ( "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 is the decision when vancouver is at home and winnipeg is awa...
SELECT "Decision" FROM table_53811 WHERE "Home" = 'vancouver' AND "Visitor" = 'winnipeg'
wikisql
CREATE TABLE table_name_63 ( score VARCHAR, competition VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score of the friendly match?
SELECT score FROM table_name_63 WHERE competition = "friendly match"
sql_create_context
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE c...
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 = 28443)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rate' AND d...
mimic_iii
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE diagnosis ( diagnosisid number, ...
SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-4 year') GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 4
eicu
CREATE TABLE table_77528 ( "Rd #" real, "Pick #" real, "Player" text, "Team (League)" text, "Reg GP" real, "Pl GP" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many reg GP for rick vaive in round 1?
SELECT SUM("Reg GP") FROM table_77528 WHERE "Player" = 'rick vaive' AND "Rd #" > '1'
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 zyjzjlb.ZYZDBM, zyjzjlb.ZYZDMC FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '27129454'
css
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT ACC_Road, Team_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY Team_ID DESC
nvbench
CREATE TABLE table_203_438 ( id number, "year" number, "title" text, "role" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many titles were released before , but not including , 1988 ?
SELECT COUNT("title") FROM table_203_438 WHERE "year" < 1988
squall
CREATE TABLE phone ( Name text, Phone_ID int, Memory_in_G int, Carrier text, Price real ) CREATE TABLE market ( Market_ID int, District text, Num_of_employees int, Num_of_shops real, Ranking int ) CREATE TABLE phone_market ( Market_ID int, Phone_ID text, Num_of_stoc...
SELECT District, COUNT(District) FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID GROUP BY District
nvbench
CREATE TABLE table_33782 ( "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 venue when Carlton was the away tea...
SELECT "Venue" FROM table_33782 WHERE "Away team" = 'carlton'
wikisql
CREATE TABLE table_2999 ( "Episode" real, "Airdate" text, "Reward" text, "Immunity" text, "Eliminated" text, "Vote" text, "Finish" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the reward for the elimination of Peterson?
SELECT "Reward" FROM table_2999 WHERE "Eliminated" = 'Peterson'
wikisql