instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE ship ( Ship_ID int, Name text, Type text, Nationality text, Tonnage int ) CREATE TABLE mission ( Mission_ID int, Ship_ID int, Code text, Launched_Year int, Location text, Speed_knots int, Fate text ) -- Using valid SQLite, answer the following questions fo...
SELECT Type, COUNT(Type) FROM ship GROUP BY Type ORDER BY COUNT(Type) DESC
nvbench
CREATE TABLE table_67283 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the loss of the game when the record was 16 15?
SELECT "Loss" FROM table_67283 WHERE "Record" = '16–15'
wikisql
CREATE TABLE table_name_10 ( competition VARCHAR, year VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the competitions that occurred before 2006 in SVK Nitra?
SELECT competition FROM table_name_10 WHERE year < 2006 AND venue = "svk nitra"
sql_create_context
CREATE TABLE table_28936 ( "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. -- When was the incumbent from the Virginia 10 district first elected?
SELECT "First elected" FROM table_28936 WHERE "District" = 'Virginia 10'
wikisql
CREATE TABLE table_204_602 ( id number, "name" text, "position" text, "height" text, "weight" number, "date of birth" text, "current/last known team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which all time player is after derek cockrof...
SELECT "name" FROM table_204_602 WHERE id = (SELECT id FROM table_204_602 WHERE "name" = 'derek cockroft') + 1
squall
CREATE TABLE table_28323 ( "Series No." real, "Episode No." real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who wrote the episode t...
SELECT "Written by" FROM table_28323 WHERE "U.S. viewers (millions)" = '1.08'
wikisql
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, ...
SELECT COUNT(*) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'anticardiolipin antibody igg') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 378 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admit...
mimic_iii
CREATE TABLE table_203_656 ( id number, "date" text, "opponent" text, "venue" text, "result" text, "scorers" text, "report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- the team that last played on may 17th ,2009
SELECT "opponent" FROM table_203_656 WHERE "date" = 'may 17, 2009 - 15:00'
squall
CREATE TABLE table_17673 ( "Year" text, "Division" real, "League" text, "Regular Season" text, "Playoffs" text, "Open Cup" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the open cup results in 2004?
SELECT "Open Cup" FROM table_17673 WHERE "Year" = '2004'
wikisql
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT zyjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '范寒雁' AND NOT zyjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2016-12-24')
css
CREATE TABLE table_name_2 ( population__2011_ VARCHAR, area__km²_ VARCHAR, change___percentage_ VARCHAR, population__2006_ VARCHAR, population_density VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Population (2011) when the Populati...
SELECT COUNT(population__2011_) FROM table_name_2 WHERE population__2006_ < 7083 AND population_density < 342.8 AND change___percentage_ = 5 AND area__km²_ > 4.5
sql_create_context
CREATE TABLE table_name_16 ( championship VARCHAR, score_in_the_final VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Championship has a Score in the final of 2 6, 6 2, 7 5?
SELECT championship FROM table_name_16 WHERE score_in_the_final = "2–6, 6–2, 7–5"
sql_create_context
CREATE TABLE table_2102898_1 ( viewers__in_millions_ VARCHAR, broadcast_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On broadcast date is 28march1970, how many people tuned in?
SELECT viewers__in_millions_ FROM table_2102898_1 WHERE broadcast_date = "28March1970"
sql_create_context
CREATE TABLE employees ( first_name VARCHAR, last_name VARCHAR, hire_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List top 10 employee work longest in the company. List employee's first and last name.
SELECT first_name, last_name FROM employees ORDER BY hire_date LIMIT 10
sql_create_context
CREATE TABLE table_12715053_1 ( compound_name VARCHAR, marine_organism_α VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the compound name listed where marine organism is worm
SELECT compound_name FROM table_12715053_1 WHERE marine_organism_α = "Worm"
sql_create_context
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE cost ( row_id number, subject_id number, hadm...
SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 22897) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND chartevents...
mimic_iii
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 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.long_title = "Electrolyte and fluid disorders not elsewhere classified" AND prescriptions.route = "SL"
mimicsql_data
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiolo...
SELECT labevents.charttime FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'oxygen saturation') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 62983) AND DATETIME(labevents.charttime) <= DATETIME(CURRENT_TIME(...
mimic_iii
CREATE TABLE table_46739 ( "Letter" text, "IPv6 address" text, "AS-number" text, "Operator" text, "Location #sites (global/local)" text, "Software" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which letter has an operator of VeriSign and an AS...
SELECT "Letter" FROM table_46739 WHERE "Operator" = 'verisign' AND "AS-number" = 'as26415'
wikisql
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", U.Id AS "user_link", U.Age, U.Location, U.Reputation, U.UpVotes, U.DownVotes FROM Users AS U WHERE U.Id IN (SELECT DISTINCT U.Id FROM Users AS U INNER JOIN Posts AS P ON U.Id = P.OwnerUserId INNER JOIN PostTags AS PT ON PT.PostId = P.Id INNER JOIN Tags AS T ON...
sede
CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE time_zone ( time_zone_cod...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND date_day.day_number = 7 AND date_day.month_number = 1...
atis
CREATE TABLE table_name_90 ( authors VARCHAR, name VARCHAR, novelty VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Authors, when Novelty is Gen Nov, when Location is South Africa, and when Name is Criocephalosaurus?
SELECT authors FROM table_name_90 WHERE novelty = "gen nov" AND location = "south africa" AND name = "criocephalosaurus"
sql_create_context
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CRE...
SELECT MAX(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-7771')) AND intakeoutput.celllabel = 'analge...
eicu
CREATE TABLE table_204_117 ( id number, "season" number, "level" text, "division" text, "section" text, "position" text, "movements" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- in total , how many times were they promoted ?
SELECT COUNT(*) FROM table_204_117 WHERE "movements" = 'promoted'
squall
CREATE TABLE table_name_21 ( laps INTEGER, start VARCHAR, qual VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the average number of Laps, that had a start of 25, with a Qual of 138.063?
SELECT AVG(laps) FROM table_name_21 WHERE start = "25" AND qual = "138.063"
sql_create_context
CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Date_of_Birth text ) CREATE TABLE entrepreneur ( Entrepreneur_ID int, People_ID int, Company text, Money_Requested real, Investor text ) -- Using valid SQLite, answer the following questions for the tabl...
SELECT Date_of_Birth, COUNT(Date_of_Birth) FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor = "Simon Woodroffe" OR T1.Investor = "Peter Jones" ORDER BY COUNT(Date_of_Birth)
nvbench
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 ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ...
SELECT demographic.days_stay, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "7578"
mimicsql_data
CREATE TABLE table_79419 ( "Time" text, "Wind" text, "Athlete" text, "Nationality" text, "Location of race" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the wind when the time was 19.32?
SELECT "Wind" FROM table_79419 WHERE "Time" = '19.32'
wikisql
CREATE TABLE entrepreneur ( entrepreneur_id number, people_id number, company text, money_requested number, investor text ) CREATE TABLE people ( people_id number, name text, height number, weight number, date_of_birth text ) -- Using valid SQLite, answer the following questio...
SELECT T2.weight FROM entrepreneur AS T1 JOIN people AS T2 ON T1.people_id = T2.people_id ORDER BY T1.money_requested DESC
spider
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJG...
css
CREATE TABLE table_2508633_9 ( nfl_team VARCHAR, college VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What NFL team picked a player from Jackson State?
SELECT nfl_team FROM table_2508633_9 WHERE college = "Jackson State"
sql_create_context
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, ...
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 99747) AND prescriptions.drug IN ('calcium gluconate', 'labetalol', 'meropenem') AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-50 month')
mimic_iii
CREATE TABLE table_name_31 ( district VARCHAR, first_elected VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which District has a First Elected of 1904 and an Incumbent of Duncan E. Mckinlay?
SELECT district FROM table_name_31 WHERE first_elected = 1904 AND incumbent = "duncan e. mckinlay"
sql_create_context
CREATE TABLE table_65530 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Silver has a Total of 1, and a Rank of 12?
SELECT MIN("Silver") FROM table_65530 WHERE "Total" = '1' AND "Rank" = '12'
wikisql
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2166" AND procedures.long_title = "Arterial catheterization"
mimicsql_data
CREATE TABLE table_19823 ( "States" text, "Fall 05" real, "Fall 06" real, "Fall 07" real, "Fall 08" real, "Fall 09" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of students in Fall 09 from the state that had 3940 in Fall 07?...
SELECT MAX("Fall 09") FROM table_19823 WHERE "Fall 07" = '3940'
wikisql
CREATE TABLE table_name_40 ( fastest_time__s_ VARCHAR, athlete VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the fastest time for athlete Jason Smyth?
SELECT fastest_time__s_ FROM table_name_40 WHERE athlete = "jason smyth"
sql_create_context
CREATE TABLE table_43847 ( "English" text, "three" text, "four" text, "person" text, "house" text, "coconut" text, "what" text, "fire" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the language, when 'house' is 'balay', when 'th...
SELECT "English" FROM table_43847 WHERE "house" = 'balay' AND "three" = 'tatlo' AND "four" = 'apat'
wikisql
CREATE TABLE Accounts ( Account_ID INTEGER, Statement_ID INTEGER, Account_Details VARCHAR(255) ) CREATE TABLE Ref_Budget_Codes ( Budget_Type_Code CHAR(15), Budget_Type_Description VARCHAR(255) ) CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255),...
SELECT Budget_Type_Code, COUNT(*) FROM Documents_with_Expenses GROUP BY Budget_Type_Code ORDER BY Budget_Type_Code
nvbench
CREATE TABLE table_203_498 ( id number, "first issued" text, "design" text, "slogan" text, "serial format" text, "serials issued" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the design on the first issued plates ?
SELECT "design" FROM table_203_498 ORDER BY "first issued" LIMIT 1
squall
CREATE TABLE table_62013 ( "Outcome" text, "Edition" real, "Round" text, "Opponent Team" text, "Surface" text, "Opponent" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Opponent, when Round is World Group?
SELECT "Opponent" FROM table_62013 WHERE "Round" = 'world group'
wikisql
CREATE TABLE table_name_98 ( position VARCHAR, series VARCHAR, season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the value for Position, when the Series is the Macau Grand Prix, and when the Season is before 2007?
SELECT position FROM table_name_98 WHERE series = "macau grand prix" AND season < 2007
sql_create_context
CREATE TABLE table_53010 ( "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 is the Away team score with north melbourne...
SELECT "Away team score" FROM table_53010 WHERE "Home team" = 'north melbourne'
wikisql
CREATE TABLE Suppliers ( supplier_id INTEGER, supplier_name VARCHAR(80), supplier_phone VARCHAR(80) ) CREATE TABLE Order_Items ( order_item_id INTEGER, order_id INTEGER, product_id INTEGER ) CREATE TABLE Customer_Addresses ( customer_id INTEGER, address_id INTEGER, date_from DATETI...
SELECT product_type_code, MIN(product_price) FROM Products GROUP BY product_type_code
nvbench
CREATE TABLE products ( product_name VARCHAR, product_type_code VARCHAR, product_price VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the name of the most expensive hardware product.
SELECT product_name FROM products WHERE product_type_code = 'Hardware' ORDER BY product_price DESC LIMIT 1
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
SELECT microlab.organism FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-1337')) AND microlab.culturesite = 'sputum, expectorated' AND DATETIM...
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SNF" AND demographic.diagnosis = "HYPERGLYCEMIA"
mimicsql_data
CREATE TABLE table_72456 ( "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_72456 WHERE "Team" = 'San Antonio'
wikisql
CREATE TABLE table_50761 ( "Rank" real, "City" text, "Population" text, "Definition" text, "Country" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What rank has a population of 4839400?
SELECT MIN("Rank") FROM table_50761 WHERE "Population" = '4839400'
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 outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime ...
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 24971 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND prescriptions.drug IN ('warfarin', 'albuterol mdi', 'glucagon')
mimic_iii
CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE state ( state_code text, state...
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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADE...
atis
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 text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2183.0" AND lab.itemid = "51351"
mimicsql_data
CREATE TABLE table_name_11 ( draws INTEGER, club VARCHAR, wins VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average number of draws for Mortlake club when they have less than 0 wins?
SELECT AVG(draws) FROM table_name_11 WHERE club = "mortlake" AND wins < 0
sql_create_context
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDat...
SELECT Users.DisplayName, COUNT(*) AS UpVotes FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId INNER JOIN Votes ON Votes.PostId = Posts.Id AND VoteTypeId = 2 INNER JOIN Users ON Users.Id = Posts.OwnerUserId WHERE Tags.Id = 34113 AND Posts.CreationDate > '201...
sede
CREATE TABLE table_78049 ( "Stage" text, "Winner" text, "General classification" text, "Points classification" text, "Trofeo Fast Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the points classification in stage 1?
SELECT "Points classification" FROM table_78049 WHERE "Stage" = '1'
wikisql
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 JYKSBM, JYKSMC FROM jybgb WHERE JZLSH = '36725122883'
css
CREATE TABLE table_66668 ( "Rank" real, "Rowers" text, "Country" text, "Time" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Time of the Rowers from Belgium?
SELECT "Time" FROM table_66668 WHERE "Country" = 'belgium'
wikisql
CREATE TABLE ftxmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZD...
SELECT COUNT(*) FROM txmzjzjlb WHERE txmzjzjlb.ZZYSGH = '62380761' AND txmzjzjlb.JZKSRQ BETWEEN '2014-01-24' AND '2020-12-29' UNION SELECT COUNT(*) FROM ftxmzjzjlb WHERE ftxmzjzjlb.ZZYSGH = '62380761' AND ftxmzjzjlb.JZKSRQ BETWEEN '2014-01-24' AND '2020-12-29'
css
CREATE TABLE table_4089 ( "Track no." real, "Track" text, "Original Artist" text, "Soloist(s)" text, "Vocal Percussionist" text, "Arranger(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the track whent the vocal percussionist is unkn...
SELECT "Track" FROM table_4089 WHERE "Vocal Percussionist" = 'unknown'
wikisql
CREATE TABLE table_6404 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Stadium" text, "Record" text, "Channel" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What stadium was the game held at on December ...
SELECT "Stadium" FROM table_6404 WHERE "Date" = 'december 23, 2001'
wikisql
CREATE TABLE table_10599 ( "Week" text, "Date" text, "Opponent" text, "Result" text, "Kickoff [a ]" text, "Game site" text, "Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the opponent that had a result...
SELECT "Opponent" FROM table_10599 WHERE "Result" = 'l 27-20'
wikisql
CREATE TABLE table_27914 ( "Settlement" text, "Cyrillic Name Other Names" text, "Type" text, "Population (2011)" real, "Largest ethnic group (2002)" text, "Dominant religion (2002)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What type of set...
SELECT "Type" FROM table_27914 WHERE "Cyrillic Name Other Names" = 'Футог'
wikisql
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "ASIAN" AND procedures.long_title = "Colonoscopy"
mimicsql_data
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 qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '07587349' AND t_kc22.STA_DATE BETWEEN '2006-09-09' AND '2013-09-24' AND t_kc22.SOC_SRT_DIRE_CD = '7589' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.PERSON_ID = '07...
css
CREATE TABLE table_5449 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Save" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much was the loss of April 25?
SELECT "Loss" FROM table_5449 WHERE "Date" = 'april 25'
wikisql
CREATE TABLE table_train_167 ( "id" int, "alt" float, "body_weight" float, "ast" float, "hematocrit_hct" float, "thyroid_stimulating_hormone_stsh" int, "body_mass_index_bmi" float, "fasting_glucose" int, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the ...
SELECT * FROM table_train_167 WHERE fasting_glucose >= 100 AND fasting_glucose <= 160
criteria2sql
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
SELECT * FROM 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_23395 ( "No. in series" text, "No. in season" real, "Family/families" text, "Location(s)" text, "Original air date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What family was featured in episode us14 of the series?
SELECT "Family/families" FROM table_23395 WHERE "No. in series" = 'US14'
wikisql
CREATE TABLE table_17656 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Total viewers (in millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who wrote the title that...
SELECT "Written by" FROM table_17656 WHERE "Total viewers (in millions)" = '1.211'
wikisql
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) 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, t...
SELECT DISTINCT course.department, course.name, course.number, instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.name LIKE '%Media Institutions%' AND NOT instructor.name LIKE '%Lombard%' AND offering_instructor.instructor_id = ins...
advising
CREATE TABLE table_1277350_1 ( thursday_iuppiter__jupiter_ VARCHAR, friday_venus__venus_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the thursday iuppiter (jupiter) with friday venus (venus) being vendredi
SELECT thursday_iuppiter__jupiter_ FROM table_1277350_1 WHERE friday_venus__venus_ = "vendredi"
sql_create_context
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT * FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '2646735' AND gwyjzb.IN_HOSP_DATE BETWEEN '2003-09-28' AND '2008-10-10' AND gwyjzb.PERSON_NM LIKE '冯%' UNION SELECT * FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '2646735' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2003-09-28' AND '2008-10-10' AND fgwyjzb.PERSON_NM LIKE '冯%'
css
CREATE TABLE table_69118 ( "Name" text, "Years" text, "Gender" text, "Area" text, "Authority" text, "Decile" real, "Roll" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest roll number of the school in Te puna with a decile l...
SELECT MAX("Roll") FROM table_69118 WHERE "Decile" > '2' AND "Area" = 'te puna'
wikisql
CREATE TABLE t_kc21 ( 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 t_kc21.MED_ORG_DEPT_NM, t_kc21.IN_DIAG_DIS_NM, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '9841208' GROUP BY t_kc21.MED_ORG_DEPT_NM, t_kc21.IN_DIAG_DIS_NM
css
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeri...
SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-5001')) AND intakeoutput.celllabel = 'urine'...
eicu
CREATE TABLE table_33552 ( "Round" real, "Overall" real, "Player" text, "Position" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was Cal State-Los Angeles' position with an Overall above 22?
SELECT "Position" FROM table_33552 WHERE "Overall" > '22' AND "School/Club Team" = 'cal state-los angeles'
wikisql
CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABL...
SELECT DISTINCT course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday, semester.semester, semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND c...
advising
CREATE TABLE table_14058433_3 ( losing_bonus VARCHAR, club VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many losing points does Llandudno RFC have?
SELECT losing_bonus FROM table_14058433_3 WHERE club = "Llandudno RFC"
sql_create_context
CREATE TABLE table_204_650 ( id number, "season" number, "level" number, "name" text, "position" text, "nationality" text, "international\ncaps" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- name someone else from scotland inducted before...
SELECT "name" FROM table_204_650 WHERE "nationality" = 'scotland' AND "season" < (SELECT "season" FROM table_204_650 WHERE "name" = 'alan brazil')
squall
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2112" AND lab.label = "RBC, Joint Fluid"
mimicsql_data
CREATE TABLE table_name_14 ( competition VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the name of the competition that took place on may 31, 2008?
SELECT competition FROM table_name_14 WHERE date = "may 31, 2008"
sql_create_context
CREATE TABLE table_name_22 ( season VARCHAR, promoted VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What season was Norwich Union League promoted?
SELECT season FROM table_name_22 WHERE promoted = "norwich union league"
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 JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY AVG(DEPARTMENT_ID)
nvbench
CREATE TABLE table_23969 ( "Round" real, "Choice" real, "Player" text, "Position" text, "Height" text, "Weight" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the choice score of the player who weights 303lb (137kg)?
SELECT MIN("Choice") FROM table_23969 WHERE "Weight" = '303lb (137kg)'
wikisql
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int...
SELECT DISTINCT advisory_requirement FROM course WHERE department = 'AT' AND number = 403
advising
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT ACC_Percent, All_Games_Percent FROM basketball_match GROUP BY ACC_Regular_Season
nvbench
CREATE TABLE table_36178 ( "Week" real, "Date" text, "Opponent" text, "Location" text, "Time ( ET )" text, "Result" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Date of sun. oct. 1 has what location?
SELECT "Location" FROM table_36178 WHERE "Date" = 'sun. oct. 1'
wikisql
CREATE TABLE table_1610496_3 ( gdp_per_capita_nominal__ INTEGER, population__millions_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the nominal GDP per capita when the population is 63.056 million?
SELECT MIN(gdp_per_capita_nominal__) AS $_ FROM table_1610496_3 WHERE population__millions_ = "63.056"
sql_create_context
CREATE TABLE table_1507423_4 ( team_s_ VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many teams had a 76th position finish?
SELECT COUNT(team_s_) FROM table_1507423_4 WHERE position = "76th"
sql_create_context
CREATE TABLE EMPLOYEE ( EMP_NUM int, EMP_LNAME varchar(15), EMP_FNAME varchar(12), EMP_INITIAL varchar(1), EMP_JOBCODE varchar(5), EMP_HIREDATE datetime, EMP_DOB datetime ) CREATE TABLE STUDENT ( STU_NUM int, STU_LNAME varchar(15), STU_FNAME varchar(15), STU_INIT varchar(1),...
SELECT CRS_CODE, COUNT(*) FROM CLASS GROUP BY CRS_CODE ORDER BY COUNT(*)
nvbench
CREATE TABLE table_32953 ( "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 attendance at the Kardinia Park gam...
SELECT "Crowd" FROM table_32953 WHERE "Venue" = 'kardinia park'
wikisql
CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE cite ( citingpaperid int, ...
SELECT DISTINCT COUNT(cite.citedpaperid) FROM author, cite, paper, writes WHERE author.authorname = 'michael i. jordan' AND paper.paperid = cite.citedpaperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
scholar
CREATE TABLE table_34348 ( "Date" text, "Tournament" text, "Location" text, "Winner" text, "Score" text, "1st prize ( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the winner of the tour championship tournament?
SELECT "Winner" FROM table_34348 WHERE "Tournament" = 'the tour championship'
wikisql
CREATE TABLE management ( department_ID int, head_ID int, temporary_acting text ) CREATE TABLE department ( Department_ID int, Name text, Creation text, Ranking int, Budget_in_Billions real, Num_Employees real ) CREATE TABLE head ( head_ID int, name text, born_state tex...
SELECT Creation, COUNT(Creation) FROM department ORDER BY Creation
nvbench
CREATE TABLE table_204_651 ( id number, "date" text, "championship" text, "location" text, "category" text, "surface" text, "prev. result" text, "prev. points" number, "new points" number, "outcome" text ) -- Using valid SQLite, answer the following questions for the tables pro...
SELECT COUNT("date") FROM table_204_651 WHERE "prev. points" >= 100
squall
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABL...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', labevents.charttime)) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'creatinine') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 81461 AND admissi...
mimic_iii
CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ...
SELECT DISTINCT writes.paperid FROM author, writes WHERE author.authorname = 'Dan Suciu' AND writes.authorid = author.authorid
scholar
CREATE TABLE table_17120964_6 ( venue VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On the 19th, where was the venue?
SELECT venue FROM table_17120964_6 WHERE date = "19th"
sql_create_context
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, ...
SELECT t2.drug FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 65582 AND procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = ...
mimic_iii
CREATE TABLE table_name_75 ( average_attendance VARCHAR, total_attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the average attendance of the league with a total attendance of 2268508?
SELECT average_attendance FROM table_name_75 WHERE total_attendance = "2268508"
sql_create_context