instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
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 Tags ( Id number, TagName text, C...
SELECT *, COUNT(*) AS post_count FROM (SELECT t.TagName FROM (SELECT p.Id, p.CreationDate FROM Posts AS p JOIN PostTags AS pt ON pt.PostId = p.Id JOIN Tags AS t ON t.Id = pt.TagId) AS pp JOIN PostTags AS pt ON pt.PostId = pp.Id JOIN Tags AS t ON t.Id = pt.TagId WHERE ((LOWER(t.TagName) LIKE '%qunit%' OR LOWER(t.TagName...
sede
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, COUNT(ACC_Road) FROM basketball_match GROUP BY ACC_Road
nvbench
CREATE TABLE table_16435 ( "English name" text, "Original name" text, "Area in km\u00b2" text, "Population at 2010 Census" real, "Number of settlements and villages" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many districts have an area of 1...
SELECT COUNT("English name") FROM table_16435 WHERE "Area in km\u00b2" = '17.72'
wikisql
CREATE TABLE table_33444 ( "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 home team when the VFL played Arden ...
SELECT "Home team" FROM table_33444 WHERE "Venue" = 'arden street oval'
wikisql
CREATE TABLE table_6067 ( "Player" text, "Position" text, "Date of Birth (Age)" text, "Caps" real, "Club/province" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest number of caps of the fullback player born on 13 April 1983?
SELECT MIN("Caps") FROM table_6067 WHERE "Position" = 'fullback' AND "Date of Birth (Age)" = '13 april 1983'
wikisql
CREATE TABLE table_14873 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the score for opponent @ Tigers on July 24?
SELECT "Score" FROM table_14873 WHERE "Opponent" = '@ tigers' AND "Date" = 'july 24'
wikisql
CREATE TABLE table_19283806_4 ( location VARCHAR, median_household_income__2011_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many locations have a median household income in 2011 of $71,479?
SELECT COUNT(location) FROM table_19283806_4 WHERE median_household_income__2011_ = "$71,479"
sql_create_context
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 labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 46422) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'pt') AND STRFTIME('%y-%m', labevents.charttime) = '2103-07' ORDER BY labevents....
mimic_iii
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 t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_NM, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '5387444' GROUP BY t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_NM HAVING AVG(t_kc21.PERSON_AGE) > 24
css
CREATE TABLE table_19459 ( "School Year" text, "Class A" text, "Class AA" text, "Class AAA" text, "Class AAAA" text, "Class AAAAA" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the class a for carthage
SELECT "Class A" FROM table_19459 WHERE "Class AAAA" = 'Carthage'
wikisql
CREATE TABLE Room ( RoomNumber INTEGER, RoomType VARCHAR(30), BlockFloor INTEGER, BlockCode INTEGER, Unavailable BOOLEAN ) CREATE TABLE Prescribes ( Physician INTEGER, Patient INTEGER, Medication INTEGER, Date DATETIME, Appointment INTEGER, Dose VARCHAR(30) ) CREATE TABLE P...
SELECT T1.Name, COUNT(T1.Name) FROM Physician AS T1 JOIN Trained_In AS T2 ON T1.EmployeeID = T2.Physician JOIN Procedures AS T3 ON T3.Code = T2.Treatment WHERE T3.Cost > 5000 GROUP BY T1.Name ORDER BY T1.Name
nvbench
CREATE TABLE table_12356 ( "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 Bronze, when Silver is less than 89, and when Total is '4'?
SELECT "Bronze" FROM table_12356 WHERE "Silver" < '89' AND "Total" = '4'
wikisql
CREATE TABLE table_70508 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which team did they play on September 19?
SELECT "Opponent" FROM table_70508 WHERE "Date" = 'september 19'
wikisql
CREATE TABLE table_34420 ( "Planned pinnacle height" text, "Expected year of completion" real, "Structural type" text, "Country" text, "Town" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what country has dubai
SELECT "Country" FROM table_34420 WHERE "Town" = 'dubai'
wikisql
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, PostId number,...
SELECT p.Id AS "post_link", p.CreationDate, p.LastEditDate FROM Posts AS p WHERE NOT p.Body LIKE '%> %' AND p.Body LIKE '%:%' ORDER BY (CASE WHEN p.LastEditDate IS NULL THEN p.CreationDate ELSE p.LastEditDate END) DESC
sede
CREATE TABLE table_77843 ( "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. -- Where was the game played where the away team ha...
SELECT "Venue" FROM table_77843 WHERE "Away team score" = '7.6 (48)'
wikisql
CREATE TABLE table_42459 ( "Country" text, "Date" text, "Label" text, "Format" text, "Catalog" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the country that has 18 May 2004 as the date?
SELECT "Country" FROM table_42459 WHERE "Date" = '18 may 2004'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, sy...
SELECT COUNT(DISTINCT patient.patienthealthsystemstayid) FROM patient WHERE patient.uniquepid = '017-73567' AND DATETIME(patient.hospitaladmittime) >= DATETIME(CURRENT_TIME(), '-6 year')
eicu
CREATE TABLE table_20288 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written By" text, "Originalairdate" text, "TV Broadcast" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What number in the season was '...
SELECT "No. in season" FROM table_20288 WHERE "Title" = 'Reflections'
wikisql
CREATE TABLE table_76232 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the golfer that has the score of 73-65=138?
SELECT "Player" FROM table_76232 WHERE "Score" = '73-65=138'
wikisql
CREATE TABLE table_name_13 ( season VARCHAR, actual_adjusted_record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many seasons have an Actual adjusted record of 0 19?
SELECT COUNT(season) FROM table_name_13 WHERE actual_adjusted_record = "0–19"
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2157" AND diagnoses.short_title = "Intermed coronary synd"
mimicsql_data
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_...
SELECT HIRE_DATE, MANAGER_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40
nvbench
CREATE TABLE table_name_32 ( country VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country scored 71-66-66-71=274?
SELECT country FROM table_name_32 WHERE score = 71 - 66 - 66 - 71 = 274
sql_create_context
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 * FROM t_kc21 WHERE MED_SER_ORG_NO = '7146110' AND IN_HOSP_DATE BETWEEN '2014-07-06' AND '2018-09-11' AND PERSON_NM LIKE '赵%'
css
CREATE TABLE table_2419 ( "Political parties" text, "% 2006" text, "Seats 2006" real, "% 2001" text, "Seats 2001" real, "% 1997" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the % 2006 rating in 2006 where there were 5 seats?
SELECT "% 2006" FROM table_2419 WHERE "Seats 2006" = '5'
wikisql
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city var...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Danielle Czarnecki%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering...
advising
CREATE TABLE table_name_79 ( drawn INTEGER, points VARCHAR, against VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest drawn when the points are less than 7 and the against greater than 31?
SELECT MIN(drawn) FROM table_name_79 WHERE points < 7 AND against > 31
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 prescriptions.drug, prescriptions.formulary_drug_cd FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Betty Campbell"
mimicsql_data
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 * FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '4469722' AND t_kc21.IN_HOSP_DATE BETWEEN '2006-11-15' AND '2007-07-28' AND t_kc21.PERSON_NM LIKE '卫%'
css
CREATE TABLE table_name_57 ( home_team VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Home team has an Away team of everton?
SELECT home_team FROM table_name_57 WHERE away_team = "everton"
sql_create_context
CREATE TABLE Course_Authors_and_Tutors ( author_id INTEGER, author_tutor_ATB VARCHAR(3), login_name VARCHAR(40), password VARCHAR(40), personal_name VARCHAR(80), middle_name VARCHAR(80), family_name VARCHAR(80), gender_mf VARCHAR(1), address_line_1 VARCHAR(80) ) CREATE TABLE Student...
SELECT login_name, author_tutor_ATB FROM Course_Authors_and_Tutors ORDER BY personal_name
nvbench
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2112.0" AND prescriptions.drug = "Voriconazole"
mimicsql_data
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = "F" AND lab.label = "Sedimentation Rate"
mimicsql_data
CREATE TABLE table_204_622 ( id number, "year" number, "competition" text, "venue" text, "position" text, "event" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how long did it take piotr to run the medley relay in 2001 ?
SELECT "notes" FROM table_204_622 WHERE "event" = 'medley relay' AND "year" = 2001
squall
CREATE TABLE table_204_312 ( id number, "stage" text, "date" text, "route" text, "terrain" text, "length" text, "winner" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which type of terrain is listed the most ?
SELECT "terrain" FROM table_204_312 GROUP BY "terrain" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE bank ( branch_id number, bname text, no_of_customers number, city text, state text ) CREATE TABLE customer ( cust_id text, cust_name text, acc_type text, acc_bal number, no_of_loans number, credit_score number, branch_id number, state text ) CREATE TABL...
SELECT bname FROM bank WHERE state = 'New York'
spider
CREATE TABLE table_2861364_1 ( crime VARCHAR, place_of_execution VARCHAR, executed_person VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- for what crime was gunther volz executed at metz?
SELECT crime FROM table_2861364_1 WHERE place_of_execution = "Metz" AND executed_person = "Gunther Volz"
sql_create_context
CREATE TABLE table_204_753 ( id number, "no." number, "name" text, "position" text, "date of birth (age)" text, "signed from" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many players are reserve team players ?
SELECT COUNT("name") FROM table_204_753 WHERE "notes" = 'reserve team player'
squall
CREATE TABLE table_11734041_18 ( position VARCHAR, no_s_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many positions had jersey number 32
SELECT COUNT(position) FROM table_11734041_18 WHERE no_s_ = "32"
sql_create_context
CREATE TABLE table_54716 ( "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 scored 16.12 (108)?
SELECT "Away team" FROM table_54716 WHERE "Away team score" = '16.12 (108)'
wikisql
CREATE TABLE artist ( Artist_ID int, Artist text, Age int, Famous_Title text, Famous_Release_date text ) CREATE TABLE volume ( Volume_ID int, Volume_Issue text, Issue_Date text, Weeks_on_Top real, Song text, Artist_ID int ) CREATE TABLE music_festival ( ID int, Musi...
SELECT Category, COUNT(Category) FROM music_festival WHERE Result = "Awarded" GROUP BY Category
nvbench
CREATE TABLE table_name_78 ( start VARCHAR, finish VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What race has a finish time of 10?
SELECT start FROM table_name_78 WHERE finish = "10"
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 AVG(t_kc21.MED_AMOUT) FROM t_kc21 WHERE t_kc21.MED_ORG_DEPT_NM = '麻醉科' AND t_kc21.IN_HOSP_DATE BETWEEN '2000-08-24' AND '2014-07-15' AND t_kc21.IN_DIAG_DIS_NM = '心脏病' AND t_kc21.CLINIC_TYPE = '住院'
css
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE program ( program_id int, name varchar, college varc...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id WHERE program_cour...
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.religion = "CHRISTIAN SCIENTIST" AND demographic.admityear < "2190"
mimicsql_data
CREATE TABLE table_40411 ( "Volume:Issue" text, "Issue Date(s)" text, "Weeks on Top" text, "Song" text, "Artist" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which song was by artist Gino Vannelli?
SELECT "Song" FROM table_40411 WHERE "Artist" = 'gino vannelli'
wikisql
CREATE TABLE table_204_128 ( id number, "region" text, "date" text, "label" text, "format" text, "catalog" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- in how many countries was the album released before 1990 ?
SELECT COUNT(DISTINCT ("region")) FROM table_204_128 WHERE "date" < 1990
squall
CREATE TABLE table_42705 ( "Rank" text, "Country" text, "Wins" real, "Winners" real, "First title" real, "Last title" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which First title has Wins smaller than 8 and in Canada?
SELECT COUNT("First title") FROM table_42705 WHERE "Wins" < '8' AND "Country" = 'canada'
wikisql
CREATE TABLE table_29486189_4 ( first_elected VARCHAR, representative VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- when was al landis first elected
SELECT first_elected FROM table_29486189_4 WHERE representative = "Al Landis"
sql_create_context
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 jybgb.KSBM, jybgb.KSMC FROM hz_info JOIN zzmzjzjlb JOIN jybgb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '78828339' AND jybgb.BGRQ BETWEEN '2004-07-28...
css
CREATE TABLE table_48010 ( "Fin. Pos" text, "Car No." text, "Driver" text, "Team" text, "Laps" text, "Time/Retired" text, "Grid" text, "Laps Led" text, "Points" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team started in grid...
SELECT "Team" FROM table_48010 WHERE "Grid" = '11'
wikisql
CREATE TABLE table_name_43 ( cooper VARCHAR, ashmolean VARCHAR, hahland VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the cooper with an Ashmolean less than 21, and hahland smaller than 4?
SELECT cooper FROM table_name_43 WHERE ashmolean < 21 AND hahland < 4
sql_create_context
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 gsi ( course_offering_id int, student_id int ) CREATE TABLE instructor ( ...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Elaine Wisniewski%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor...
advising
CREATE TABLE candidate ( candidate_id number, people_id number, poll_source text, date text, support_rate number, consider_rate number, oppose_rate number, unsure_rate number ) CREATE TABLE people ( people_id number, sex text, name text, date_of_birth text, height nu...
SELECT MAX(support_rate), MIN(consider_rate), MIN(oppose_rate) FROM candidate
spider
CREATE TABLE table_name_66 ( pick INTEGER, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which pick was Bill Bray?
SELECT SUM(pick) FROM table_name_66 WHERE player = "bill bray"
sql_create_context
CREATE TABLE table_name_35 ( date VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what Date is West Ham United the Home team?
SELECT date FROM table_name_35 WHERE home_team = "west ham united"
sql_create_context
CREATE TABLE table_67315 ( "Year" text, "Start" text, "Qual" text, "Rank" text, "Finish" text, "Laps" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What rank had more than 165 laps and a finish of 5?
SELECT "Rank" FROM table_67315 WHERE "Laps" > '165' AND "Finish" = '5'
wikisql
CREATE TABLE characteristics ( characteristic_id number, characteristic_type_code text, characteristic_data_type text, characteristic_name text, other_characteristic_details text ) CREATE TABLE products ( product_id number, color_code text, product_category_code text, product_name t...
SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN characteristics AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t3.characteristic_name = "hot"
spider
CREATE TABLE table_160510_5 ( region VARCHAR, hangul_chosongul VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of region for
SELECT COUNT(region) FROM table_160510_5 WHERE hangul_chosongul = "경상남도"
sql_create_context
CREATE TABLE table_18788823_5 ( date_of_vacancy VARCHAR, outgoing_manager VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date did Micky Adams vacate his position?
SELECT date_of_vacancy FROM table_18788823_5 WHERE outgoing_manager = "Micky Adams"
sql_create_context
CREATE TABLE table_22982552_9 ( position VARCHAR, highlight_s_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position did the player whose highlights were 5 career INTs play?
SELECT position FROM table_22982552_9 WHERE highlight_s_ = "5 career INTs"
sql_create_context
CREATE TABLE table_2167226_3 ( date VARCHAR, winning_score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date of the winning score 74-67-71-73=285?
SELECT date FROM table_2167226_3 WHERE winning_score = 74 - 67 - 71 - 73 = 285
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE jybgb_jyjgzbb ( JYZBLSH number, YLJGDM text, jyjgzbb_id number ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, ...
SELECT jyjgzbb.BGDH FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '56375477846'
css
CREATE TABLE table_28553 ( "Year" real, "Starts" real, "Wins" real, "Top 5" real, "Top 10" real, "Poles" real, "Avg. Start" text, "Avg. Finish" text, "Winnings" text, "Position" text, "Team(s)" text ) -- Using valid SQLite, answer the following questions for the tables prov...
SELECT MIN("Top 10") FROM table_28553 WHERE "Position" = '8th'
wikisql
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE p...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program, program_course, semester WHERE program_course.course_id = course.course_id AND program_course.course_id = course.course_id AND program.name LIKE '%CS%' AND program.program_id = program_course.program_id AND semester.sem...
advising
CREATE TABLE table_name_50 ( employees INTEGER, company VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many employees at nokia, ranked under 3?
SELECT MAX(employees) FROM table_name_50 WHERE company = "nokia" AND rank < 3
sql_create_context
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE T...
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 = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRA...
atis
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, ...
SELECT MIN(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27177 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND outputeven...
mimic_iii
CREATE TABLE table_27596 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Position in table" text, "Replaced by" text, "Date of appointment" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the ...
SELECT COUNT("Team") FROM table_27596 WHERE "Position in table" = '11th' AND "Date of appointment" = 'September 10'
wikisql
CREATE TABLE table_51318 ( "Draw" real, "Song" text, "Artist" text, "Jury (Points)" text, "Televotes (Points)" text, "Total Points" real, "Place" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the song with more than 9 points and 44 ...
SELECT "Song" FROM table_51318 WHERE "Total Points" > '9' AND "Jury (Points)" = '44 (11)'
wikisql
CREATE TABLE table_28648 ( "Rank" real, "Couple" text, "Judges" real, "Public" real, "Total" real, "Vote percentage" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the judges for 4 public
SELECT "Judges" FROM table_28648 WHERE "Public" = '4'
wikisql
CREATE TABLE table_70207 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total points that an 1951 Entrant alfa romeo spa have?
SELECT SUM("Points") FROM table_70207 WHERE "Entrant" = 'alfa romeo spa' AND "Year" < '1951'
wikisql
CREATE TABLE table_name_42 ( gene VARCHAR, route_of_administration VARCHAR, status VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which gene is ongoing and has an intramuscular route of administration?
SELECT gene FROM table_name_42 WHERE route_of_administration = "intramuscular" AND status = "ongoing"
sql_create_context
CREATE TABLE table_53879 ( "Interregnum began" text, "Interregnum ended" text, "Duration" text, "Count Palatine of Saxony" text, "Count Palatine of the Rhine" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the Count Palatine of t...
SELECT "Count Palatine of the Rhine" FROM table_53879 WHERE "Interregnum began" = '2 april 1657 death of ferdinand iii'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "70" AND lab.itemid = "50965"
mimicsql_data
CREATE TABLE table_47156 ( "Position" real, "Team" text, "Played" real, "Drawn" real, "Lost" real, "Goals For" real, "Goals Against" real, "Goal Difference" text, "Points 1" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Goa...
SELECT COUNT("Goals For") FROM table_47156 WHERE "Drawn" = '10'
wikisql
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
SELECT SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 78076) AND prescriptions.drug = 'ipratropium bromide neb' AND STRFTIME('%y-%m', prescriptions.startdate) = '2101-10'
mimic_iii
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text...
SELECT COUNT(*) FROM mzjzjlb WHERE mzjzjlb.ZZYSGH = '25408740' AND mzjzjlb.JZKSRQ BETWEEN '2011-01-20' AND '2019-07-19'
css
CREATE TABLE Participates_in ( stuid INTEGER, actid INTEGER ) CREATE TABLE Activity ( actid INTEGER, activity_name varchar(25) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city...
SELECT Rank, COUNT(Rank) FROM Faculty GROUP BY Rank ORDER BY Rank
nvbench
CREATE TABLE table_name_15 ( nationality VARCHAR, college VARCHAR, round VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which nationality has a round of 1, and F position from Louisville?
SELECT nationality FROM table_name_15 WHERE round = "1" AND position = "f" AND college = "louisville"
sql_create_context
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) 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...
SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY AVG(EMPLOYEE_ID)
nvbench
CREATE TABLE Documents ( document_date VARCHAR, document_id VARCHAR ) CREATE TABLE Documents_with_Expenses ( document_id VARCHAR, budget_type_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the dates for the documents with both 'GV' typ...
SELECT T1.document_date FROM Documents AS T1 JOIN Documents_with_Expenses AS T2 ON T1.document_id = T2.document_id WHERE T2.budget_type_code = 'GV' INTERSECT SELECT T1.document_date FROM Documents AS T1 JOIN Documents_with_Expenses AS T2 ON T1.document_id = T2.document_id WHERE T2.budget_type_code = 'SF'
sql_create_context
CREATE TABLE table_name_74 ( rtm_build VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the RTM build of the Windows Home Server 2011?
SELECT rtm_build FROM table_name_74 WHERE name = "windows home server 2011"
sql_create_context
CREATE TABLE Roles ( Role_Code CHAR(15), Role_Name VARCHAR(255), Role_Description VARCHAR(255) ) CREATE TABLE Ref_Locations ( Location_Code CHAR(15), Location_Name VARCHAR(255), Location_Description VARCHAR(255) ) CREATE TABLE Documents_to_be_Destroyed ( Document_ID INTEGER, Destructio...
SELECT Date_in_Locaton_To, COUNT(Date_in_Locaton_To) FROM Document_Locations
nvbench
CREATE TABLE table_name_51 ( candidates_nominated INTEGER, date VARCHAR, votes VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many candidates were nominated in 1952 with under 305,133 votes?
SELECT SUM(candidates_nominated) FROM table_name_51 WHERE date = "1952" AND votes < 305 OFFSET 133
sql_create_context
CREATE TABLE table_73679 ( "Name" text, "Position" text, "Period" text, "Appearances\u00b9" real, "Goals\u00b9" real, "Nationality\u00b2" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many games had less than 7 goals scored?
SELECT COUNT("Appearances\u00b9") FROM table_73679 WHERE "Goals\u00b9" = '7'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number,...
SELECT * FROM jyjgzbb WHERE JCZBMC = (SELECT JCZBMC FROM jyjgzbb WHERE JYZBLSH = '54799454565') AND JCZBJGDW = (SELECT JCZBJGDW FROM jyjgzbb WHERE JYZBLSH = '54799454565') AND JCZBJGDL <= (SELECT JCZBJGDL FROM jyjgzbb WHERE JYZBLSH = '54799454565')
css
CREATE TABLE table_29738 ( "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. -- In how...
SELECT COUNT("Game") FROM table_29738 WHERE "High rebounds" = 'Derrick Favors (8)'
wikisql
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type t...
SELECT SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3403) AND prescriptions.drug = 'prismasate (b22 k4)' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 yea...
mimic_iii
CREATE TABLE mzjzjlb_jybgb ( YLJGDM_MZJZJLB text, BGDH number, YLJGDM number ) CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time...
SELECT jybgb.BGRGH, jybgb.BGRXM FROM jybgb WHERE jybgb.JZLSH = '41739506482' GROUP BY jybgb.BGRGH HAVING COUNT(*) > 22
css
CREATE TABLE table_name_55 ( year INTEGER, chassis VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was a Rial Arc2 chassis used?
SELECT SUM(year) FROM table_name_55 WHERE chassis = "rial arc2"
sql_create_context
CREATE TABLE Band ( lastname VARCHAR, id VARCHAR ) CREATE TABLE Performance ( bandmate VARCHAR, SongId VARCHAR ) CREATE TABLE Songs ( SongId VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the last name of the musician that have produced...
SELECT T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId GROUP BY lastname ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
CREATE TABLE instructor ( id text, name text, dept_name text, salary number ) CREATE TABLE time_slot ( time_slot_id text, day text, start_hr number, start_min number, end_hr number, end_min number ) CREATE TABLE prereq ( course_id text, prereq_id text ) CREATE TABLE ad...
SELECT COUNT(DISTINCT id) FROM teaches WHERE semester = 'Spring' AND year = 2010
spider
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( medicatio...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'vte prophylaxis - low molecular weight heparin') AS t1 JOIN (SELECT patie...
eicu
CREATE TABLE film_category ( film_id number, category_id number, last_update time ) CREATE TABLE film_text ( film_id number, title text, description text ) CREATE TABLE payment ( payment_id number, customer_id number, staff_id number, rental_id number, amount number, pa...
SELECT T1.first_name, T1.last_name FROM customer AS T1 JOIN rental AS T2 ON T1.customer_id = T2.customer_id ORDER BY T2.rental_date LIMIT 1
spider
CREATE TABLE table_name_6 ( live_births_2006 INTEGER, county VARCHAR, tfr_2006 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In 2006, what is the highest number for Live births in the County of Cumbria that has a TFR larger than 1.76?
SELECT MAX(live_births_2006) FROM table_name_6 WHERE county = "cumbria" AND tfr_2006 > 1.76
sql_create_context
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, 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, JY...
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 = '4840688' AND NOT wdmzjzjlb.JZKSMC LIKE '%乳腺%' UNION SELECT * FROM person_info JO...
css
CREATE TABLE table_name_11 ( date VARCHAR, opponen VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did jo o souza play?
SELECT date FROM table_name_11 WHERE opponen = "joão souza"
sql_create_context
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE zyjzjlb_jybgb ( YLJGDM_ZYJZJLB te...
SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN 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 = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz...
css