instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_72303 ( "Election" real, "# of candidates nominated" real, "# of seats won" real, "# of total votes" real, "% of popular vote" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the election year when the # of candidates nomin...
SELECT COUNT("Election") FROM table_72303 WHERE "# of candidates nominated" = '262'
wikisql
CREATE TABLE table_name_49 ( date_of_appointment VARCHAR, outgoing_manager VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date of appointment for the outgoing manager edoardo reja?
SELECT date_of_appointment FROM table_name_49 WHERE outgoing_manager = "edoardo reja"
sql_create_context
CREATE TABLE table_203_519 ( id number, "pos" number, "no" number, "driver" text, "team" text, "laps" number, "time/retired" text, "grid" number, "points" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what driver earned the most p...
SELECT "driver" FROM table_203_519 ORDER BY "points" DESC LIMIT 1
squall
CREATE TABLE table_27221 ( "Round" text, "Opposition" text, "Time" text, "Date" text, "Home/Away" text, "Venue" text, "Score" text, "Result/Margin" text, "Broadcaster" text, "TV" text, "Ladder Position" text ) -- Using valid SQLite, answer the following questions for the ta...
SELECT "Date" FROM table_27221 WHERE "Ladder Position" = '8th' AND "Opposition" = 'Hawthorn'
wikisql
CREATE TABLE table_73660 ( "Episode no." real, "Airdate" text, "Viewers" real, "BBC Three weekly ranking" text, "Cable rank" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where where the bbc three weekly ranking for episode no. 5?
SELECT "BBC Three weekly ranking" FROM table_73660 WHERE "Episode no." = '5'
wikisql
CREATE TABLE table_name_78 ( rank VARCHAR, chassis VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the rank of the cadillac northstar lmp02 chassis?
SELECT rank FROM table_name_78 WHERE chassis = "cadillac northstar lmp02"
sql_create_context
CREATE TABLE table_name_55 ( outcome VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the outcome on May 25, 2009?
SELECT outcome FROM table_name_55 WHERE date = "may 25, 2009"
sql_create_context
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, d...
SELECT AVG(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '011-49649')) AND lab.labname = 'urinary osmolality' AND DATETIME(lab.labresulttime...
eicu
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 WHERE department = 'EECS' AND has_lab = 'Y' AND number = 381
advising
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 Founder, AVG(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY AVG(Revenue) DESC
nvbench
CREATE TABLE Customers ( customer_first_name VARCHAR, customer_last_name VARCHAR, customer_id VARCHAR ) CREATE TABLE Accounts ( customer_id VARCHAR, account_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the first name and last name fo...
SELECT T2.customer_first_name, T2.customer_last_name FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T1.account_name = "900"
sql_create_context
CREATE TABLE College ( cName varchar(20), state varchar(2), enr numeric(5,0) ) CREATE TABLE Player ( pID numeric(5,0), pName varchar(20), yCard varchar(3), HS numeric(5,0) ) CREATE TABLE Tryout ( pID numeric(5,0), cName varchar(20), pPos varchar(8), decision varchar(3) ) ...
SELECT state, enr FROM College ORDER BY enr
nvbench
CREATE TABLE races ( name VARCHAR, TIME VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the names of races held after 12:00:00 or before 09:00:00?
SELECT name FROM races WHERE TIME > "12:00:00" OR TIME < "09:00:00"
sql_create_context
CREATE TABLE catalog_contents ( catalog_entry_id number, catalog_level_number number, parent_entry_id number, previous_entry_id number, next_entry_id number, catalog_entry_name text, product_stock_number text, price_in_dollars number, price_in_euros number, price_in_pounds number...
SELECT catalog_publisher FROM catalogs GROUP BY catalog_publisher ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_24005 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Cardinals points" real, "Opponents" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many opponents were in North Carolina state game?
SELECT COUNT("Opponents") FROM table_24005 WHERE "Opponent" = 'North Carolina State'
wikisql
CREATE TABLE table_69070 ( "Season" text, "Team" text, "Country" text, "Division" text, "Apps" real, "Goals" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What division is Traktor Tashkent in 2005?
SELECT "Division" FROM table_69070 WHERE "Team" = 'traktor tashkent' AND "Season" = '2005'
wikisql
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate re...
SELECT Name, Height FROM people ORDER BY Name
nvbench
CREATE TABLE table_67606 ( "Year" real, "Team" text, "Co-Drivers" text, "Class" text, "Laps" real, "Pos." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position did lap 296 come in?
SELECT "Pos." FROM table_67606 WHERE "Laps" = '296'
wikisql
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(...
SELECT HIRE_DATE, SUM(SALARY) FROM employees ORDER BY SUM(SALARY) DESC
nvbench
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TA...
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '029-22492')) AND medication.drugname = 'sodium chloride 0.9 % ...
eicu
CREATE TABLE table_name_62 ( wins INTEGER, earnings___$__ VARCHAR, events VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many wins for billy casper over 8 events and uner $71,979 in earnings?
SELECT MIN(wins) FROM table_name_62 WHERE events = 8 AND player = "billy casper" AND earnings___$__ < 71 OFFSET 979
sql_create_context
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
SELECT FIRST_NAME, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY MANAGER_ID
nvbench
CREATE TABLE table_name_75 ( method VARCHAR, opponent VARCHAR, round VARCHAR, res VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the method in the round 2 win over Nick Gilardi?
SELECT method FROM table_name_75 WHERE round = "2" AND res = "win" AND opponent = "nick gilardi"
sql_create_context
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE cost ( costid number, u...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', intakeoutput.intakeoutputtime)) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid ...
eicu
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
SELECT MIN(vitalperiodic.sao2) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-111412')) AND NOT vitalperiodic.sao2 IS NULL AND STRF...
eicu
CREATE TABLE table_37774 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent for the game on November 20, 1955?
SELECT "Opponent" FROM table_37774 WHERE "Date" = 'november 20, 1955'
wikisql
CREATE TABLE table_name_53 ( run_2 VARCHAR, run_4 VARCHAR, run_3 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much Run 2 has a Run 4 of 57.68, and a Run 3 smaller than 57.9?
SELECT COUNT(run_2) FROM table_name_53 WHERE run_4 = 57.68 AND run_3 < 57.9
sql_create_context
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, ZZBZ number, WDBZ number, JZKSBM text, JZKSMC text, JZKSRQ time, ...
SELECT JZLX FROM jybgb WHERE BGDH = '90694892427'
css
CREATE TABLE table_name_86 ( transfer_window VARCHAR, transfer_fee VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Transfer window, when the Transfer fee is 'free', and when the Name is Dugdale?
SELECT transfer_window FROM table_name_86 WHERE transfer_fee = "free" AND name = "dugdale"
sql_create_context
CREATE TABLE table_17165 ( "Series" text, "Monday" text, "Tuesday" text, "Wednesday" text, "Thursday" text, "Friday" text, "Saturday" text, "Sunday" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the Tuesday presenter of Celebrity...
SELECT "Tuesday" FROM table_17165 WHERE "Series" = 'Celebrity Big Brother 8'
wikisql
CREATE TABLE table_name_65 ( title VARCHAR, termination_of_mission VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the title with termination of mission of february 24, 1828
SELECT title FROM table_name_65 WHERE termination_of_mission = "february 24, 1828"
sql_create_context
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number,...
SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-52724' AND patient.hospitaldischargetime IS NULL)) AND medication.drugname...
eicu
CREATE TABLE table_13835 ( "Rank" real, "Peak" text, "Country" text, "Island" text, "Elevation (m)" real, "Prominence (m)" real, "Col (m)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much Elevation (m) has a Col (m) smaller than 562, ...
SELECT COUNT("Elevation (m)") FROM table_13835 WHERE "Col (m)" < '562' AND "Rank" = '10' AND "Prominence (m)" > '1,598'
wikisql
CREATE TABLE table_41177 ( "Team" text, "Match" text, "Points" text, "Draw" text, "Lost" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Draw for skra warszawa?
SELECT "Draw" FROM table_41177 WHERE "Team" = 'skra warszawa'
wikisql
CREATE TABLE table_name_44 ( composer_s_ VARCHAR, arranger_s_ VARCHAR, length VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is/are the Composer(s), when the Arranger(s) is Banana Boat, and when the Length is 4:25?
SELECT composer_s_ FROM table_name_44 WHERE arranger_s_ = "banana boat" AND length = "4:25"
sql_create_context
CREATE TABLE table_name_58 ( glendale_principal VARCHAR, year VARCHAR, ms_principal VARCHAR, hs_principal VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the Glendale principal with Greg Smorel as m.s. principal and Joleen Reinholz as H.S. prin...
SELECT glendale_principal FROM table_name_58 WHERE ms_principal = "greg smorel" AND hs_principal = "joleen reinholz" AND year = "2006-2007"
sql_create_context
CREATE TABLE table_20367820_16 ( not_out VARCHAR, average VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many no outs for an average of 56.38?
SELECT COUNT(not_out) FROM table_20367820_16 WHERE average = "56.38"
sql_create_context
CREATE TABLE table_14379 ( "Game" real, "Date" text, "Location" text, "Time" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of the game that was played in the time of 2:38?
SELECT MAX("Game") FROM table_14379 WHERE "Time" = '2:38'
wikisql
CREATE TABLE table_22359 ( "No. in series" real, "No. in 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. -- How many season...
SELECT MIN("No. in season") FROM table_22359 WHERE "Directed by" = 'Bryan Spicer'
wikisql
CREATE TABLE table_23378 ( "Year" text, "Division" text, "League" text, "Regular Season" text, "Playoffs" text, "Open Cup" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 1995 is the year what is the open cup?
SELECT "Open Cup" FROM table_23378 WHERE "Year" = '1995'
wikisql
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime 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 DATETIME(diagnoses_icd.charttime) >= DATETIME(CURRENT_TIME(), '-2 year') GROUP BY diagnoses_icd....
mimic_iii
CREATE TABLE table_2725949_6 ( poles VARCHAR, fastest_laps VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of poles for fastest laps being 6
SELECT COUNT(poles) FROM table_2725949_6 WHERE fastest_laps = 6
sql_create_context
CREATE TABLE Products ( product_id INTEGER, product_type_code VARCHAR(10), product_name VARCHAR(80), product_price DECIMAL(19,4) ) CREATE TABLE Department_Store_Chain ( dept_store_chain_id INTEGER, dept_store_chain_name VARCHAR(80) ) CREATE TABLE Department_Stores ( dept_store_id INTEGER, ...
SELECT product_type_code, MAX(product_price) FROM Products GROUP BY product_type_code
nvbench
CREATE TABLE Addresses ( Address_ID INTEGER, address_details VARCHAR(255) ) CREATE TABLE Channels ( Channel_ID INTEGER, Other_Details VARCHAR(255) ) CREATE TABLE Locations ( Location_ID INTEGER, Other_Details VARCHAR(255) ) CREATE TABLE Products ( Product_ID INTEGER, Product_Type_Code...
SELECT Product_Type_Code, COUNT(*) FROM Products GROUP BY Product_Type_Code ORDER BY COUNT(*)
nvbench
CREATE TABLE ship ( name VARCHAR, CLASS VARCHAR, ship_id VARCHAR ) CREATE TABLE captain ( name VARCHAR, CLASS VARCHAR, ship_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what are the names and classes of the ships that do not have any ca...
SELECT name, CLASS FROM ship WHERE NOT ship_id IN (SELECT ship_id FROM captain)
sql_create_context
CREATE TABLE table_name_57 ( november INTEGER, game VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest November that has a game less than 12, and @ detroit red wings as the opponent?
SELECT MAX(november) FROM table_name_57 WHERE game < 12 AND opponent = "@ detroit red wings"
sql_create_context
CREATE TABLE table_name_94 ( parameter VARCHAR, best_fit__wmap_only_ VARCHAR, symbol VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the parameter when the best fit (WMAP only) is .9 .1, and symbol is a?
SELECT parameter FROM table_name_94 WHERE best_fit__wmap_only_ = ".9 ± .1" AND symbol = "a"
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugst...
SELECT COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-3355')) AND STRFTIME('%y-%m', microlab.culturetakentime) = '2105-12'
eicu
CREATE TABLE table_23286223_8 ( location_attendance VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where was the March 24 game played?
SELECT location_attendance FROM table_23286223_8 WHERE date = "March 24"
sql_create_context
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = "F" AND lab.label = "Bilirubin, Indirect"
mimicsql_data
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE date_day ( month_number int, d...
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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND flight.arrival_time <= 1700 AND flight.to_airport = AIRPORT_SERVICE_1.airport...
atis
CREATE TABLE table_1818 ( "Club" text, "First season in top division" text, "Number of seasons in top division" real, "First season of current spell in top division" text, "Number of seasons in Liga MX" real, "Top division titles" real ) -- Using valid SQLite, answer the following questions fo...
SELECT "First season of current spell in top division" FROM table_1818 WHERE "First season in top division" = '1964-65'
wikisql
CREATE TABLE table_204_991 ( id number, "name" text, "first\nheld" number, "country" text, "earliest attendance figure known" text, "1998 attendance" number, "2000 attendance" number, "2002 attendance" number, "2004 attendance" number, "2006 attendance" number, "2008 attendan...
SELECT "country" FROM table_204_991 GROUP BY "country" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ...
SELECT COUNT(*) FROM prescriptions WHERE prescriptions.drug = 'zymar'
mimic_iii
CREATE TABLE table_name_24 ( language VARCHAR, original_title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What language is the film La Diagonale du Fou in?
SELECT language FROM table_name_24 WHERE original_title = "la diagonale du fou"
sql_create_context
CREATE TABLE table_name_56 ( player VARCHAR, tries VARCHAR, points VARCHAR, goals VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the player with points larger than 36 and goals more than 0 with tries of 12
SELECT player FROM table_name_56 WHERE points > 36 AND goals > 0 AND tries = 12
sql_create_context
CREATE TABLE table_name_10 ( home_team VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What did the home team score when they played the away team of Geelong?
SELECT home_team AS score FROM table_name_10 WHERE away_team = "geelong"
sql_create_context
CREATE TABLE table_1473672_5 ( position VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position did Marty Gateman play?
SELECT position FROM table_1473672_5 WHERE player = "Marty Gateman"
sql_create_context
CREATE TABLE Flight ( flno VARCHAR, distance INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show flight number for all flights with more than 2000 distance.
SELECT flno FROM Flight WHERE distance > 2000
sql_create_context
CREATE TABLE table_name_18 ( lexton_plains VARCHAR, wins VARCHAR, against VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team has fewer than 9 wins and less than 1593 against?
SELECT lexton_plains FROM table_name_18 WHERE wins < 9 AND against < 1593
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 SuggestedEditVotes ( Id number, SuggestedEditId num...
SELECT q.Score AS "score", AVG(CAST(q.ViewCount AS INT)) AS "avg._views" FROM Posts AS q WHERE q.PostTypeId = 1 AND q.ClosedDate IS NULL AND q.Score >= -5 AND q.Score <= 50 AND q.AnswerCount = 0 GROUP BY q.Score ORDER BY q.Score
sede
CREATE TABLE table_47522 ( "Conference" text, "# of Bids" real, "Record" text, "Win %" text, "Round of 32" text, "Sweet Sixteen" text, "Elite Eight" text, "Final Four" text, "Championship Game" text ) -- Using valid SQLite, answer the following questions for the tables provided abo...
SELECT "Championship Game" FROM table_47522 WHERE "Win %" = '.429'
wikisql
CREATE TABLE table_16199 ( "Institution" text, "Nickname" text, "Location" text, "Founded" real, "Type" text, "Enrollment" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- point park university is what type of institution
SELECT "Type" FROM table_16199 WHERE "Institution" = 'Point Park University'
wikisql
CREATE TABLE table_7415 ( "Tournament" text, "1995" text, "1996" text, "1997" text, "1998" text, "1999" text, "2000" text, "2001" text, "2002" text, "2003" text, "2004" text, "2005" text, "2006" text ) -- Using valid SQLite, answer the following questions for the ta...
SELECT "2001" FROM table_7415 WHERE "1995" = '1r'
wikisql
CREATE TABLE country ( Country_id int, Country_name text, Capital text, Official_native_language text ) CREATE TABLE match_season ( Season real, Player text, Position text, Country int, Team int, Draft_Pick_Number int, Draft_Class text, College text ) CREATE TABLE playe...
SELECT Country_name, COUNT(*) FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country GROUP BY T1.Country_name
nvbench
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "62" AND prescriptions.route = "SC"
mimicsql_data
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 ZZYSGH, QTJZYSGH FROM mzjzjlb WHERE JZLSH = '67977476641'
css
CREATE TABLE table_18595 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the incumbent for ohio 12?
SELECT "Incumbent" FROM table_18595 WHERE "District" = 'Ohio 12'
wikisql
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT All_Neutral, School_ID FROM basketball_match ORDER BY School_ID
nvbench
CREATE TABLE table_28680377_2 ( original_air_date VARCHAR, us_viewers__million_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the original air date of the episode that was watched by 0.88 million U.S. viewers?
SELECT original_air_date FROM table_28680377_2 WHERE us_viewers__million_ = "0.88"
sql_create_context
CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE state ( state_code text, state_name text, country_name text ) ...
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 = 'SEATTLE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN DI...
atis
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
SELECT T2.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T1.Code DESC
nvbench
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
SELECT Headquarter, AVG(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY AVG(Price) DESC
nvbench
CREATE TABLE zyjzjlb_jybgb ( YLJGDM_ZYJZJLB text, BGDH number, YLJGDM number ) 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, ...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW 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 = jy...
css
CREATE TABLE table_540 ( "Team" text, "Car(s)" text, "#" real, "Driver(s)" text, "Primary Sponsor(s)" text, "Owner(s)" text, "Crew Chief" text, "Rounds" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who drove for Phil Parsons Racing tea...
SELECT "Driver(s)" FROM table_540 WHERE "Team" = 'Phil Parsons Racing'
wikisql
CREATE TABLE table_name_28 ( number VARCHAR, name VARCHAR, kilometer VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Number of the Koppenberg course with less than 195 Kilometers?
SELECT COUNT(number) FROM table_name_28 WHERE name = "koppenberg" AND kilometer < 195
sql_create_context
CREATE TABLE table_17607 ( "Week" real, "Craigs vote" text, "Arlenes vote" text, "Brunos vote" text, "Lens vote" text, "Safe" text, "Eliminated" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the total of arlenes vote when craig vot...
SELECT COUNT("Arlenes vote") FROM table_17607 WHERE "Craigs vote" = 'Brian and Karen'
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 COUNT(hz_info.RYBH) FROM hz_info JOIN zzmzjzjlb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE zzmzjzjlb.ZZYSGH = '75246625' AND zzmzjzjlb.JZKSRQ BETWEEN '2000-11-21' AND '2017-06-25' UNION SELECT COUNT(hz_info.RYBH) FROM hz_info JOIN fzzmzjzjlb ON hz_inf...
css
CREATE TABLE table_43642 ( "Year" real, "U.S. Rank" real, "Total s Ton" real, "Domestic s Ton" real, "Foreign Total s Ton" real, "Foreign Imports s Ton" real, "Foreign Exports s Ton" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the...
SELECT AVG("Foreign Imports s Ton") FROM table_43642 WHERE "Total s Ton" = '3,157,247' AND "Foreign Exports s Ton" < '358,493'
wikisql
CREATE TABLE table_28677723_14 ( trine_dehli_cleve INTEGER, style VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the trine dehli cleve for english waltz
SELECT MIN(trine_dehli_cleve) FROM table_28677723_14 WHERE style = "English Waltz"
sql_create_context
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_ID = '63411800' AND t_kc22.STA_DATE BETWEEN '2002-11-23' AND '2008-08-03' AND t_kc22.MED_INV_ITEM_TYPE = '西药费'
css
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "MARRIED" AND diagnoses.long_title = "Acute on chronic diastolic heart failure"
mimicsql_data
CREATE TABLE table_13628 ( "[A] (mol/L)" text, "[H 3 PO 4 ]/[A] (%)" text, "[H 2 PO 4 \u2212 ]/[A] (%)" real, "[HPO 4 2\u2212 ]/[A] (%)" text, "[PO 4 3\u2212 ]/[A] (%)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What the [A] that has more than 8...
SELECT "[A] (mol/L)" FROM table_13628 WHERE "[H 2 PO 4 \u2212 ]/[A] (%)" > '8.29' AND "[PO 4 3\u2212 ]/[A] (%)" = '1.30×10 −8'
wikisql
CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE aircraft (...
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, fare, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'KANSAS CITY' AND NOT fare.round_trip_cost IS NULL AND flight_fare.fare...
atis
CREATE TABLE table_31511 ( "Townland" text, "Area( acres )" real, "Barony" text, "Civil parish" text, "Poor law union" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many baronies is Maulnagrough a part of?
SELECT COUNT("Barony") FROM table_31511 WHERE "Townland" = 'Maulnagrough'
wikisql
CREATE TABLE table_45191 ( "Date" text, "Score" text, "Set 1" text, "Set 2" text, "Set 3" text, "Total" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date was the Set 3 of 12 25?
SELECT "Date" FROM table_45191 WHERE "Set 3" = '12–25'
wikisql
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 intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-12480')) AND intakeoutput.cellpath LIKE '%output%' AND S...
eicu
CREATE TABLE table_69629 ( "Competition" text, "Started Round" text, "Final Position" text, "Final Round" text, "First Match" text, "Last Match" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date was the first match for the competition ...
SELECT "First Match" FROM table_69629 WHERE "Last Match" = 'december 16, 2007'
wikisql
CREATE TABLE table_61908 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What place is the player with score of 70-68-70=208 from?
SELECT "Place" FROM table_61908 WHERE "Score" = '70-68-70=208'
wikisql
CREATE TABLE bank ( city VARCHAR, state VARCHAR, bname VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the city and state of the bank branch named morningside.
SELECT city, state FROM bank WHERE bname = 'morningside'
sql_create_context
CREATE TABLE table_1341707_12 ( district VARCHAR, first_elected VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Phillip Landrum was first elected in 1952 from the ninth district of Georgia.
SELECT district FROM table_1341707_12 WHERE first_elected = 1952
sql_create_context
CREATE TABLE table_53906 ( "State" text, "Interview" real, "Swimsuit" real, "Evening gown" real, "Average" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the highest average for the contestant having an interview score of 8.46?
SELECT MAX("Average") FROM table_53906 WHERE "Interview" = '8.46'
wikisql
CREATE TABLE table_64503 ( "Track" text, "Song Title" text, "Writer(s)" text, "Original Artist" text, "Original Release" real, "Length" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Song has a Length of 2:50?
SELECT "Song Title" FROM table_64503 WHERE "Length" = '2:50'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( ...
SELECT AVG(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-77873')) AND lab.labname = 'reticulocyte count' AND DATETIME(lab.labresulttime...
eicu
CREATE TABLE table_name_39 ( home_team VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the home team when Hawthorn was the away team?
SELECT home_team FROM table_name_39 WHERE away_team = "hawthorn"
sql_create_context
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 SUM(t_kc24.OVE_PAY) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '范翔飞' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2000-06-23' AND '2012-10-12' UNION SELECT SUM(t_kc24.OVE_PAY) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE fgwyjzb.PERSON...
css
CREATE TABLE table_11748792_2 ( series VARCHAR, sunday VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List all of the shows with Alice Levine Jamie East is the Sunday presenter.
SELECT series FROM table_11748792_2 WHERE sunday = "Alice Levine Jamie East"
sql_create_context
CREATE TABLE table_26534 ( "World record" text, "Kenenisa Bekele ( ETH )" text, "12:37.35" text, "Hengelo , Netherlands" text, "31 May 2004" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is 31 may 2004 when 12:37.35 is 13:19.43?
SELECT "31 May 2004" FROM table_26534 WHERE "12:37.35" = '13:19.43'
wikisql
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT PER_SOL FROM t_kc24 WHERE MED_CLINIC_ID = '87151223672'
css
CREATE TABLE table_name_61 ( year_s__withdrawn VARCHAR, wheel_arrangement VARCHAR, year_made VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was the 4-6-0 Wheel model train from 1908 withdrawn?
SELECT year_s__withdrawn FROM table_name_61 WHERE wheel_arrangement = "4-6-0" AND year_made = "1908"
sql_create_context