instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_71948 ( "Rank" real, "Name" text, "Height ft (m)" text, "Floors" real, "Year" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the greatest rank for Fifth third center?
SELECT MAX("Rank") FROM table_71948 WHERE "Name" = 'fifth third center'
wikisql
CREATE TABLE table_78839 ( "Outcome" text, "Year" real, "Championship" text, "Opponent in the final" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was Shaun Murphy's outcome in the Premier League Snooker championship held before ...
SELECT "Outcome" FROM table_78839 WHERE "Championship" = 'premier league snooker' AND "Year" < '2010'
wikisql
CREATE TABLE club_rank ( rank number, club_id number, gold number, silver number, bronze number, total number ) CREATE TABLE club ( club_id number, name text, region text, start_year text ) CREATE TABLE competition_result ( competition_id number, club_id_1 number, c...
SELECT competition_type, COUNT(*) FROM competition GROUP BY competition_type
spider
CREATE TABLE table_27599216_6 ( founded INTEGER, football_stadium VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was mcmahon stadium founded?
SELECT MAX(founded) FROM table_27599216_6 WHERE football_stadium = "McMahon Stadium"
sql_create_context
CREATE TABLE table_57082 ( "State" text, "Interview" real, "Swimsuit" real, "Evening gown" real, "Average" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number of swimsuits when evening gown is 8.329 and average is less than 8.497
SELECT COUNT("Swimsuit") FROM table_57082 WHERE "Evening gown" = '8.329' AND "Average" < '8.497'
wikisql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE diagnosis ( diagnosisid number...
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'diagnosis' AND cost.eventid IN (SELECT diagnosis.diagnosisid FROM diagnosis WHERE diagnosis.diagnosisname = 'metastatic adenocarcinoma - unknown primary')
eicu
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code tex...
SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 79919) AND prescriptions.drug = '0.9% sodium chloride' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') A...
mimic_iii
CREATE TABLE table_name_48 ( penanced VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many were penanced for a total of 7666?
SELECT penanced FROM table_name_48 WHERE total = "7666"
sql_create_context
CREATE TABLE table_77667 ( "Debut year" real, "Player" text, "Date of birth" text, "Games" real, "Goals" real, "Years at club" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many games had 22 goals before 1935?
SELECT SUM("Games") FROM table_77667 WHERE "Goals" = '22' AND "Debut year" < '1935'
wikisql
CREATE TABLE table_203_344 ( id number, "#" number, "date" text, "opponent" text, "score" text, "win" text, "loss" text, "save" text, "attendance" number, "record" text, "other info" text ) -- Using valid SQLite, answer the following questions for the tables provided above....
SELECT "opponent" FROM table_203_344 GROUP BY "opponent" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE table_name_33 ( province_of_silla VARCHAR, modern_equivalent VARCHAR, administrative_district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHich Province of Silla has a Modern equivalent of south jeolla, and a Administrative district of se...
SELECT province_of_silla FROM table_name_33 WHERE modern_equivalent = "south jeolla" AND administrative_district = "seungju"
sql_create_context
CREATE TABLE table_57387 ( "Player" text, "Date of Birth" text, "Batting Style" text, "Bowling Style" text, "First Class Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the batting style of Makhaya Ntini?
SELECT "Batting Style" FROM table_57387 WHERE "Player" = 'makhaya ntini'
wikisql
CREATE TABLE table_203_536 ( id number, "#" number, "date" text, "opponent" text, "score" text, "win" text, "loss" text, "save" text, "crowd" number, "record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the difference ...
SELECT ABS((SELECT "crowd" FROM table_203_536 WHERE "date" = 'apr 22') - (SELECT "crowd" FROM table_203_536 WHERE "date" = 'apr 29'))
squall
CREATE TABLE table_2944 ( "No. in Series" real, "No. in Season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real, "U.S. viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided ab...
SELECT "Original air date" FROM table_2944 WHERE "Title" = 'Something New'
wikisql
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversa...
SELECT Id AS "comment_link", Text, UserId AS "user_link", CreationDate FROM Comments WHERE Text LIKE '%##string1?\ve##%' AND NOT (Text LIKE '%##string2?\vec##%') AND NOT (Text LIKE '%##string3?\ver##%') AND NOT (Text LIKE '%##string4?\vee##%') ORDER BY CreationDate DESC
sede
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additio...
SELECT COUNT(DISTINCT course.course_id) FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.has_lab = 'Y' AND program_course.category LIKE '%ULCS%'
advising
CREATE TABLE table_67302 ( "Driver" text, "Constructor" text, "Laps" text, "Time/Retired" text, "Grid" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What company was the constructor when Nick Heidfeld was the driver/
SELECT "Constructor" FROM table_67302 WHERE "Driver" = 'nick heidfeld'
wikisql
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(qtb.PERSON_ID) FROM qtb WHERE qtb.IN_DIAG_DIS_CD = 'S71.176' UNION SELECT COUNT(gyb.PERSON_ID) FROM gyb WHERE gyb.IN_DIAG_DIS_CD = 'S71.176' UNION SELECT COUNT(zyb.PERSON_ID) FROM zyb WHERE zyb.IN_DIAG_DIS_CD = 'S71.176' UNION SELECT COUNT(mzb.PERSON_ID) FROM mzb WHERE mzb.IN_DIAG_DIS_CD = 'S71.176'
css
CREATE TABLE table_19716903_1 ( isolation VARCHAR, mountain_peak VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many different isolation numbers does the Jack Mountain peak have?
SELECT COUNT(isolation) FROM table_19716903_1 WHERE mountain_peak = "Jack Mountain"
sql_create_context
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT p.Id AS "post_link", Score, u.Id AS "user_link" FROM Posts AS p, Users AS u ORDER BY Score LIMIT 10
sede
CREATE TABLE table_10579 ( "Year" real, "City" text, "Rider 1" text, "Rider 2" text, "Horse 1" text, "Horse 2" text, "Association" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which horse was Horse 1 when ren guzm n raced with the mulch n ...
SELECT "Horse 1" FROM table_10579 WHERE "Rider 1" = 'rené guzmán' AND "Association" = 'mulchén'
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 mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '金夏彤' AND hz_info.YLJGDM = '4819579' AND NOT mzjzjlb.JZKSMC LIKE '%重症%'
css
CREATE TABLE table_53374 ( "Date" text, "Venue" text, "Score" text, "Competition" text, "Turkey scorers" text, "Match report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which venue had a score of 1-1?
SELECT "Venue" FROM table_53374 WHERE "Score" = '1-1'
wikisql
CREATE TABLE table_38390 ( "Product" text, "Extensions" text, "Projects templates" text, "MSDN integration" text, "Debugging" text, "Profiling" text, "IntelliTrace" text, "Unit test" text, "Code coverage" text, "Test impact analysis" text, "Load testing" text, "Lab manage...
SELECT "IntelliTrace" FROM table_38390 WHERE "Extensions" = 'no' AND "Windows Phone development" = 'no'
wikisql
CREATE TABLE activity ( actid number, activity_name text ) CREATE TABLE faculty ( facid number, lname text, fname text, rank text, sex text, phone number, room text, building text ) CREATE TABLE faculty_participates_in ( facid number, actid number ) CREATE TABLE studen...
SELECT fname, lname FROM faculty WHERE rank = "Instructor"
spider
CREATE TABLE table_70007 ( "Nat." text, "Name" text, "Since" real, "App(GS/Sub)" text, "Goals" real, "Transfer fee" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the goals with since less than 2007 and App(GS/Sub) of 97 (69/28)
SELECT "Goals" FROM table_70007 WHERE "Since" < '2007' AND "App(GS/Sub)" = '97 (69/28)'
wikisql
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT T1.Code, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Name
nvbench
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE...
SELECT inputevents_cv.charttime 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 = 9038)) AND DATETIME(inputevents_cv.charttime) >= DATETIME(CURRENT_TIME(), '-663 day') ORDER ...
mimic_iii
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 WHERE demographic.admission_type = "ELECTIVE" AND demographic.insurance = "Private"
mimicsql_data
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, Mark...
SELECT TIME_TO_STR(p.CreationDate, '%Y') + (TIME_TO_STR(p.CreationDate, '%m') - 1) / 12.0 AS ddd, COUNT(*) AS N FROM Posts AS p WHERE TIME_TO_STR(p.CreationDate, '%Y') >= '##startYear?2010##' AND TIME_TO_STR(p.CreationDate, '%Y') <= '##endYear?2015##' GROUP BY TIME_TO_STR(p.CreationDate, '%Y') + (TIME_TO_STR(p.Creation...
sede
CREATE TABLE classroom ( building varchar(15), room_number varchar(7), capacity numeric(4,0) ) CREATE TABLE student ( ID varchar(5), name varchar(20), dept_name varchar(20), tot_cred numeric(3,0) ) CREATE TABLE teaches ( ID varchar(5), course_id varchar(8), sec_id varchar(8), ...
SELECT year, COUNT(year) FROM course AS T1 JOIN section AS T2 ON T1.course_id = T2.course_id WHERE T1.dept_name = 'Psychology' ORDER BY year DESC
nvbench
CREATE TABLE table_56232 ( "Yard Name" text, "Location (City, State)" text, "1st Ship Delivery Date" text, "Ship Types Delivered" text, "Total Number of Ways" text, "Total Vessels Built for USMC" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- wh...
SELECT "Ship Types Delivered" FROM table_56232 WHERE "Total Vessels Built for USMC" = '13 ships for usmc (plus 37 more for usn)'
wikisql
CREATE TABLE table_203_274 ( id number, "church name" text, "address" text, "community" text, "school" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the last church located in koreatown ?
SELECT "church name" FROM table_203_274 WHERE "community" = 'koreatown' ORDER BY id DESC LIMIT 1
squall
CREATE TABLE table_26610 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What in the series...
SELECT MIN("No. in series") FROM table_26610 WHERE "Written by" = 'Lauren Gussis'
wikisql
CREATE TABLE table_73540 ( "Horizontal order" real, "Height order" real, "Soundfield type" text, "Number of channels" real, "Channels" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the height order is 1 and the soundfield type is mixed-order, wh...
SELECT "Channels" FROM table_73540 WHERE "Soundfield type" = 'mixed-order' AND "Height order" = '1'
wikisql
CREATE TABLE building ( building_id text, Name text, Street_address text, Years_as_tallest text, Height_feet int, Floors int ) CREATE TABLE protein ( common_name text, protein_name text, divergence_from_human_lineage real, accession_number text, sequence_length real, seq...
SELECT Name, Height_feet FROM building AS T1 JOIN Institution AS T2 ON T1.building_id = T2.building_id WHERE T2.Founded > 1880
nvbench
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostLinks ( Id number, CreationDate time, Post...
SELECT Title, Body, CreationDate, Id AS "post_link", Tags, Score FROM Posts WHERE PostTypeId IN (1) AND CreationDate > '2020-01-01' AND CreationDate < '2020-12-31' AND Tags LIKE ('%java%') AND Score >= 15 ORDER BY CreationDate DESC
sede
CREATE TABLE table_29436238_1 ( no_in_series VARCHAR, written_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many episodes were written by Gregg Mettler?
SELECT COUNT(no_in_series) FROM table_29436238_1 WHERE written_by = "Gregg Mettler"
sql_create_context
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description t...
SELECT TOP(@TopCount) AS Id, DisplayName, Reputation, LastAccessDate, Age, Location FROM Users WHERE Location LIKE '##COuntry##%' ORDER BY Reputation DESC
sede
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE airline ( airline_code...
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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND date_day.day_number = 23 AND date_day.month_number = 4...
atis
CREATE TABLE table_55570 ( "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 is the away team that scored 12.17 (89)?
SELECT "Away team" FROM table_55570 WHERE "Away team score" = '12.17 (89)'
wikisql
CREATE TABLE products ( product_id number, parent_product_id number, production_type_code text, unit_price number, product_name text, product_color text, product_size text ) CREATE TABLE order_items ( order_item_id number, order_id number, product_id number, product_quantity...
SELECT DISTINCT product_size FROM products
spider
CREATE TABLE table_name_76 ( country VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country scored 67?
SELECT country FROM table_name_76 WHERE score = 67
sql_create_context
CREATE TABLE table_name_6 ( first_match VARCHAR, final_position VARCHAR, competition VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the date of the first match of the Fifa Club World Cup that ended with the final position as winners?
SELECT first_match FROM table_name_6 WHERE final_position = "winners" AND competition = "fifa club world cup"
sql_create_context
CREATE TABLE table_name_41 ( category VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which category had a year of 1991?
SELECT category FROM table_name_41 WHERE year = 1991
sql_create_context
CREATE TABLE table_1320857_1 ( je_armstrong VARCHAR, wh_archer VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is J.E. Armstrong when W.H. Archer is D.M. Lawson?
SELECT je_armstrong FROM table_1320857_1 WHERE wh_archer = "D.M. Lawson"
sql_create_context
CREATE TABLE table_8855 ( "Pick" real, "Player" text, "Position" text, "Nationality" text, "Former Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Nationality has a Former Team of denver nuggets?
SELECT "Nationality" FROM table_8855 WHERE "Former Team" = 'denver nuggets'
wikisql
CREATE TABLE HOTELS ( pets_allowed_yn VARCHAR, price_range INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the average price of hotels for different pet policy.
SELECT pets_allowed_yn, AVG(price_range) FROM HOTELS GROUP BY pets_allowed_yn
sql_create_context
CREATE TABLE table_25854 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Series" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name t...
SELECT "Location Attendance" FROM table_25854 WHERE "High points" = 'Dirk Nowitzki , Caron Butler (17)'
wikisql
CREATE TABLE customer ( cust_name VARCHAR, acc_bal VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the name and account balance of the customer whose name includes the letter a .
SELECT cust_name, acc_bal FROM customer WHERE cust_name LIKE '%a%'
sql_create_context
CREATE TABLE table_43260 ( "Week of" text, "Tier" text, "Winner" text, "Runner-up" text, "Semi finalists" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When Gigi Fern ndez Natalia Zvereva 6 2, 6 1 won, who was the Tier II Runner-up?
SELECT "Runner-up" FROM table_43260 WHERE "Tier" = 'tier ii' AND "Winner" = 'gigi fernández natalia zvereva 6–2, 6–1'
wikisql
CREATE TABLE table_76883 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many games have a score of 85-92?
SELECT COUNT("Game") FROM table_76883 WHERE "Score" = '85-92'
wikisql
CREATE TABLE table_name_8 ( gold INTEGER, rank VARCHAR, silver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the least number of gold medals won among nations ranked 1 with no silver medals?
SELECT MIN(gold) FROM table_name_8 WHERE rank = 1 AND silver < 1
sql_create_context
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, ...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE ...
mimic_iii
CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments ...
SELECT COUNT(*) > 0 FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 351 AND instructor.name LIKE '%Jonathan Brumit%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering...
advising
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT AVG(demographic.age) FROM demographic WHERE demographic.insurance = "Private" AND demographic.days_stay = "7"
mimicsql_data
CREATE TABLE table_name_61 ( class VARCHAR, part_2 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the class when part 2 was *h t?
SELECT class FROM table_name_61 WHERE part_2 = "*hēt"
sql_create_context
CREATE TABLE table_name_28 ( game INTEGER, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Game has a Score of 101-109 (ot)?
SELECT AVG(game) FROM table_name_28 WHERE score = "101-109 (ot)"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT demographic.dob FROM demographic WHERE demographic.name = "Shawn Green"
mimicsql_data
CREATE TABLE table_49036 ( "Name" text, "Team" text, "Qual 1" text, "Qual 2" text, "Best" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Name, when Best is 1:15.673?
SELECT "Name" FROM table_49036 WHERE "Best" = '1:15.673'
wikisql
CREATE TABLE Sportsinfo ( StuID VARCHAR, hoursperweek INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show all student IDs with more than total 10 hours per week on all sports played.
SELECT StuID FROM Sportsinfo GROUP BY StuID HAVING SUM(hoursperweek) > 10
sql_create_context
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, ...
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND NOT COURSE_0.course_id IN (SELECT STUDENT_RECORDalias0.course_id FROM student_record AS STUDENT_RECORDalias0 WHERE STUDENT...
advising
CREATE TABLE table_62071 ( "Tournament" text, "2000" text, "2001" text, "2002" text, "2003" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text ) -- Using valid SQLite, answer the following questions for the t...
SELECT "2002" FROM table_62071 WHERE "2011" = '1r' AND "2000" = '1r'
wikisql
CREATE TABLE table_204_937 ( id number, "rank" number, "lane" number, "athlete" text, "time" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who placed after manjeet kaur ?
SELECT "athlete" FROM table_204_937 WHERE id = (SELECT id FROM table_204_937 WHERE "athlete" = 'manjeet kaur') + 1
squall
CREATE TABLE table_13024 ( "Rank" real, "Map Reference Number" real, "Census Statistical Area" text, "2007 Population" real, "Lake(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the map reference number for Lake Superior with a larger po...
SELECT COUNT("Map Reference Number") FROM table_13024 WHERE "Lake(s)" = 'lake superior' AND "2007 Population" > '65,216'
wikisql
CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text...
SELECT BBDM, BBMC, BBZT FROM jybgb WHERE BGDH = '63566626307'
css
CREATE TABLE table_31625 ( "Year" text, "Men's singles" text, "Women's singles" text, "Men's doubles" text, "Women's doubles" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who played men's doubles when men's singles were played by wong peng soon an...
SELECT "Men's doubles" FROM table_31625 WHERE "Men's singles" = 'wong peng soon' AND "Women's singles" = 'cecilia samuel' AND "Year" = '1952'
wikisql
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
SELECT COUNT(*) > 0 FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias0 WHERE COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id AND NOT COURSEalias0.course_id IN...
advising
CREATE TABLE table_33163 ( "Country" text, "Date" text, "Label" text, "Format" text, "Catalogue" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What format does Japan use?
SELECT "Format" FROM table_33163 WHERE "Country" = 'japan'
wikisql
CREATE TABLE table_name_67 ( pick__number VARCHAR, college VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many picks did the College of USC wind up getting?
SELECT COUNT(pick__number) FROM table_name_67 WHERE college = "usc"
sql_create_context
CREATE TABLE table_name_2 ( date VARCHAR, opponent VARCHAR, match VARCHAR, ground VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date was the match higher than 8 on ground A against Guiseley?
SELECT date FROM table_name_2 WHERE match > 8 AND ground = "a" AND opponent = "guiseley"
sql_create_context
CREATE TABLE mzb ( 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 zyb WHERE zyb.PERSON_SEX = '王芳茵' AND MOD(zyb.MED_CLINIC_ID, 1) = 0
css
CREATE TABLE table_25372 ( "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 COUNT("Rebounds") FROM table_25372 WHERE "Points" = '147'
wikisql
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), ...
SELECT LName, COUNT(LName) FROM Student WHERE NOT StuID IN (SELECT T1.StuID FROM Has_Allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.AllergyType = "food") GROUP BY LName
nvbench
CREATE TABLE table_57832 ( "Name" text, "Years" text, "Gender" text, "Area" text, "Authority" text, "Decile" real, "Roll" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the sum roll of Karaka area?
SELECT SUM("Roll") FROM table_57832 WHERE "Area" = 'karaka'
wikisql
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, ...
SELECT AVG(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 = 25523)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arte...
mimic_iii
CREATE TABLE table_204_918 ( id number, "week" number, "date" text, "opponent" text, "result" text, "record" text, "attendance" number, "bye" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the total number of points scored ?
SELECT SUM("result" + "result") FROM table_204_918
squall
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, ...
SELECT DISTINCT pt.PostId AS "post_link" FROM PostTags AS pt INNER JOIN PendingFlags AS pf ON pf.PostId = pt.PostId AND pf.FlagTypeId IN (13, 14) INNER JOIN Tags AS t ON t.Id = pt.TagId WHERE t.TagName = 'outlook'
sede
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-4181')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput...
eicu
CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE swimme...
SELECT meter_200, AVG(meter_100) FROM swimmer GROUP BY meter_200
nvbench
CREATE TABLE table_name_64 ( original_air_date VARCHAR, production_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the air date for the episode with production code ad1c13?
SELECT original_air_date FROM table_name_64 WHERE production_code = "ad1c13"
sql_create_context
CREATE TABLE table_21034801_1 ( game INTEGER, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the numer of the game when the record was 4-0?
SELECT MAX(game) FROM table_21034801_1 WHERE record = "4-0"
sql_create_context
CREATE TABLE table_26144632_1 ( prize_fund___¥__ VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the prize for the tournament at Ibaraki?
SELECT prize_fund___¥__ FROM table_26144632_1 WHERE location = "Ibaraki"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.drug_type = "BASE" AND lab.label = "Red Blood Cells"
mimicsql_data
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuo...
SELECT chartevents.charttime 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 = 14671) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WH...
mimic_iii
CREATE TABLE table_name_95 ( city_of_license VARCHAR, call_sign VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the city of license for call sign of kcmp
SELECT city_of_license FROM table_name_95 WHERE call_sign = "kcmp"
sql_create_context
CREATE TABLE film_text ( film_id SMALLINT, title VARCHAR(255), description TEXT ) CREATE TABLE language ( language_id TINYINT UNSIGNED, name CHAR(20), last_update TIMESTAMP ) CREATE TABLE film ( film_id SMALLINT UNSIGNED, title VARCHAR(255), description TEXT, release_year YEAR,...
SELECT payment_date, COUNT(payment_date) FROM payment WHERE amount > 10 UNION SELECT T1.payment_date FROM payment AS T1 JOIN staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = 'Elsa' ORDER BY COUNT(payment_date) DESC
nvbench
CREATE TABLE table_22265261_1 ( age VARCHAR, sp VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How old was the horse when the SP was 200/1?
SELECT COUNT(age) FROM table_22265261_1 WHERE sp = "200/1"
sql_create_context
CREATE TABLE table_204_812 ( id number, "#" number, "prime minister" text, "date of birth" text, "start date\nof (first) term" text, "age at beginning\nof (first) term" text, "end date\nof (final) term" text, "total time in\noffice" text, "date of death" text, "lifespan" text ) ...
SELECT "prime minister" FROM table_204_812 WHERE "prime minister" IN ('edmund barton', 'alfred deakin') ORDER BY "age at beginning\nof (first) term" LIMIT 1
squall
CREATE TABLE table_204_922 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who was the only nation with 5 gold medals ?
SELECT "nation" FROM table_204_922 WHERE "gold" = 5
squall
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 equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE aircraft ( aircraft_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, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = ...
atis
CREATE TABLE table_9355 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the High assists for Tea...
SELECT "High assists" FROM table_9355 WHERE "Team" = 'houston'
wikisql
CREATE TABLE table_51223 ( "Jurisdiction" text, "For Prohibition" real, "Percent For" real, "Against Prohibition" real, "Percent Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest percent supporting prohibition when the numb...
SELECT MAX("Percent For") FROM table_51223 WHERE "Against Prohibition" < '2,978' AND "Percent Against" < '31.2' AND "For Prohibition" < '9,461'
wikisql
CREATE TABLE table_name_95 ( fleet_number VARCHAR, model VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the fleet number for the model of Gillig Phantom 3096TB?
SELECT fleet_number FROM table_name_95 WHERE model = "gillig phantom 3096tb"
sql_create_context
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TAB...
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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CHICAGO' AND date_day.day_number = 16 AND date_day.month_number = 6 AND d...
atis
CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH text, MZJZLSH text, KH text, KLX number, HZXM text, WDBZ number, RYDJSJ time, RYTJDM number, RYTJMC text, JZKSDM text, JZKSMC text, RZBQDM text, RZBQMC text, RYCWH text, CYKSDM text, CYKSMC text, CYBQDM tex...
SELECT COUNT(*) FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '68417064' AND mzjzjlb.JZKSRQ BETWEEN '2009-12-28' AND '2021-09-30' AND mzjzjlb.YLJGDM = '1278762'
css
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, U...
SELECT a.Id AS "post_link" FROM Posts AS a INNER JOIN Posts AS q ON q.AcceptedAnswerId = a.Id LEFT OUTER JOIN Users AS u ON q.OwnerUserId = u.Id WHERE a.OwnerUserId = '##UserId##' AND u.Id IS NULL
sede
CREATE TABLE table_name_66 ( week VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what Week was the Detroit Lions the Opponent?
SELECT week FROM table_name_66 WHERE opponent = "detroit lions"
sql_create_context
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ...
SELECT TagName, 'count' FROM Tags ORDER BY 'count' DESC
sede
CREATE TABLE table_38422 ( "Games" real, "Drawn" real, "Lost" real, "Points difference" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Points have a Drawn larger than 0, and a Lost larger than 1?
SELECT AVG("Points") FROM table_38422 WHERE "Drawn" > '0' AND "Lost" > '1'
wikisql