instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_37 ( purse___us$__ VARCHAR, track VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Purse in Sunland Park Track?
SELECT purse___us$__ FROM table_name_37 WHERE track = "sunland park"
sql_create_context
CREATE TABLE table_28898 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the result when the candidates are alexander smyth (dr) 100%
SELECT "Result" FROM table_28898 WHERE "Candidates" = 'Alexander Smyth (DR) 100%'
wikisql
CREATE TABLE farm_competition ( Competition_ID int, Year int, Theme text, Host_city_ID int, Hosts text ) CREATE TABLE city ( City_ID int, Official_Name text, Status text, Area_km_2 real, Population real, Census_Ranking text ) CREATE TABLE farm ( Farm_ID int, Year in...
SELECT Year, COUNT(Year) FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID ORDER BY Year
nvbench
CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes nu...
SELECT COUNT(Id) FROM Posts WHERE (PostTypeId = 1 AND (Tags LIKE '%java%')) AND CreationDate < '2019-3-10'
sede
CREATE TABLE fgwyjzb ( 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 gwyjzb.MED_SER_ORG_NO FROM gwyjzb WHERE gwyjzb.PERSON_ID = '61218284' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_CD = '2524-6') UNION SELECT fgwyjzb.MED_SER_ORG_NO FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '61218284' AND fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED...
css
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_nam...
SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'insert endotracheal tube') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 24547) AND DATETIME(proced...
mimic_iii
CREATE TABLE table_name_33 ( goals INTEGER, apps INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the Apps were smaller than 22, what's the lowest amount of goals scored in a game?
SELECT MIN(goals) FROM table_name_33 WHERE apps < 22
sql_create_context
CREATE TABLE table_203_687 ( id number, "#" number, "title" text, "time" text, "performer(s)" text, "songwriters" text, "producer(s)" text, "samples and notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which track is longer ? ny wea...
SELECT "title" FROM table_203_687 WHERE "title" IN ('"ny weather report"', '"country cousins"') ORDER BY "time" DESC LIMIT 1
squall
CREATE TABLE actor ( Actor_ID int, Name text, Musical_ID int, Character text, Duration text, age int ) CREATE TABLE musical ( Musical_ID int, Name text, Year int, Award text, Category text, Nominee text, Result text ) -- Using valid SQLite, answer the following que...
SELECT Nominee, COUNT(*) FROM musical GROUP BY Nominee ORDER BY Nominee
nvbench
CREATE TABLE table_19096 ( "Call sign" text, "Analog channel" text, "Digital channel" text, "Virtual channel" text, "Network" text, "Station Ownership" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who owns the station on channel 33.3?
SELECT "Station Ownership" FROM table_19096 WHERE "Virtual channel" = '33.3'
wikisql
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE cost ( row_id number, ...
SELECT DISTINCT prescriptions.route FROM prescriptions WHERE prescriptions.drug = 'oxycodone'
mimic_iii
CREATE TABLE table_name_56 ( launched VARCHAR, spacecraft VARCHAR, time_elapsed VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Launched has both a Spacecraft of Ulysses and 491 days (1 yr, 4 mo, 3 d) as Time elapsed?
SELECT launched FROM table_name_56 WHERE spacecraft = "ulysses" AND time_elapsed = "491 days (1 yr, 4 mo, 3 d)"
sql_create_context
CREATE TABLE table_49955 ( "Season" real, "Date" text, "Home team" text, "Score" text, "Away team" text, "Venue" text, "Competition round" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score of the copa libertadores group 3 comp...
SELECT "Score" FROM table_49955 WHERE "Competition round" = 'copa libertadores group 3' AND "Date" = '2 february 1994'
wikisql
CREATE TABLE table_25058269_1 ( runner_up VARCHAR, season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In season 2007 08 who is the runner-up?
SELECT runner_up FROM table_25058269_1 WHERE season = "2007–08"
sql_create_context
CREATE TABLE table_11960610_10 ( date VARCHAR, high_points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date deng (20) had high points?
SELECT date FROM table_11960610_10 WHERE high_points = "Deng (20)"
sql_create_context
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE PostNotices ( Id number, PostId number, PostNot...
SELECT DisplayName, UpVotes FROM Users WHERE Users.Id = 22656
sede
CREATE TABLE table_name_77 ( crowd INTEGER, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the average crowd size for the game when the Gold Coast Blaze was the home team?
SELECT AVG(crowd) FROM table_name_77 WHERE home_team = "gold coast blaze"
sql_create_context
CREATE TABLE table_75577 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Venue" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest week number where they played against the Detroit Lions?
SELECT MIN("Week") FROM table_75577 WHERE "Opponent" = 'detroit lions'
wikisql
CREATE TABLE table_74345 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the nationality of the draft pick player who plays c...
SELECT "Nationality" FROM table_74345 WHERE "Position" = 'Centre' AND "NHL team" = 'Calgary Flames'
wikisql
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 prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN...
mimic_iii
CREATE TABLE table_name_82 ( nationality VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the nationality of the person who played small forward?
SELECT nationality FROM table_name_82 WHERE position = "small forward"
sql_create_context
CREATE TABLE table_name_67 ( grid INTEGER, name VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest grid that Paul Tracy had when he had over 4 points?
SELECT MIN(grid) FROM table_name_67 WHERE name = "paul tracy" AND points > 4
sql_create_context
CREATE TABLE table_17356205_1 ( title VARCHAR, directed_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many titles are given for the episode directed by Joanna Kerns?
SELECT COUNT(title) FROM table_17356205_1 WHERE directed_by = "Joanna Kerns"
sql_create_context
CREATE TABLE table_67448 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was average attendance during week 15?
SELECT AVG("Attendance") FROM table_67448 WHERE "Week" = '15'
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 MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.gender = "F"
mimicsql_data
CREATE TABLE table_8243 ( "Team" text, "Gold" real, "Silver" real, "Bronze" real, "Overall" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the average bronze when the team is northwest territories and gold is more than 34?
SELECT AVG("Bronze") FROM table_8243 WHERE "Team" = 'northwest territories' AND "Gold" > '34'
wikisql
CREATE TABLE field ( fieldid int ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE T...
SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'semantic parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year = 2016
scholar
CREATE TABLE table_3669 ( "#" real, "Title" text, "Timeslot" text, "Air date" text, "Viewers (000s)" real, "Weekly Rank Sky1" real, "Weekly Rank Virgin Media" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- A what time was the title aired in ...
SELECT "Timeslot" FROM table_3669 WHERE "Air date" = 'October 22, 2009'
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 t_kc21.OUT_DIAG_DOC_CD, t_kc21.OUT_DIAG_DOC_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '47306460' AND t_kc21.IN_HOSP_DATE BETWEEN '2016-09-22' AND '2019-02-24' GROUP BY t_kc21.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC LIMIT 1
css
CREATE TABLE table_14342210_14 ( field_goals__5_points_ INTEGER, total_points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many field goals were made by the person with 100 points in total?
SELECT MAX(field_goals__5_points_) FROM table_14342210_14 WHERE total_points = 100
sql_create_context
CREATE TABLE table_name_6 ( race_2 VARCHAR, race_1 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Race 2, when Race 1 is 30?
SELECT race_2 FROM table_name_6 WHERE race_1 = "30"
sql_create_context
CREATE TABLE table_14098_1 ( area__km²___per_sqmi_ VARCHAR, country_or_territory_with_flag VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What unit of measurement for uruguay?
SELECT area__km²___per_sqmi_ FROM table_14098_1 WHERE country_or_territory_with_flag = "Uruguay"
sql_create_context
CREATE TABLE table_9915 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the player with a t10 place, from the United States, and has a score of 69-70-76=215?
SELECT "Player" FROM table_9915 WHERE "Place" = 't10' AND "Country" = 'united states' AND "Score" = '69-70-76=215'
wikisql
CREATE TABLE table_10075 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the country with a 70-74-69=213 score?
SELECT "Country" FROM table_10075 WHERE "Score" = '70-74-69=213'
wikisql
CREATE TABLE table_13732 ( "Date" text, "Ship" text, "Nationality" text, "Tonnage" real, "Fate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest tonnage for a ship from Great Britain named Newton Ash?
SELECT MAX("Tonnage") FROM table_13732 WHERE "Nationality" = 'great britain' AND "Ship" = 'newton ash'
wikisql
CREATE TABLE table_65914 ( "Hampden FL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest number of wins when draws are larger than 1, and byes are larger th...
SELECT MAX("Wins") FROM table_65914 WHERE "Draws" > '1' AND "Byes" > '0'
wikisql
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, sc...
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite, program_course WHERE NOT COURSE_1.course_id IN (SELECT course_prerequisite.pre_course_id FROM course AS COURSE_0, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.cours...
advising
CREATE TABLE table_282413_3 ( ethnic_group VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest 2001 population when the ethnic group is white: british?
SELECT MAX(2001 AS _population) FROM table_282413_3 WHERE ethnic_group = "White: British"
sql_create_context
CREATE TABLE dorm_amenity ( amenid number, amenity_name text ) CREATE TABLE lives_in ( stuid number, dormid number, room_number number ) CREATE TABLE dorm ( dormid number, dorm_name text, student_capacity number, gender text ) CREATE TABLE has_amenity ( dormid number, amen...
SELECT AVG(T1.age) FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.student_capacity = (SELECT MAX(student_capacity) FROM dorm)
spider
CREATE TABLE table_1341472_40 ( first_elected INTEGER, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the earliest year where the result of the election was a retired republican hold?
SELECT MIN(first_elected) FROM table_1341472_40 WHERE result = "Retired Republican hold"
sql_create_context
CREATE TABLE table_17796 ( "Year" real, "Road Opened" text, "Road Closed" text, "Freight Carried s Tonne" real, "Super B Capacity Reached [ citation needed ]" text, "Number of Truck Loads North" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Wha...
SELECT MAX("Year") FROM table_17796 WHERE "Road Closed" = 'April 13'
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 course_offering ( offering_id int, course_id int, semester int, section_number int, star...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.number <> 672 AND instructor.name LIKE '%Shelly Alilunas%' AND offering_instructor.instructor_id = instructor.instructor_id AND offeri...
advising
CREATE TABLE table_1914090_2 ( europe INTEGER, australia VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the most members Europe had when Australia had 94615?
SELECT MAX(europe) FROM table_1914090_2 WHERE australia = 94615
sql_create_context
CREATE TABLE table_name_29 ( finish VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What place did Jimmy Reece finish in 1957?
SELECT finish FROM table_name_29 WHERE year = "1957"
sql_create_context
CREATE TABLE table_51564 ( "Country" text, "Date" text, "Label" text, "Format" text, "Catalogue #" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date with the catalogue # cocy-80093?
SELECT "Date" FROM table_51564 WHERE "Catalogue #" = 'cocy-80093'
wikisql
CREATE TABLE table_name_46 ( wkts INTEGER, ovrs VARCHAR, econ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the sum of the wkts when the ovrs were bigger than 2 and econ was bigger than 7.84?
SELECT SUM(wkts) FROM table_name_46 WHERE ovrs > 2 AND econ > 7.84
sql_create_context
CREATE TABLE table_train_251 ( "id" int, "gender" string, "left_ventricular_ejection_fraction_lvef" int, "allergy_to_rabbit_proteins" bool, "recurring_alcohol_related_legal_problem" bool, "hyperlipidemia" bool, "fasting_ldl_cholesterol" int, "baseline_hemoglobin_hgb" float, "NOUSE" f...
SELECT * FROM table_train_251 WHERE hyperlipidemia = 1 OR fasting_ldl_cholesterol > 139
criteria2sql
CREATE TABLE table_26914854_3 ( incoming_manager VARCHAR, date_of_appointment VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the incoming manager when the date of appointment is 9 march 2011?
SELECT incoming_manager FROM table_26914854_3 WHERE date_of_appointment = "9 March 2011"
sql_create_context
CREATE TABLE table_name_79 ( manufacturer VARCHAR, time_retired VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the manufacter of the car with a time/retired of +0.122?
SELECT manufacturer FROM table_name_79 WHERE time_retired = "+0.122"
sql_create_context
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_lo...
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 = 'CINCINNATI' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'TAM...
atis
CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT ) CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Draw a bar chart for what i...
SELECT gender, AVG(age) FROM Person GROUP BY gender ORDER BY AVG(age) DESC
nvbench
CREATE TABLE Aircraft ( name VARCHAR, distance INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show names for all aircrafts with distances more than the average.
SELECT name FROM Aircraft WHERE distance > (SELECT AVG(distance) FROM Aircraft)
sql_create_context
CREATE TABLE table_1507431_1 ( date VARCHAR, tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The tournament Buick Classic occured on what dates?
SELECT date FROM table_1507431_1 WHERE tournament = "Buick Classic"
sql_create_context
CREATE TABLE table_44877 ( "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 Ryan Hunter-Reay of the Herdez Competition's Qual 2 time?
SELECT "Qual 2" FROM table_44877 WHERE "Team" = 'herdez competition' AND "Name" = 'ryan hunter-reay'
wikisql
CREATE TABLE table_19313 ( "Model" text, "Year" text, "Die Size (mm 2 ) [1]" text, "Config core [2]" text, "MTriangles/s [1]" real, "MPixel/s [1]" real, "Bus width ( bit )" text, "DirectX" text, "OpenGL" text, "OpenGL ES" text, "GFLOPS(@ 200MHz)" text, "Frequency" real ) ...
SELECT "OpenGL ES" FROM table_19313 WHERE "Model" = 'SGX520'
wikisql
CREATE TABLE table_name_54 ( result VARCHAR, venue VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Result has a Venue of home, and a Date of 3 october 1987?
SELECT result FROM table_name_54 WHERE venue = "home" AND date = "3 october 1987"
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 INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE diagnoses.long_title = "Encephalopathy, unspecified" AND procedures.short_title = "Spinal tap"
mimicsql_data
CREATE TABLE table_24172157_3 ( date_of_appointment VARCHAR, team VARCHAR, incoming_manager VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the date of appointment for incoming manager Roy Hodgson and the team is Liverpool?
SELECT date_of_appointment FROM table_24172157_3 WHERE team = "Liverpool" AND incoming_manager = "Roy Hodgson"
sql_create_context
CREATE TABLE table_60844 ( "Rank" real, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Rank has a Gold larger than 1, and a Bronze of 4, and a Silver smaller than 1?
SELECT MAX("Rank") FROM table_60844 WHERE "Gold" > '1' AND "Bronze" = '4' AND "Silver" < '1'
wikisql
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE offering_instructor ( offering_ins...
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_12134383_1 ( date_of_birth VARCHAR, end_of_term VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the date of birth with end of term being 2april1969
SELECT date_of_birth FROM table_12134383_1 WHERE end_of_term = "2April1969"
sql_create_context
CREATE TABLE table_name_72 ( matches VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Matches, when Year is '2003'?
SELECT matches FROM table_name_72 WHERE year = "2003"
sql_create_context
CREATE TABLE table_55327 ( "Driver" text, "Entrant" text, "Constructor" text, "Chassis" text, "Engine" text, "Tyre" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which engine has the entrant scuderia ferrari and is driven by Raymond Sommer?
SELECT "Engine" FROM table_55327 WHERE "Entrant" = 'scuderia ferrari' AND "Driver" = 'raymond sommer'
wikisql
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT COUNT(hz_info.RYBH) FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE mzjzjlb.ZZYSGH = '59407914' AND mzjzjlb.JZKSRQ BETWEEN '2007-04-22' AND '2019-12-24'
css
CREATE TABLE review ( a_id number, u_id number, i_id number, rating number, rank number ) CREATE TABLE item ( i_id number, title text ) CREATE TABLE useracct ( u_id number, name text ) CREATE TABLE trust ( source_u_id number, target_u_id number, trust number ) -- Usi...
SELECT COUNT(DISTINCT i_id) FROM review
spider
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd 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.icd9_code = "4659" AND prescriptions.drug_type = "ADDITIVE"
mimicsql_data
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 zyjzjlb.ZYZDBM, zyjzjlb.ZYZDMC FROM hz_info JOIN zyjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_inf...
css
CREATE TABLE table_name_88 ( byes INTEGER, draws VARCHAR, losses VARCHAR, wins VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which byes are high when losses are larger than 7, wins smaller than 6, and draws are smaller than 0?
SELECT MAX(byes) FROM table_name_88 WHERE losses > 7 AND wins < 6 AND draws < 0
sql_create_context
CREATE TABLE table_17466 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position does Jim Johnston play?
SELECT "Position" FROM table_17466 WHERE "Player" = 'Jim Johnston'
wikisql
CREATE TABLE table_38090 ( "7:00" text, "7:30" text, "8:00" text, "8:30" text, "9:00" text, "9:30" text, "10:00" text, "10:30" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 7:30 feature with an 8:30 feature Melrose Place?
SELECT "7:30" FROM table_38090 WHERE "8:30" = 'melrose place'
wikisql
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_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '曹烨磊' AND t_kc22.MED_INV_ITEM_TYPE = '治疗费'
css
CREATE TABLE table_name_98 ( year VARCHAR, nominated_work_title VARCHAR, organisation VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the year when then organisation is star awards, the result is won and the nominated work titl...
SELECT year FROM table_name_98 WHERE organisation = "star awards" AND result = "won" AND nominated_work_title = "n/a"
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 COUNT(DISTINCT Id) FROM Posts AS p WHERE p.PostTypeId = 1 AND Title LIKE '% API %'
sede
CREATE TABLE table_256286_45 ( _percentage_yes VARCHAR, no_votes VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the percentage of yes votes for the measure where the no votes number 199174?
SELECT _percentage_yes FROM table_256286_45 WHERE no_votes = 199174
sql_create_context
CREATE TABLE table_11744 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the result for pfc: put up or shut up?
SELECT "Res." FROM table_11744 WHERE "Event" = 'pfc: put up or shut up'
wikisql
CREATE TABLE table_65564 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Runner(s)-up of the Kemper Open Tournament?
SELECT "Runner(s)-up" FROM table_65564 WHERE "Tournament" = 'kemper open'
wikisql
CREATE TABLE table_name_94 ( transfer_fee VARCHAR, type VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the transfer fee for Gravgaard?
SELECT transfer_fee FROM table_name_94 WHERE type = "transfer" AND name = "gravgaard"
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtim...
SELECT COUNT(*) > 0 FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-38992')) AND STRFTIME('%y', allergy.allergytime) = '2105'
eicu
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT prescriptions.drug_type, prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Diazepam"
mimicsql_data
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 c.Id AS "comment_link", c.PostId AS "post_link", LENGTH(Body), p.Body FROM Comments AS c, Posts AS p WHERE (Text LIKE '%just a link%' OR Text LIKE '%hile this link%') AND c.PostId = p.Id ORDER BY LENGTH(p.Body)
sede
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wa...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.wardid = 1104 AND DATETIME(patient.unitadmittime) <= DATETIME(CURRENT_TIME(), '-4 year')
eicu
CREATE TABLE table_name_76 ( laps INTEGER, time_retired VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest number of laps when the Time/Retired is differential?
SELECT MAX(laps) FROM table_name_76 WHERE time_retired = "differential"
sql_create_context
CREATE TABLE table_name_31 ( outcome_of_election VARCHAR, candidate VARCHAR, number_of_votes VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the outcome of the election with edward mahama as a candidate and 73,494 votes?
SELECT outcome_of_election FROM table_name_31 WHERE candidate = "edward mahama" AND number_of_votes = "73,494"
sql_create_context
CREATE TABLE table_19210115_1 ( location VARCHAR, conference VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is the University that plays in the American Athletic Conference?
SELECT location FROM table_19210115_1 WHERE conference = "American Athletic conference"
sql_create_context
CREATE TABLE table_name_50 ( attendance INTEGER, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the average attendance from june 11
SELECT AVG(attendance) FROM table_name_50 WHERE date = "june 11"
sql_create_context
CREATE TABLE table_33561 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Kickoff" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the kickoff time for the Miami Dolphins?
SELECT "Kickoff" FROM table_33561 WHERE "Opponent" = 'miami dolphins'
wikisql
CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE time_zone ( time_zone_code text, time_zone...
SELECT DISTINCT advance_purchase, application, maximum_stay, minimum_stay, no_discounts, restriction_code, saturday_stay_required, stopovers FROM restriction WHERE restriction_code = 'AP/80'
atis
CREATE TABLE table_65628 ( "Club" text, "Total points" text, "Bonus points" text, "Match points" text, "Games" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Diff" text ) -- Using valid SQLite, answer the following questions for the tables provided ...
SELECT "Match points" FROM table_65628 WHERE "Points against" = '755'
wikisql
CREATE TABLE table_63857 ( "Township" text, "County" text, "Pop. (2010)" real, "Land ( sqmi )" real, "Water (sqmi)" real, "Latitude" real, "Longitude" real, "GEO ID" real, "ANSI code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Wh...
SELECT MAX("Latitude") FROM table_63857 WHERE "ANSI code" > '1759541' AND "Pop. (2010)" = '72'
wikisql
CREATE TABLE table_name_90 ( home_team VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Home team with an Away team that is wrexham?
SELECT home_team FROM table_name_90 WHERE away_team = "wrexham"
sql_create_context
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 SHRGH, SHRXM FROM jyjgzbb WHERE JYZBLSH = '40478366536'
css
CREATE TABLE table_63964 ( "Rank" real, "Rider" text, "Team" text, "Speed" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What ran has noel patterson as the rider?
SELECT "Rank" FROM table_63964 WHERE "Rider" = 'noel patterson'
wikisql
CREATE TABLE table_55877 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the home team on the May 2 game?
SELECT "Home" FROM table_55877 WHERE "Date" = 'may 2'
wikisql
CREATE TABLE Student_Course_Enrolment ( registration_id INTEGER, student_id INTEGER, course_id INTEGER, date_of_enrolment DATETIME, date_of_completion DATETIME ) CREATE TABLE Courses ( course_id INTEGER, author_id INTEGER, subject_id INTEGER, course_name VARCHAR(120), course_des...
SELECT subject_name, COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id GROUP BY T1.subject_id ORDER BY subject_name
nvbench
CREATE TABLE table_33336 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT WAS THE HOME TEAM'S SCORE WHEN THEY HAD A C...
SELECT "Home team score" FROM table_33336 WHERE "Crowd" > '20,000' AND "Away team" = 'collingwood'
wikisql
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostTags ( PostId num...
SELECT Questions.Id AS "post_link", Questions.CreationDate, COUNT(DISTINCT (Answers.Id)) AS "current_answers" FROM Posts AS Questions LEFT JOIN Posts AS Answers ON Answers.ParentId = Questions.Id WHERE Questions.PostTypeId = 1 GROUP BY Questions.Id, Questions.CreationDate, Questions.Title HAVING (MIN(Answers.CreationDa...
sede
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE diagnosis ( diagnosisid number...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'pneumonia' AND STRFTIME('%y', diagnosis.diagnosistime) >= '2105') AS t1 JOIN (SELECT patient.uniquepid, medi...
eicu
CREATE TABLE table_56290 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Save" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent on September 28?
SELECT "Opponent" FROM table_56290 WHERE "Date" = 'september 28'
wikisql
CREATE TABLE Customers ( customer_id INTEGER, customer_details VARCHAR(255) ) CREATE TABLE Organizations ( organization_id INTEGER, parent_organization_id INTEGER, organization_details VARCHAR(255) ) CREATE TABLE Things ( thing_id INTEGER, organization_id INTEGER, Type_of_Thing_Code CH...
SELECT organization_details, COUNT(organization_details) FROM Things AS T1 JOIN Organizations AS T2 ON T1.organization_id = T2.organization_id GROUP BY organization_details ORDER BY organization_details DESC
nvbench
CREATE TABLE table_77598 ( "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 with an away team scor...
SELECT "Venue" FROM table_77598 WHERE "Away team score" = '14.17 (101)'
wikisql