instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_89 ( player VARCHAR, pick INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player was picked after 23?
SELECT player FROM table_name_89 WHERE pick > 23
sql_create_context
CREATE TABLE table_31922 ( "Year" text, "Total matches" real, "Total W-L-H" text, "Singles W-L-H" text, "Points won" real, "Points %" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In 2007, how many points were won when more than 5 matches were ...
SELECT COUNT("Points won") FROM table_31922 WHERE "Year" = '2007' AND "Total matches" > '5'
wikisql
CREATE TABLE table_32381 ( "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 length has a Stage of 9?
SELECT "Length" FROM table_32381 WHERE "Stage" = '9'
wikisql
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester i...
SELECT COUNT(DISTINCT COURSE_1.department, COURSE_0.number) FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite, student_record WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_1.course_id = course_prerequisite.course_id AND COURSE_1.department = 'NURS' AND COURSE_1.number = 549 AND ...
advising
CREATE TABLE table_name_67 ( shot_pct VARCHAR, stolen_ends VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Shot Pct., when Stolen Ends is 2?
SELECT shot_pct FROM table_name_67 WHERE stolen_ends = 2
sql_create_context
CREATE TABLE table_65954 ( "School" text, "Location" text, "Mascot" text, "Enrollment 08-09" real, "IHSAA Class / Football Class" text, "County" text, "Year Joined" real, "Previous Conference" text, "Year Left" real, "Conference Joined" text ) -- Using valid SQLite, answer the ...
SELECT "School" FROM table_65954 WHERE "Conference Joined" = 'northeast corner' AND "Mascot" = 'blazers'
wikisql
CREATE TABLE table_38324 ( "Event" text, "Round" text, "Result" text, "Opponent" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Opponent of igor samoilenco had what result?
SELECT "Result" FROM table_38324 WHERE "Opponent" = 'igor samoilenco'
wikisql
CREATE TABLE table_51736 ( "Rank" real, "Constituency" text, "Winning party 2003" text, "Swing to gain" real, "Labour's place 2003" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the lowest Rank that has the Consti...
SELECT MIN("Rank") FROM table_51736 WHERE "Constituency" = 'strathkelvin and bearsden'
wikisql
CREATE TABLE table_1949746_1 ( call_sign VARCHAR, frequency VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 1180 am is the frequency how many call signs are there?
SELECT COUNT(call_sign) FROM table_1949746_1 WHERE frequency = "1180 AM"
sql_create_context
CREATE TABLE table_name_33 ( solo VARCHAR, player VARCHAR, yards VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of Solo with a Player with sean mcinerney, and Yards larger than 0?
SELECT COUNT(solo) FROM table_name_33 WHERE player = "sean mcinerney" AND yards > 0
sql_create_context
CREATE TABLE table_name_96 ( lose INTEGER, point VARCHAR, lost_point VARCHAR, goal_difference VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- I want the average lose for lost point more than 16 and goal difference less than 37 and point less than 43
SELECT AVG(lose) FROM table_name_96 WHERE lost_point > 16 AND goal_difference < 37 AND point < 43
sql_create_context
CREATE TABLE table_73574 ( "No" real, "Player" text, "Height (m)" text, "Height (f)" text, "Position" text, "Year born" real, "Current Club" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the height of demond greene
SELECT "Height (f)" FROM table_73574 WHERE "Player" = 'Demond Greene'
wikisql
CREATE TABLE table_14650 ( "City" text, "Province/Region" text, "Country" text, "IATA" text, "ICAO" text, "Airport" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which province has gmp for an IATA?
SELECT "Province/Region" FROM table_14650 WHERE "IATA" = 'gmp'
wikisql
CREATE TABLE table_name_79 ( score VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score on 1/10/1974?
SELECT score FROM table_name_79 WHERE date = "1/10/1974"
sql_create_context
CREATE TABLE table_51757 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Event" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the event for the year less than 1913 with the position of 2nd?
SELECT "Event" FROM table_51757 WHERE "Year" < '1913' AND "Position" = '2nd'
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 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_39918 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest Total for the rank 12, and gold less than 0?
SELECT MAX("Total") FROM table_39918 WHERE "Rank" = '12' AND "Gold" < '0'
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(*) FROM wdmzjzjlb WHERE wdmzjzjlb.ZZYSGH = '55870374' AND wdmzjzjlb.JZKSRQ BETWEEN '2001-02-11' AND '2007-04-26' UNION SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.ZZYSGH = '55870374' AND bdmzjzjlb.JZKSRQ BETWEEN '2001-02-11' AND '2007-04-26'
css
CREATE TABLE table_17250 ( "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. -- What w...
SELECT "Score" FROM table_17250 WHERE "High rebounds" = 'Emeka Okafor (10)'
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(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '5034604' AND t_kc21.IN_HOSP_DATE BETWEEN '2005-02-20' AND '2005-06-27'
css
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostFeedb...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%lanka%' OR UPPER(Location) LIKE '%SL' ORDER BY Reputation DESC LIMIT 200
sede
CREATE TABLE table_name_8 ( points INTEGER, year INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the highest points when year is more than 1953
SELECT MAX(points) FROM table_name_8 WHERE year > 1953
sql_create_context
CREATE TABLE table_74034 ( "Player" text, "Position" text, "Starting No.#" real, "D.O.B" text, "Club" text, "Height" text, "Weight" text, "Games" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position does the player Todd Wise play...
SELECT "Position" FROM table_74034 WHERE "Player" = 'Todd Wise'
wikisql
CREATE TABLE table_name_42 ( round VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which round did the bout that led to a 1-0 record end in?
SELECT round FROM table_name_42 WHERE record = "1-0"
sql_create_context
CREATE TABLE table_79465 ( "Event" text, "Class" text, "Gold" text, "Silver" text, "Bronze" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the event when the class is time trial hc a?
SELECT "Event" FROM table_79465 WHERE "Class" = 'time trial hc a'
wikisql
CREATE TABLE table_11930 ( "Number & name" text, "Description" text, "Current status" text, "Livery" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the description for the livery Br Grey?
SELECT "Description" FROM table_11930 WHERE "Livery" = 'br grey'
wikisql
CREATE TABLE table_67204 ( "Year" real, "Denomination" text, "Reverse" text, "Weight" text, "Diameter" text, "Fineness" text, "Series" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the fineness of the 2008 chinese cuju sport Reverse...
SELECT "Fineness" FROM table_67204 WHERE "Year" = '2008' AND "Reverse" = 'chinese cuju sport'
wikisql
CREATE TABLE reservations ( roomid VARCHAR, room VARCHAR ) CREATE TABLE rooms ( roomid VARCHAR, room VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the number of rooms that do not have any reservation.
SELECT COUNT(*) FROM rooms WHERE NOT roomid IN (SELECT DISTINCT room FROM reservations)
sql_create_context
CREATE TABLE table_44865 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" real, "Money ( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the player from the United States with a t6 place and a 71-70-76-72=289 scor...
SELECT "Player" FROM table_44865 WHERE "Country" = 'united states' AND "Place" = 't6' AND "Score" = '71-70-76-72=289'
wikisql
CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_...
SELECT DISTINCT ground_service.transport_type FROM airport, airport_service, city AS CITY_0, city AS CITY_1, ground_service WHERE airport.airport_code = airport_service.airport_code AND CITY_0.city_name = 'DALLAS' AND CITY_1.city_code = airport_service.city_code AND CITY_1.city_name = 'DALLAS' AND ground_service.airpor...
atis
CREATE TABLE table_2305948_1 ( country VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What countries does the Rock come from?
SELECT COUNT(country) FROM table_2305948_1 WHERE name = "The Rock"
sql_create_context
CREATE TABLE table_43552 ( "Date" text, "Round" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" real, "Scorers" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What venue has more than 50,715 attending?
SELECT "Venue" FROM table_43552 WHERE "Attendance" > '50,715'
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 prescriptions...
SELECT demographic.admission_type, demographic.admittime FROM demographic WHERE demographic.subject_id = "4333"
mimicsql_data
CREATE TABLE table_66856 ( "Year" real, "Date" text, "Title" text, "Format(s)" text, "Award description(s)" text, "Result(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which date has a format's album?
SELECT "Date" FROM table_66856 WHERE "Format(s)" = 'album'
wikisql
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE prescriptions ( row_id number, s...
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 4301) AND prescriptions.route = 'tp' AND STRFTIME('%y-%m', prescriptions.startdate) <= '2103-07' ORDER BY prescriptions.startdate LIMIT 1
mimic_iii
CREATE TABLE table_name_8 ( weekly_rank VARCHAR, official_ratings__millions_ VARCHAR, show VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Weekly Rank for a Live Final Show has an Official Ratings (millions) greater than 5.2?
SELECT weekly_rank FROM table_name_8 WHERE official_ratings__millions_ > 5.2 AND show = "live final"
sql_create_context
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE m...
SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-38474')) AND medication.routeadmin = 'iv push' AND DATETIME(med...
eicu
CREATE TABLE table_75121 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text ) -- Using valid SQLite, answer the following questions f...
SELECT "Losing bonus" FROM table_75121 WHERE "Points" = '0'
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 COUNT(*) FROM mzjzjlb WHERE ZZYSGH = '34115354' AND JZKSRQ BETWEEN '2005-01-17' AND '2019-09-19'
css
CREATE TABLE qtb ( 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 qtb WHERE qtb.MED_SER_ORG_NO = '3637568' AND qtb.IN_HOSP_DATE BETWEEN '2001-10-23' AND '2008-01-21' AND qtb.REMOTE_SETTLE_FLG = '异地1' OR qtb.REMOTE_SETTLE_FLG = '异地2' UNION SELECT COUNT(*) FROM gyb WHERE gyb.MED_SER_ORG_NO = '3637568' AND gyb.IN_HOSP_DATE BETWEEN '2001-10-23' AND '2008-01-21' AND g...
css
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT * FROM person_info JOIN hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjz...
css
CREATE TABLE table_1802760_3 ( state__class_ VARCHAR, date_of_successors_formal_installation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where was the successor formally installed on December 3, 1858?
SELECT state__class_ FROM table_1802760_3 WHERE date_of_successors_formal_installation = "December 3, 1858"
sql_create_context
CREATE TABLE table_46687 ( "Player" text, "Games Played" real, "Minutes Played" real, "Minutes Played Per Game" real, "Rebounds" real, "Rebounds Per Game" real, "Assists" real, "Assists Per Game" real, "Field Goal %" real, "Free Throw %" real, "Points" real, "Points Per G...
SELECT AVG("Rebounds") FROM table_46687 WHERE "Minutes Played" = '113' AND "Games Played" > '18'
wikisql
CREATE TABLE table_1839 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (million)" text ) -- Using valid SQLite, answer the following questions for the tables provided abo...
SELECT COUNT("Written by") FROM table_1839 WHERE "U.S. viewers (million)" = '3.24'
wikisql
CREATE TABLE table_58747 ( "South West DFL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many wins did they have when they had 5 losses?
SELECT "Wins" FROM table_58747 WHERE "Losses" = '5'
wikisql
CREATE TABLE table_28888 ( "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. -- Who is the incumbent in the Virginia 6 district?
SELECT "Incumbent" FROM table_28888 WHERE "District" = 'Virginia 6'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT prescriptions.drug_type FROM prescriptions WHERE prescriptions.formulary_drug_cd = "CIPR500"
mimicsql_data
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 procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.age < "68"
mimicsql_data
CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) CREATE TABLE Reviewer ( rID int, name text ) CREATE TABLE Movie ( mID int, title text, year int, director text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For e...
SELECT director, MAX(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE director <> "null" GROUP BY director
nvbench
CREATE TABLE table_name_6 ( match_points VARCHAR, lost VARCHAR, bonus_points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the amount of match points for a club that lost 18 and has 11 bonus points?
SELECT match_points FROM table_name_6 WHERE lost = "18" AND bonus_points = "11"
sql_create_context
CREATE TABLE budget ( school_id number, year number, budgeted number, total_budget_percent_budgeted number, invested number, total_budget_percent_invested number, budget_invested_percent text ) CREATE TABLE endowment ( endowment_id number, school_id number, donator_name text, ...
SELECT school_name FROM school ORDER BY enrollment LIMIT 1
spider
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, Li...
SELECT A.Score, A.Count, ROUND(A.Count / (CAST(B.Total AS FLOAT)) * 100, 5) AS "%age" FROM (SELECT Score, COUNT(Id) AS "Count" FROM Posts GROUP BY Score) AS A JOIN (SELECT COUNT(Id) AS "Total" FROM Posts) AS B ON 1 = 1 ORDER BY '%age' DESC, 'Score' DESC
sede
CREATE TABLE table_11464 ( "Team" text, "Chassis" text, "Engine" text, "Tyre" text, "Drivers" text, "Races" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What driver had a 15-20 record?
SELECT "Drivers" FROM table_11464 WHERE "Races" = '15-20'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE microlab ( microlabid number, ...
SELECT COUNT(*) > 0 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-202432')) AND STRFTIME('%y', lab.labresulttime) = '2105'
eicu
CREATE TABLE table_name_55 ( ties INTEGER, wins VARCHAR, season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the average amount of ties had when a team wins 6 and it's past the 2004 season?
SELECT AVG(ties) FROM table_name_55 WHERE wins = 6 AND season > 2004
sql_create_context
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
SELECT c.num_upvotes, c.num_downvotes, c.num_upvotes / c.num_downvotes AS ratio, p.post_count / c.num_downvotes AS downvotes_per_qa, c.weighted_up, c.weighted_down, c.weighted_up / c.weighted_down AS weight_ratio FROM (SELECT SUM(UpVotes) AS num_upvotes, SUM(DownVotes) AS num_downvotes, SUM(UpVotes * (Reputation / 200)...
sede
CREATE TABLE table_2325 ( "School" text, "Location(s)" text, "Control" text, "Type" text, "Enrollment (2012)" real, "Founded" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When university of north carolina at charlotte is the school what is the...
SELECT MIN("Enrollment (2012)") FROM table_2325 WHERE "School" = 'University of North Carolina at Charlotte'
wikisql
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE medication ( medi...
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'esrd (end stage...
eicu
CREATE TABLE People ( person_id INTEGER, first_name VARCHAR(255), middle_name VARCHAR(255), last_name VARCHAR(255), cell_mobile_number VARCHAR(40), email_address VARCHAR(40), login_name VARCHAR(40), password VARCHAR(40) ) CREATE TABLE Student_Course_Attendance ( student_id INTEGER, ...
SELECT course_name, COUNT(course_name) FROM Courses GROUP BY course_name
nvbench
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.QTY, t_kc22.UNIVALENT, t_kc22.AMOUNT FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '孔曼青' AND t_kc21.IN_HOSP_DATE BETWEEN '2001-08-29' AND '2015-03-17'
css
CREATE TABLE table_name_15 ( date VARCHAR, centerfold_model VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was Shannon Long the Centerfold model?
SELECT date FROM table_name_15 WHERE centerfold_model = "shannon long"
sql_create_context
CREATE TABLE table_75535 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest Pick that is wide receiver with overall of 29?
SELECT MAX("Pick #") FROM table_75535 WHERE "Position" = 'wide receiver' AND "Overall" = '29'
wikisql
CREATE TABLE table_2565 ( "Season" real, "Episodes" real, "Timeslot ( EST )" text, "Season premiere" text, "Season finale" text, "TV season" text, "Rank" text, "Viewers (in millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name t...
SELECT MIN("Season") FROM table_2565
wikisql
CREATE TABLE table_72900 ( "Position" real, "Team" text, "Played" real, "Won" real, "Drawn" real, "Lost" real, "Goals For" real, "Goals Against" real, "Goal Average 1" text, "Points 2" real ) -- Using valid SQLite, answer the following questions for the tables provided above. ...
SELECT "Team" FROM table_72900 WHERE "Goal Average 1" = '1.34'
wikisql
CREATE TABLE table_27862483_3 ( overall_record VARCHAR, win VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the overall record in the game won by D. Klein (2-0)?
SELECT overall_record FROM table_27862483_3 WHERE win = "D. Klein (2-0)"
sql_create_context
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 JZKSDM, JZKSMC FROM zyjzjlb WHERE JZLSH = '81908444288'
css
CREATE TABLE table_name_32 ( city VARCHAR, first_season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the name of the city whose first season was in 1996?
SELECT city FROM table_name_32 WHERE first_season = 1996
sql_create_context
CREATE TABLE table_203_105 ( id number, "name" text, "street address" text, "years as tallest" text, "height\nft (m)" text, "floors" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which building has 8 floors and is 240 ft tall ?
SELECT "name" FROM table_203_105 WHERE "floors" = 8 AND "height\nft (m)" = 240
squall
CREATE TABLE table_40205 ( "Nat." text, "Name" text, "Since" real, "App(L/C/E)" text, "Goals(L/C/E)" text, "Ends" real, "Transfer fee" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Nat., when Ends is greater than 2...
SELECT "Nat." FROM table_40205 WHERE "Ends" > '2010' AND "Since" = '2006' AND "Name" = 'paligeorgos'
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "29" AND procedures.short_title = "Thoracentesis"
mimicsql_data
CREATE TABLE table_74205 ( "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. -- How many NHL teams is Denis Pederson a draft pick for?
SELECT COUNT("NHL team") FROM table_74205 WHERE "Player" = 'Denis Pederson'
wikisql
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_labitems ( row_id numbe...
SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27038) AND prescriptions.drug = 'furosemide' AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-81 month')
mimic_iii
CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER ) CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Return a histogram on how o...
SELECT job, AVG(age) FROM Person GROUP BY job ORDER BY job
nvbench
CREATE TABLE table_name_35 ( opponent VARCHAR, loss VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent at the game that had a loss of Caldwell (10-11)?
SELECT opponent FROM table_name_35 WHERE loss = "caldwell (10-11)"
sql_create_context
CREATE TABLE table_68786 ( "Team" text, "City" text, "Founded" real, "First season in Segunda Divisi\u00f3n" real, "First season of current spell in Segunda Divisi\u00f3n" real, "Stadium" text, "Capacity" real, "Field" text, "Top division titles" real, "Last top division title" t...
SELECT "Team" FROM table_68786 WHERE "Top division titles" > '0' AND "Founded" > '1927' AND "Stadium" = 'miguel grau'
wikisql
CREATE TABLE table_name_27 ( location VARCHAR, loser VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the location where aaron grundy was the loser?
SELECT location FROM table_name_27 WHERE loser = "aaron grundy"
sql_create_context
CREATE TABLE Document_Locations ( Document_ID INTEGER, Location_Code CHAR(15), Date_in_Location_From DATETIME, Date_in_Locaton_To DATETIME ) CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME, Day_Number INTEGER ) CREATE TABLE Documents_to_be_Destroyed ( Document_ID INTEGER, Destructio...
SELECT Date_Stored, COUNT(Date_Stored) FROM All_Documents AS T1 JOIN Ref_Calendar AS T2 ON T1.Date_Stored = T2.Calendar_Date ORDER BY Date_Stored DESC
nvbench
CREATE TABLE exhibition_record ( Exhibition_ID int, Date text, Attendance int ) CREATE TABLE exhibition ( Exhibition_ID int, Year int, Theme text, Artist_ID int, Ticket_Price real ) CREATE TABLE artist ( Artist_ID int, Name text, Country text, Year_Join int, Age int...
SELECT Country, AVG(Age) FROM artist GROUP BY Country ORDER BY Country DESC
nvbench
CREATE TABLE table_14902507_2 ( courtside_reporter VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the courtside reporter for the year 2009-10?
SELECT courtside_reporter FROM table_14902507_2 WHERE year = "2009-10"
sql_create_context
CREATE TABLE table_44735 ( "Coach" text, "First Yr" real, "Last Yr" real, "W-L%" real, "G > .500" real, "Yr plyf" real, "G plyf" real, "W plyf" real, "L plyf" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest w plyf ...
SELECT MAX("W plyf") FROM table_44735 WHERE "First Yr" < '1960' AND "G plyf" > '0' AND "G > .500" < '43' AND "W-L%" < '0.578'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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 * 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_info.RYBH = '...
css
CREATE TABLE table_43449 ( "Frequency" text, "Call sign" text, "Branding" text, "Format" text, "Owner" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHich Frequency has a Format of country / news / sports?
SELECT "Frequency" FROM table_43449 WHERE "Format" = 'country / news / sports'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "COMPLETE HEART BLOCK"
mimicsql_data
CREATE TABLE Flight ( flno VARCHAR, origin VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show all flight number from Los Angeles.
SELECT flno FROM Flight WHERE origin = "Los Angeles"
sql_create_context
CREATE TABLE table_name_2 ( score VARCHAR, opponents VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score of the September 20, 2005 match when the Opponents are FC Bayern Munich?
SELECT score FROM table_name_2 WHERE opponents = "fc bayern munich" AND date = "september 20, 2005"
sql_create_context
CREATE TABLE table_5739 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score on October 24, 2005?
SELECT "Score" FROM table_5739 WHERE "Date" = 'october 24, 2005'
wikisql
CREATE TABLE procedures ( 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 MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "WIDOWED" AND demographic.age >= "44"
mimicsql_data
CREATE TABLE Guests ( guest_id INTEGER, gender_code CHAR(1), guest_first_name VARCHAR(80), guest_last_name VARCHAR(80), date_of_birth DATETIME ) CREATE TABLE Apartment_Facilities ( apt_id INTEGER, facility_code CHAR(15) ) CREATE TABLE View_Unit_Status ( apt_id INTEGER, apt_booking_...
SELECT booking_status_code, COUNT(*) FROM Apartment_Bookings GROUP BY booking_status_code ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE locations ( location_id number, street_address text, postal_code text, city text, state_province text, country_id text ) CREATE TABLE job_history ( employee_id number, start_date time, end_date time, job_id text, department_id number ) CREATE TABLE departments ...
SELECT * FROM departments WHERE department_name = 'Marketing'
spider
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE FlagTypes ( Id ...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%##Location##%' ORDER BY Reputation DESC LIMIT 500
sede
CREATE TABLE table_26148 ( "Copper Age" text, "Chalcolithic (4500 BC - 3300 BC)" text, "Early Chalcolithic" text, "4500 BC - 4000 BC" text, "Ubaid period in Mesopotamia" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When middle assyrian empire is t...
SELECT "Copper Age" FROM table_26148 WHERE "Ubaid period in Mesopotamia" = 'Middle Assyrian Empire'
wikisql
CREATE TABLE table_7596 ( "Format name" text, "Container" text, "Video coding" text, "Bit depth" real, "Color sampling" text, "Frame size" text, "Video bit rate, Mbit/s" text, "Audio coding" text ) -- Using valid SQLite, answer the following questions for the tables provided above. --...
SELECT AVG("Bit depth") FROM table_7596 WHERE "Video bit rate, Mbit/s" = '25 (cbr)' AND "Color sampling" = '4:1:1'
wikisql
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE labevents ( row_id number, subject_id ...
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY labevents.itemid) AS t1...
mimic_iii
CREATE TABLE table_name_36 ( record VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Record for Game 17?
SELECT record FROM table_name_36 WHERE game = "17"
sql_create_context
CREATE TABLE table_24312 ( "Competition" text, "Round" text, "Opponent" text, "Result" text, "Score" text, "Home/Away" text, "Venue" text, "Attendance" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many rounds have ...
SELECT "Round" FROM table_24312 WHERE "Attendance" = '6,150'
wikisql
CREATE TABLE Assets ( asset_id INTEGER, maintenance_contract_id INTEGER, supplier_company_id INTEGER, asset_details VARCHAR(255), asset_make VARCHAR(20), asset_model VARCHAR(20), asset_acquired_date DATETIME, asset_disposed_date DATETIME, other_asset_details VARCHAR(255) ) CREATE TA...
SELECT fault_description, COUNT(fault_description) FROM Fault_Log AS T1 JOIN Fault_Log_Parts AS T2 ON T1.fault_log_entry_id = T2.fault_log_entry_id GROUP BY fault_description ORDER BY COUNT(fault_description) DESC
nvbench
CREATE TABLE table_73546 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (in millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the title of the ...
SELECT "Title" FROM table_73546 WHERE "Written by" = 'Michael Gans & Richard Register'
wikisql
CREATE TABLE table_name_96 ( time VARCHAR, notes VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's Italy's time when the notes were SA/B?
SELECT time FROM table_name_96 WHERE notes = "sa/b" AND country = "italy"
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 course_tags_count ( course_id int, clear_grading int, pop_quiz int, ...
SELECT DISTINCT COURSE_1.department, COURSE_1.name, COURSE_1.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_0.department = 'SPANISH' AND COURSE_0.number = 420 AND COURSE_1.course_id = course_prerequisite.course_id
advising
CREATE TABLE table_name_14 ( lane VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What lane was Henrique Barbosa in?
SELECT COUNT(lane) FROM table_name_14 WHERE name = "henrique barbosa"
sql_create_context