instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_30009 ( "Institution" text, "Location" text, "Founded" real, "Type" text, "Enrollment" real, "Nickname" text, "Current Conference" text, "Pac-12 Sports" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which institution ...
SELECT "Institution" FROM table_30009 WHERE "Founded" = '1932'
wikisql
CREATE TABLE table_71561 ( "D 48" text, "D 47" text, "D 46" text, "D 45" text, "D 44" text, "D 43" text, "D 42" text, "D 41" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the D43 associated with a D41 of r 16?
SELECT "D 43" FROM table_71561 WHERE "D 41" = 'r 16'
wikisql
CREATE TABLE table_11970261_2 ( evening_gown VARCHAR, preliminaries VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the evening gown with preliminaries being 9.212
SELECT evening_gown FROM table_11970261_2 WHERE preliminaries = "9.212"
sql_create_context
CREATE TABLE table_52815 ( "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. -- How big of a crowd does the home team of essendo...
SELECT "Crowd" FROM table_52815 WHERE "Home team" = 'essendon'
wikisql
CREATE TABLE table_204_629 ( id number, "first tops" text, "second tops" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the largest first tops class number ?
SELECT MAX("first tops") FROM table_204_629
squall
CREATE TABLE table_name_93 ( points INTEGER, played INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total amount of points when the played number was less than 12?
SELECT SUM(points) FROM table_name_93 WHERE played < 12
sql_create_context
CREATE TABLE table_78739 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who has the highest total and a to par of +14?
SELECT MAX("Total") FROM table_78739 WHERE "To par" = '+14'
wikisql
CREATE TABLE table_33456 ( "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. -- How many games featured a home team scoring 12.1...
SELECT COUNT("Crowd") FROM table_33456 WHERE "Home team score" = '12.18 (90)'
wikisql
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 (SELECT qtb.MED_ORG_DEPT_CD FROM qtb WHERE qtb.MED_SER_ORG_NO = '8358400' GROUP BY qtb.MED_ORG_DEPT_CD HAVING MIN(qtb.IN_HOSP_DAYS) > 2 UNION SELECT gyb.MED_ORG_DEPT_CD FROM gyb WHERE gyb.MED_SER_ORG_NO = '8358400' GROUP BY gyb.MED_ORG_DEPT_CD HAVING MIN(gyb.IN_HOSP_DAYS) > 2 UNION SELECT zyb.MED_O...
css
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 demographic ( subject_id text, hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dod_year <= "2126.0" AND diagnoses.icd9_code = "34291"
mimicsql_data
CREATE TABLE Performers ( Performer_ID INTEGER, Address_ID INTEGER, Customer_Name VARCHAR(255), Customer_Phone VARCHAR(255), Customer_Email_Address VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Bookings_Services ( Order_ID INTEGER, Product_ID INTEGER ) CREATE TABLE Drama_Work...
SELECT Product_Name, AVG(Product_Price) FROM Products GROUP BY Product_Name ORDER BY Product_Name DESC
nvbench
CREATE TABLE table_name_31 ( podiums VARCHAR, poles VARCHAR, position VARCHAR, wins VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of Podiums, when Position is '2nd', when Wins is less than 6, and when Poles is greater than 0...
SELECT COUNT(podiums) FROM table_name_31 WHERE position = "2nd" AND wins < 6 AND poles > 0
sql_create_context
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 WHERE demographic.diagnosis = "PITUITARY BLEED" AND demographic.dod_year <= "2165.0"
mimicsql_data
CREATE TABLE table_train_226 ( "id" int, "gender" string, "pregnancy_or_lactation" bool, "active_metabolic" bool, "diabetic" string, "hepatic_disease" bool, "gastrointestinal_disease" bool, "body_mass_index_bmi" float, "age" float, "NOUSE" float ) -- Using valid SQLite, answer ...
SELECT * FROM table_train_226 WHERE gender = 'male' OR pregnancy_or_lactation = 0
criteria2sql
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 PostTypes ( Id number, Name text ) C...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%united arab emirates%' ORDER BY Reputation DESC LIMIT 50
sede
CREATE TABLE table_22181917_2 ( title VARCHAR, us_viewers__millions_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the title of the episode that had 9.76 million U.S. viewers?
SELECT title FROM table_22181917_2 WHERE us_viewers__millions_ = "9.76"
sql_create_context
CREATE TABLE table_16830 ( "Player" text, "No." text, "Nationality" text, "Position" text, "Years for Jazz" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the position of Turkey
SELECT "Position" FROM table_16830 WHERE "Nationality" = 'Turkey'
wikisql
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0),...
SELECT HIRE_DATE, MANAGER_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
nvbench
CREATE TABLE table_49285 ( "Official Name" text, "Status" text, "Area km 2" real, "Population" real, "Census Ranking" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is saint-andr 's population?
SELECT "Population" FROM table_49285 WHERE "Official Name" = 'saint-andré'
wikisql
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE swimme...
SELECT Nationality, SUM(meter_100) FROM swimmer GROUP BY Nationality ORDER BY Nationality
nvbench
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 procedures ( ...
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 = "69514" AND lab."CATEGORY" = "Chemistry"
mimicsql_data
CREATE TABLE table_14903491_1 ( year VARCHAR, womens_doubles VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the year for womens doubles being raina tzvetkova emilia dimitrova
SELECT year FROM table_14903491_1 WHERE womens_doubles = "Raina Tzvetkova Emilia Dimitrova"
sql_create_context
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 mzjzjlb.JZKSBM, mzjzjlb.JZKSMC FROM mzjzjlb WHERE mzjzjlb.JZLSH = '86971332521'
css
CREATE TABLE table_79628 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text, "Arena" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Attendance at Joe Louis Arena?
SELECT AVG("Attendance") FROM table_79628 WHERE "Arena" = 'joe louis arena'
wikisql
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) 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, insuranc...
SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 83901) AND prescriptions.drug = 'lactulose enema' AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') ORD...
mimic_iii
CREATE TABLE table_51610 ( "Date" text, "Opponents" text, "Score" text, "Competition" text, "Match Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score of the September 20, 2005 match when the Opponents are FC Bayern Munich?
SELECT "Score" FROM table_51610 WHERE "Opponents" = 'fc bayern munich' AND "Date" = 'september 20, 2005'
wikisql
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConce...
SELECT Users.CreationDate FROM Users JOIN Badges ON Users.Id = Badges.UserId WHERE Name LIKE 'Legendary'
sede
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_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_NM = '吕宏达' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_NM = '盐酸阿米替林片(薄膜)')
css
CREATE TABLE table_name_92 ( opponent VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Opponent has a Date of september 20, 1992?
SELECT opponent FROM table_name_92 WHERE date = "september 20, 1992"
sql_create_context
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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Atrioventricular block, complete" AND prescriptions.route = "REPLACE"
mimicsql_data
CREATE TABLE table_42651 ( "Stage (Winner)" text, "General Classification" text, "Points Classification" text, "Mountains Classification" text, "Young Rider Classification" text, "Team Classification" text ) -- Using valid SQLite, answer the following questions for the tables provided above. ...
SELECT "Stage (Winner)" FROM table_42651 WHERE "General Classification" = 'thor hushovd' AND "Young Rider Classification" = 'trent lowe'
wikisql
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses_icd ( row...
SELECT COUNT(*) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20603)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'tube feeding...
mimic_iii
CREATE TABLE table_78591 ( "Year" text, "Award" text, "Category" text, "Nominated" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what category was Herself nominated?
SELECT "Category" FROM table_78591 WHERE "Nominated" = 'herself'
wikisql
CREATE TABLE table_204_71 ( id number, "rank" number, "heat" number, "name" text, "nationality" text, "time" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many athletes from jamaica are represented in the results ?
SELECT COUNT("name") FROM table_204_71 WHERE "nationality" = 'jamaica'
squall
CREATE TABLE wrestler ( LOCATION VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the locations that are shared by more than two wrestlers.
SELECT LOCATION FROM wrestler GROUP BY LOCATION HAVING COUNT(*) > 2
sql_create_context
CREATE TABLE table_51754 ( "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. -- When the away team scored 7.9 (51), what was the...
SELECT MIN("Crowd") FROM table_51754 WHERE "Away team score" = '7.9 (51)'
wikisql
CREATE TABLE table_name_37 ( goals_for INTEGER, goals_against VARCHAR, played VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest number of goals when the goals against are more than 58 and played number is more than 30?
SELECT MIN(goals_for) FROM table_name_37 WHERE goals_against > 58 AND played > 30
sql_create_context
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE 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, ...
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '94819953' AND t_kc22.STA_DATE BETWEEN '2018-06-26' AND '2018-10-05' AND t_kc22.SELF_PAY_AMO > 1549.15
css
CREATE TABLE table_20589 ( "Institution" text, "Location" text, "Founded" real, "Type" text, "Enrollment" real, "Nickname" text, "Joined" text, "Left" text, "Current Conference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the...
SELECT "Current Conference" FROM table_20589 WHERE "Left" = '1974, 1989'
wikisql
CREATE TABLE Ref_Detention_Type ( detention_type_code VARCHAR(10), detention_type_description VARCHAR(80) ) CREATE TABLE Student_Addresses ( student_id INTEGER, address_id INTEGER, date_address_from DATETIME, date_address_to DATETIME, monthly_rental DECIMAL(19,4), other_details VARCHAR(...
SELECT date_of_notes, COUNT(date_of_notes) FROM Assessment_Notes
nvbench
CREATE TABLE table_57499 ( "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 date did Collingwood play as the home team?...
SELECT "Date" FROM table_57499 WHERE "Home team" = 'collingwood'
wikisql
CREATE TABLE table_25561038_1 ( f_laps INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the highest number of laps.
SELECT MAX(f_laps) FROM table_25561038_1
sql_create_context
CREATE TABLE department ( Department_ID int, Name text, Creation text, Ranking int, Budget_in_Billions real, Num_Employees real ) CREATE TABLE head ( head_ID int, name text, born_state text, age real ) CREATE TABLE management ( department_ID int, head_ID int, tempor...
SELECT born_state, COUNT(born_state) FROM head GROUP BY born_state ORDER BY COUNT(born_state)
nvbench
CREATE TABLE table_name_83 ( label VARCHAR, catalogue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Label was Catalogued tojp 60121-22?
SELECT label FROM table_name_83 WHERE catalogue = "tojp 60121-22"
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE p...
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 = '015-96048') AND NOT patient.unitdischargetime IS NULL...
eicu
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "1" AND diagnoses.short_title = "Proteus infection NOS"
mimicsql_data
CREATE TABLE table_name_4 ( network VARCHAR, games VARCHAR, title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which network had unknown games and a title of hvem kan sl ylvis hvem kan sl aamodt & kjus?
SELECT network FROM table_name_4 WHERE games = "unknown" AND title = "hvem kan slå ylvis hvem kan slå aamodt & kjus"
sql_create_context
CREATE TABLE table_13098 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total rank for New Zealand, when less than 1 bronze medals were won?
SELECT SUM("Rank") FROM table_13098 WHERE "Nation" = 'new zealand' AND "Bronze" < '1'
wikisql
CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE requirement (...
SELECT DISTINCT course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (course.number = 598 OR course.number = 461) AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 INNER JOIN course AS COURSEalias1 ON ...
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 = "RASH"
mimicsql_data
CREATE TABLE table_name_19 ( date VARCHAR, city___state VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Date, when City / State is 'Mallala , South Australia', and when Team is 'R.J.MacArthur Onslow'?
SELECT date FROM table_name_19 WHERE city___state = "mallala , south australia" AND team = "r.j.macarthur onslow"
sql_create_context
CREATE TABLE table_name_49 ( region VARCHAR, format VARCHAR, catalog VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the region for Catalog amlh 66078 in stereo lp format?
SELECT region FROM table_name_49 WHERE format = "stereo lp" AND catalog = "amlh 66078"
sql_create_context
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 prescriptions.drug, prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "D12.5W250I"
mimicsql_data
CREATE TABLE people ( Name VARCHAR, People_ID VARCHAR ) CREATE TABLE debate_people ( Negative VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the names of people who have been on the negative side of debates at least twice.
SELECT T2.Name FROM debate_people AS T1 JOIN people AS T2 ON T1.Negative = T2.People_ID GROUP BY T2.Name HAVING COUNT(*) >= 2
sql_create_context
CREATE TABLE table_14179 ( "Year" real, "Class" text, "Vehicle" text, "Position" text, "Stages won" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which year had a position of 9?
SELECT "Year" FROM table_14179 WHERE "Position" = '9'
wikisql
CREATE TABLE table_33840 ( "Game" real, "December" real, "Opponent" text, "Score" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- December larger than 21, and a Opponent of Pittsburgh penguins had what average game?
SELECT AVG("Game") FROM table_33840 WHERE "December" > '21' AND "Opponent" = 'pittsburgh penguins'
wikisql
CREATE TABLE table_name_81 ( woodside VARCHAR, coombe_road VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Woodside for the 16:19 Coombe Road?
SELECT woodside FROM table_name_81 WHERE coombe_road = "16:19"
sql_create_context
CREATE TABLE table_68500 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What game that had a record of 39-44 had the lowest attendance?
SELECT MIN("Attendance") FROM table_68500 WHERE "Record" = '39-44'
wikisql
CREATE TABLE table_5576 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents in Final" text, "Score in Final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Partner has a Score in Final of 6 1, 6...
SELECT "Partner" FROM table_5576 WHERE "Score in Final" = '6–1, 6–2'
wikisql
CREATE TABLE table_name_66 ( title VARCHAR, production_num VARCHAR, series VARCHAR, director VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What title has lt as the series, ben hardaway as the director, with 6612 as the production num.?
SELECT title FROM table_name_66 WHERE series = "lt" AND director = "ben hardaway" AND production_num = "6612"
sql_create_context
CREATE TABLE region ( Region_ID int, Region_name text, Date text, Label text, Format text, Catalogue text ) CREATE TABLE member ( Member_ID int, Member_Name text, Party_ID text, In_office text ) CREATE TABLE party ( Party_ID int, Minister text, Took_office text, ...
SELECT Minister, COUNT(Minister) FROM party WHERE Party_name <> 'Progress Party' GROUP BY Minister ORDER BY Minister
nvbench
CREATE TABLE table_6342 ( "Name" text, "Circuit" text, "Date" text, "Winning driver" text, "Winning constructor" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Date has a Winning constructor of fiat and a Winning driver of l...
SELECT "Date" FROM table_6342 WHERE "Winning constructor" = 'fiat' AND "Winning driver" = 'louis wagner'
wikisql
CREATE TABLE table_59631 ( "Round" text, "Date" text, "Event" text, "Circuit" text, "Winning Driver" text, "Winning Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the winning team for circuit zolder?
SELECT "Winning Team" FROM table_59631 WHERE "Circuit" = 'circuit zolder'
wikisql
CREATE TABLE tryout ( pid number, cname text, ppos text, decision text ) CREATE TABLE player ( pid number, pname text, ycard text, hs number ) CREATE TABLE college ( cname text, state text, enr number ) -- Using valid SQLite, answer the following questions for the tables ...
SELECT COUNT(DISTINCT ppos) FROM tryout
spider
CREATE TABLE table_54443 ( "Party" text, "Results 2004" text, "CSA 5/14/09" text, "Viavoice 5/15/09" text, "Ifop- La Croix 5/15/09" text, "Ipsos 5/16/09" text, "OpinionWay 5/18/09" text, "CSA 5/20/09" text, "Ipsos 5/25/09" text, "TNS-Sofres 5/26/09" text, "OpinionWay 5/28/09"...
SELECT "CSA 5/20/09" FROM table_54443 WHERE "Ifop- La Croix 5/15/09" = '26%'
wikisql
CREATE TABLE table_name_20 ( place VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the place when the score is 68-67-73-68=276?
SELECT place FROM table_name_20 WHERE score = 68 - 67 - 73 - 68 = 276
sql_create_context
CREATE TABLE table_77087 ( "Couple" text, "Style" text, "Music" text, "Choreographer(s)" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the music for choreographer sabina dalfj ll?
SELECT "Music" FROM table_77087 WHERE "Choreographer(s)" = 'sabina dalfjäll'
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 = "SNF" AND demographic.days_stay > "17"
mimicsql_data
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2164" AND prescriptions.route = "IH"
mimicsql_data
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NA...
SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21'
nvbench
CREATE TABLE table_name_10 ( soap_opera VARCHAR, years VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the soap opera when the years are 2000 2004, 2005 ?
SELECT soap_opera FROM table_name_10 WHERE years = "2000–2004, 2005—"
sql_create_context
CREATE TABLE table_name_99 ( date VARCHAR, home VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When is Edmonton Oilers in?
SELECT date FROM table_name_99 WHERE home = "edmonton oilers"
sql_create_context
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden ...
WITH FirstPosts AS (SELECT OwnerUserId AS SEUser, MIN(Id) AS Post FROM Posts WHERE PostTypeId = 1 OR PostTypeId = 2 GROUP BY OwnerUserId) SELECT FirstPosts.SEUser AS "user_link", FirstPosts.Post AS "post_link", 'post_type' = CASE PostTypeId WHEN 1 THEN 'Question' WHEN 2 THEN 'Answer' ELSE '???' END, Reputation FROM Fir...
sede
CREATE TABLE table_36699 ( "Game" text, "Date" text, "Home Team" text, "Result" text, "Road Team" text, "TV Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the TV time for the game on June 9?
SELECT "TV Time" FROM table_36699 WHERE "Date" = 'june 9'
wikisql
CREATE TABLE table_27360 ( "Pick #" real, "NFL Team" text, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many colleges have the NFL Team Buffalo Bills?
SELECT COUNT("College") FROM table_27360 WHERE "NFL Team" = 'Buffalo Bills'
wikisql
CREATE TABLE table_train_171 ( "id" int, "systolic_blood_pressure_sbp" int, "hiv_infection" bool, "hemoglobin_a1c_hba1c" float, "hepatitis_c" bool, "diastolic_blood_pressure_dbp" int, "body_mass_index_bmi" float, "triglyceride_tg" float, "NOUSE" float ) -- Using valid SQLite, answe...
SELECT * FROM table_train_171 WHERE hemoglobin_a1c_hba1c > 6.5 AND hemoglobin_a1c_hba1c < 11
criteria2sql
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text,...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'amiodarone' AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-1 year'))
mimic_iii
CREATE TABLE table_46066 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the tie number for the home team Orient?
SELECT "Tie no" FROM table_46066 WHERE "Home team" = 'orient'
wikisql
CREATE TABLE table_28797906_3 ( wickets VARCHAR, economy VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many wickets was there when the economy was 3.64?
SELECT wickets FROM table_28797906_3 WHERE economy = "3.64"
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '84027429' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE table_name_64 ( total INTEGER, rank VARCHAR, bronze VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average medal total when the rank is less than 5 and less than 7 bronze medals were won?
SELECT AVG(total) FROM table_name_64 WHERE rank < 5 AND bronze < 7
sql_create_context
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConce...
SELECT Id, DisplayName, Reputation, WebsiteUrl, Location FROM Users WHERE Location LIKE '%Sofia%' OR Location LIKE '%Bulgaria%' ORDER BY Reputation DESC LIMIT 150
sede
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 gwyjzb.MED_ORG_DEPT_NM, gwyjzb.IN_DIAG_DIS_NM, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '4149956' GROUP BY gwyjzb.MED_ORG_DEPT_NM, gwyjzb.IN_DIAG_DIS_NM UNION SELECT fgwyjzb.MED_ORG_DEPT_NM, fgwyjzb.IN_DIAG_DIS_NM, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '41499...
css
CREATE TABLE table_name_23 ( wrestler VARCHAR, entered VARCHAR, pinned VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Wrestler has an Entered of 5, and a Pinned of mvp?
SELECT wrestler FROM table_name_23 WHERE entered = 5 AND pinned = "mvp"
sql_create_context
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE 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, ...
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '褚莹华' AND t_kc21.MED_SER_ORG_NO = '9536805' AND NOT t_kc21.OUT_DIAG_DIS_NM LIKE '%胃肠炎%'
css
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.days_stay > "1" AND prescriptions.formulary_drug_cd = "METH40"
mimicsql_data
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_NM = '金清懿' AND IN_HOSP_DATE BETWEEN '2007-05-26' AND '2014-05-11' GROUP BY IN_DIAG_DIS_CD ORDER BY COUNT(*) DESC LIMIT 1
css
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPriv...
SELECT t.Score, AVG(t.CommentCount) AS "average_#_of_comments" FROM (SELECT COUNT(c.Id) * 1.0 AS commentCount, p.Score FROM Comments AS c JOIN Posts AS p ON c.PostId = p.Id GROUP BY p.Score, p.Id) AS t GROUP BY Score ORDER BY Score DESC
sede
CREATE TABLE table_49070 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" text, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest number of points scored when...
SELECT MIN("Points") FROM table_49070 WHERE "Attendance" = '1,500'
wikisql
CREATE TABLE table_5752 ( "Season" real, "Level" text, "Division" text, "Administration" text, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Season has a Level of tier 4, and a Position of 11th?
SELECT SUM("Season") FROM table_5752 WHERE "Level" = 'tier 4' AND "Position" = '11th'
wikisql
CREATE TABLE table_204_909 ( id number, "pollutant" text, "units" text, "emission standard" number, "coal-fired" text, "petroleum coke-fired" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the total number of pollutants that are measured...
SELECT COUNT("pollutant") FROM table_204_909 WHERE "units" = 'lb/mmbtu'
squall
CREATE TABLE table_41369 ( "Party" text, "Marplan" text, "Gallup" text, "National Opinion Polls (NOP)" text, "Opinion Research Centre (OPC)" text, "Harris" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Marplan, when Gallup is 1.5%
SELECT "Marplan" FROM table_41369 WHERE "Gallup" = '1.5%'
wikisql
CREATE TABLE table_25111 ( "#" real, "Name" text, "Name (English)" text, "Population 2008-07-01" real, "Area (km\u00b2)" real, "Pop./ km\u00b2" text, "ISO 3166-2" text, "Administrative centre" text ) -- Using valid SQLite, answer the following questions for the tables provided above. ...
SELECT "Administrative centre" FROM table_25111 WHERE "Name (English)" = 'Southern Region'
wikisql
CREATE TABLE gwyjzb ( CLINIC_ID text, CLINIC_TYPE 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, ...
SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '韦云霞' AND t_kc22.STA_DATE BETWEEN '2016-02-20' AND '2016-12-15' AND t_kc22.SELF_PAY_PRO < 0.43 UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fgwyjzb.PERS...
css
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE airline ( airline_code varchar,...
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, date_day, days, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1...
atis
CREATE TABLE table_32294 ( "State" text, "Born/Died" text, "Active service" text, "Chief Judge" text, "Senior status" text, "Appointed by" text, "Reason for termination" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who did Clinton appoint ...
SELECT "Chief Judge" FROM table_32294 WHERE "Appointed by" = 'clinton'
wikisql
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId n...
SELECT DisplayName FROM Users WHERE Id = '##UserId##'
sede
CREATE TABLE table_18600760_13 ( geo_id VARCHAR, township VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the geo id for malcolm township?
SELECT COUNT(geo_id) FROM table_18600760_13 WHERE township = "Malcolm"
sql_create_context
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
SELECT Title, Score, ViewCount, FavoriteCount FROM Posts WHERE FavoriteCount >= 0.5 * ViewCount ORDER BY FavoriteCount DESC
sede
CREATE TABLE table_203_455 ( id number, "round" number, "#" number, "player" text, "nationality" text, "college/junior/club team (league)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what are the number of times finland is listed as the natio...
SELECT COUNT(*) FROM table_203_455 WHERE "nationality" = 'finland'
squall