instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "NEWBORN" AND prescriptions.drug_type = "MAIN"
mimicsql_data
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text...
SELECT * FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE hz_info.RYBH = '19146116' AND jyjgzbb.jybgb_BBCJBW = '上肢' UNION SELECT * FR...
css
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id numbe...
SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'nodular lymphoma mult') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20589 AND NOT admissions.discht...
mimic_iii
CREATE TABLE table_70318 ( "Date" text, "Opponent" text, "Home/Away" text, "Field" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the result of games played at frontier field
SELECT "Result" FROM table_70318 WHERE "Field" = 'frontier field'
wikisql
CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text, ZYLBDM text, ZYMC text ) CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH ...
SELECT * FROM jyjgzbb WHERE JCZBMC = (SELECT JCZBMC FROM jyjgzbb WHERE JYZBLSH = '10460681309') AND JCZBJGDW = (SELECT JCZBJGDW FROM jyjgzbb WHERE JYZBLSH = '10460681309') AND JCZBJGDL >= (SELECT JCZBJGDL FROM jyjgzbb WHERE JYZBLSH = '10460681309')
css
CREATE TABLE table_22118197_1 ( portuguese_title VARCHAR, english_title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Portuguese name of the film who's English title is, Belle Toujours?
SELECT portuguese_title FROM table_22118197_1 WHERE english_title = "Belle Toujours"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND demographic.diagnosis = "POSTERIOR COMMUNICATING ANEURYSM/SDA"
mimicsql_data
CREATE TABLE table_name_20 ( name VARCHAR, country VARCHAR, transfer_fee VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name when the country is ESP and the transfer fee is 7m?
SELECT name FROM table_name_20 WHERE country = "esp" AND transfer_fee = "€ 7m"
sql_create_context
CREATE TABLE table_12784 ( "Flight Day" text, "Song" text, "Artist" text, "Played for" text, "Links" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Rush song was played for Mike Fincke?
SELECT "Song" FROM table_12784 WHERE "Played for" = 'mike fincke' AND "Artist" = 'rush'
wikisql
CREATE TABLE table_204_28 ( id number, "election" text, "name of the party/alliance" text, "number of votes" number, "percentage" text, "seats in the parliament" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- name the election that only had 9,...
SELECT "election" FROM table_204_28 WHERE "number of votes" = 9046
squall
CREATE TABLE table_29787 ( "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. -- How ma...
SELECT COUNT("Game") FROM table_29787 WHERE "Date" = 'March 12'
wikisql
CREATE TABLE table_74259 ( "Year" real, "Round" real, "Winner" text, "Hawthorn score" text, "St Kilda score" text, "Attendance" real, "Venue" text, "Silk-Miller Medallist" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the hawtho...
SELECT "Hawthorn score" FROM table_74259 WHERE "Year" = '2000'
wikisql
CREATE TABLE table_59796 ( "Season" text, "League" text, "Teams" text, "Home" text, "Away" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the home for season 1949-50?
SELECT "Home" FROM table_59796 WHERE "Season" = '1949-50'
wikisql
CREATE TABLE table_37493 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What record has a decision of parent, Philadelphia as the home, wi...
SELECT "Record" FROM table_37493 WHERE "Decision" = 'parent' AND "Home" = 'philadelphia' AND "Date" = 'december 12'
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.marital_status = "WIDOWED" AND prescriptions.route = "REPLACE"
mimicsql_data
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAno...
SELECT COUNT(*) AS QuestionCount FROM Posts AS p JOIN PostTags AS t ON p.Id = t.PostId WHERE t.TagId = (SELECT Id FROM Tags WHERE TagName = @Tag) AND p.PostTypeId = 1 AND LastActivityDate > '2019-01-01'
sede
CREATE TABLE table_name_29 ( game_site VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is the game site for the game that had a packers record of 2-3?
SELECT game_site FROM table_name_29 WHERE record = "2-3"
sql_create_context
CREATE TABLE table_12962773_13 ( no VARCHAR, height VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number that has a height of 2.06?
SELECT COUNT(no) FROM table_12962773_13 WHERE height = "2.06"
sql_create_context
CREATE TABLE table_60899 ( "Stage" text, "Route" text, "Distance" text, "Date" text, "Winner" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the distance of the race on saturday, august 23?
SELECT "Distance" FROM table_60899 WHERE "Date" = 'saturday, august 23'
wikisql
CREATE TABLE table_63579 ( "Location" text, "Name of mill" text, "Type" text, "Built" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the Notes of the Mill Built in the 19th Century?
SELECT "Notes" FROM table_63579 WHERE "Built" = '19th century'
wikisql
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, ...
SELECT DISTINCT description, name FROM course WHERE department = 'EDUC' AND number = 401
advising
CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text, ZYLBDM text, ZYMC text ) CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGD...
SELECT JCXMMC, JCZBDM, JCZBMC, JCFF FROM jyjgzbb WHERE JYZBLSH = '70863313952'
css
CREATE TABLE table_68229 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which opponent has a date of July 7?
SELECT "Opponent" FROM table_68229 WHERE "Date" = 'july 7'
wikisql
CREATE TABLE table_10332 ( "Outcome" text, "Date" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Partner with the surface of Clay ended up as a runner-up with a score of 1 6, ...
SELECT "Partner" FROM table_10332 WHERE "Surface" = 'clay' AND "Outcome" = 'runner-up' AND "Score" = '1–6, 6–4, [10–12]'
wikisql
CREATE TABLE table_15796054_3 ( week__number VARCHAR, theme VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the week number for andrew lloyd webber
SELECT week__number FROM table_15796054_3 WHERE theme = "Andrew Lloyd Webber"
sql_create_context
CREATE TABLE Claim_Headers ( Claim_Header_ID INTEGER, Claim_Status_Code CHAR(15), Claim_Type_Code CHAR(15), Policy_ID INTEGER, Date_of_Claim DATETIME, Date_of_Settlement DATETIME, Amount_Claimed DECIMAL(20,4), Amount_Piad DECIMAL(20,4) ) CREATE TABLE Claims_Processing ( Claim_Proces...
SELECT Policy_Type_Code, COUNT(*) FROM Policies GROUP BY Policy_Type_Code ORDER BY Policy_Type_Code DESC
nvbench
CREATE TABLE table_30743 ( "IOC Code" text, "Country" text, "Network Station" text, "Television Station" text, "Radio Station" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the ioc code when the country is listed as Singapore?
SELECT "IOC Code" FROM table_30743 WHERE "Country" = 'Singapore'
wikisql
CREATE TABLE table_name_98 ( doctor VARCHAR, format VARCHAR, title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Doctor, when Format is CD, and when Title is The Relics Of Time?
SELECT doctor FROM table_name_98 WHERE format = "cd" AND title = "the relics of time"
sql_create_context
CREATE TABLE table_name_75 ( points VARCHAR, grid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many points when the Grid was 1?
SELECT points FROM table_name_75 WHERE grid = "1"
sql_create_context
CREATE TABLE customer ( cust_ID varchar(3), cust_name varchar(20), acc_type char(1), acc_bal int, no_of_loans int, credit_score int, branch_ID int, state varchar(20) ) CREATE TABLE bank ( branch_ID int, bname varchar(20), no_of_customers int, city varchar(10), state ...
SELECT acc_type, AVG(acc_bal) FROM customer WHERE credit_score < 50 GROUP BY acc_type ORDER BY acc_type DESC
nvbench
CREATE TABLE table_68860 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the record on July 2?
SELECT "Record" FROM table_68860 WHERE "Date" = 'july 2'
wikisql
CREATE TABLE table_13141 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What did Sam Torrance score?
SELECT "Score" FROM table_13141 WHERE "Player" = 'sam torrance'
wikisql
CREATE TABLE table_name_31 ( reserved_for___sc___st__none_ VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Reserved for (SC / ST /None) with a Name of goverdhan?
SELECT reserved_for___sc___st__none_ FROM table_name_31 WHERE name = "goverdhan"
sql_create_context
CREATE TABLE instructor ( name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List in alphabetic order the names of all distinct instructors.
SELECT DISTINCT name FROM instructor ORDER BY name
sql_create_context
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE ...
SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number BETWEEN 200 AND 200 + 100 AND semester.semester IN ('SP', 'SS', 'SU') AND semester.semester_id = cou...
advising
CREATE TABLE table_28298471_14 ( stage VARCHAR, winner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- when svein tuft is the winner how many stages are there?
SELECT COUNT(stage) FROM table_28298471_14 WHERE winner = "Svein Tuft"
sql_create_context
CREATE TABLE album ( albumid number, title text, artistid number ) CREATE TABLE invoice ( invoiceid number, customerid number, invoicedate time, billingaddress text, billingcity text, billingstate text, billingcountry text, billingpostalcode text, total number ) CREATE ...
SELECT firstname, lastname FROM customer WHERE email = "luisg@embraer.com.br"
spider
CREATE TABLE domain ( did int, name varchar ) CREATE TABLE cite ( cited int, citing int ) CREATE TABLE organization ( continent varchar, homepage varchar, name varchar, oid int ) CREATE TABLE publication_keyword ( kid int, pid int ) CREATE TABLE domain_journal ( did int, ...
SELECT COUNT(DISTINCT (name)) FROM organization
academic
CREATE TABLE Faculty_Participates_in ( FacID INTEGER, actid INTEGER ) CREATE TABLE Faculty ( FacID INTEGER, Lname VARCHAR(15), Fname VARCHAR(15), Rank VARCHAR(15), Sex VARCHAR(1), Phone INTEGER, Room VARCHAR(5), Building VARCHAR(13) ) CREATE TABLE Activity ( actid INTEGER, ...
SELECT Rank, COUNT(*) FROM Faculty GROUP BY Rank ORDER BY Rank DESC
nvbench
CREATE TABLE church ( Church_ID int, Name text, Organized_by text, Open_Date int, Continuation_of text ) CREATE TABLE wedding ( Church_ID int, Male_ID int, Female_ID int, Year int ) CREATE TABLE people ( People_ID int, Name text, Country text, Is_Male text, Age ...
SELECT Country, COUNT(Country) FROM people WHERE Age < (SELECT AVG(Age) FROM people) GROUP BY Country ORDER BY COUNT(Country) DESC
nvbench
CREATE TABLE table_33682 ( "Network" text, "Origin of Programming" text, "Language" text, "Genre" text, "Service" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What language does the Ary Digital network broadcast in?
SELECT "Language" FROM table_33682 WHERE "Network" = 'ary digital'
wikisql
CREATE TABLE table_22201 ( "HD designation" text, "Constellation" text, "Distance ( ly )" text, "Spectral type" text, "Signal power ( kW )" real, "Date sent" text, "Arrival date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the constell...
SELECT "Spectral type" FROM table_22201 WHERE "Constellation" = 'Gemini'
wikisql
CREATE TABLE table_62864 ( "Model" text, "Years" text, "Engine" text, "Displacement" text, "Power" text, "Fuel system" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What engine with the years of 1975-84 has a model of 1600?
SELECT "Engine" FROM table_62864 WHERE "Model" = '1600' AND "Years" = '1975-84'
wikisql
CREATE TABLE Course_Authors_and_Tutors ( login_name VARCHAR, family_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List all the login names and family names of course author and tutors.
SELECT login_name, family_name FROM Course_Authors_and_Tutors
sql_create_context
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE code_des...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND CITY_2.cit...
atis
CREATE TABLE table_23349 ( "Series #" real, "Season #" real, "Title" text, "Director(s)" text, "Writer(s)" text, "Airdate" text, "Production code" real, "Arties disguises" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the writers f...
SELECT "Writer(s)" FROM table_23349 WHERE "Arties disguises" = 'Swedish sailor'
wikisql
CREATE TABLE table_67523 ( "Driver" text, "Constructor" text, "Laps" text, "Time/Retired" text, "Grid" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many laps were there when the constructor was Renault, and when the Driver was Fernando Alonso?...
SELECT "Laps" FROM table_67523 WHERE "Constructor" = 'renault' AND "Driver" = 'fernando alonso'
wikisql
CREATE TABLE table_name_17 ( episode VARCHAR, share VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Episode has a Share of tba?
SELECT episode FROM table_name_17 WHERE share = "tba"
sql_create_context
CREATE TABLE table_67504 ( "Season" real, "Cars Entered" real, "Winning Driver" text, "Second Driver" text, "Third Driver" text, "Race Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the largest season with a Third Driver of jimmy...
SELECT MAX("Season") FROM table_67504 WHERE "Third Driver" = 'jimmy davies'
wikisql
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 MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '6353775' AND gwyjzb.OUT_DIAG_DIS_CD = 'K30.264' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '6353775' AND fgwyjzb.OUT_D...
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "V502" AND lab."CATEGORY" = "Blood Gas"
mimicsql_data
CREATE TABLE Tryout ( pID numeric(5,0), cName varchar(20), pPos varchar(8), decision varchar(3) ) CREATE TABLE Player ( pID numeric(5,0), pName varchar(20), yCard varchar(3), HS numeric(5,0) ) CREATE TABLE College ( cName varchar(20), state varchar(2), enr numeric(5,0) ) ...
SELECT state, enr FROM College AS T1 JOIN Tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes' ORDER BY enr DESC
nvbench
CREATE TABLE table_2454589_1 ( last_title VARCHAR, first_season_in_current_spell VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the last title for 2012
SELECT last_title FROM table_2454589_1 WHERE first_season_in_current_spell = 2012
sql_create_context
CREATE TABLE table_name_39 ( finished VARCHAR, famous_for VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What place did the celebrity who is famous for being an athlete finish?
SELECT finished FROM table_name_39 WHERE famous_for = "athlete"
sql_create_context
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, war...
SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 6440)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'drai...
mimic_iii
CREATE TABLE table_7548 ( "Team 1" text, "Agg." text, "Team 2" text, "1st leg" text, "2nd leg" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Team 2 with a Team 1 that is milli piyango sk?
SELECT "Team 2" FROM table_7548 WHERE "Team 1" = 'milli piyango sk'
wikisql
CREATE TABLE furniture_manufacte ( Manufacturer_ID int, Furniture_ID int, Price_in_Dollar real ) CREATE TABLE manufacturer ( Manufacturer_ID int, Open_Year real, Name text, Num_of_Factories int, Num_of_Shops int ) CREATE TABLE furniture ( Furniture_ID int, Name text, Num_of...
SELECT Name, Manufacturer_ID FROM manufacturer ORDER BY Open_Year
nvbench
CREATE TABLE table_11264 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- with a record of 68-80 what was the loss?
SELECT "Loss" FROM table_11264 WHERE "Record" = '68-80'
wikisql
CREATE TABLE table_28715942_5 ( track VARCHAR, vocal_percussionist VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the track whent the vocal percussionist is unknown?
SELECT track FROM table_28715942_5 WHERE vocal_percussionist = "unknown"
sql_create_context
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE program_requirement ( program_id int...
SELECT COUNT(*) > 0 FROM course WHERE department = 'EECS' AND has_lab = 'Y' AND number = 502
advising
CREATE TABLE table_25757 ( "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 (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided a...
SELECT "U.S. viewers (millions)" FROM table_25757 WHERE "Production code" = '3AJN01'
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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND prescriptions.drug_type = "ADDITIVE"
mimicsql_data
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description t...
SELECT TIME_TO_STR(CreationDate, '%j'), CAST(SUM(CASE WHEN AnswerCount > 0 THEN 1 ELSE 0 END) AS FLOAT) / COUNT(Posts.Id) AS Ratio FROM Posts WHERE PostTypeId = 1 GROUP BY TIME_TO_STR(CreationDate, '%j') ORDER BY TIME_TO_STR(CreationDate, '%j')
sede
CREATE TABLE files ( f_id number(10), artist_name varchar2(50), file_size varchar2(20), duration varchar2(20), formats varchar2(20) ) CREATE TABLE artist ( artist_name varchar2(50), country varchar2(20), gender varchar2(20), preferred_genre varchar2(50) ) CREATE TABLE song ( so...
SELECT T1.country, T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name GROUP BY T1.country ORDER BY T2.rating DESC LIMIT 3
nvbench
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE chartevents ( ro...
SELECT t1.spec_type_desc FROM (SELECT microbiologyevents.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microbiologyevents WHERE DATETIME(microbiologyevents.charttime) >= DATETIME(CURRENT_TIME(), '-4 year') GROUP BY microbiologyevents.spec_type_desc) AS t1 WHERE t1.c1 <= 4
mimic_iii
CREATE TABLE table_80163 ( "Player" text, "Tries" real, "Goals" real, "Field Goals" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many points did the player with 2 tries and more than 0 field goals have?
SELECT SUM("Points") FROM table_80163 WHERE "Tries" = '2' AND "Field Goals" > '0'
wikisql
CREATE TABLE table_54667 ( "Position" real, "Club" text, "Played" real, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Points" real, "Goal Difference" real ) -- Using valid SQLite, answer the following questions for the tables provided above....
SELECT MAX("Goals against") FROM table_54667 WHERE "Wins" = '18' AND "Goal Difference" = '43' AND "Draws" < '6'
wikisql
CREATE TABLE table_69611 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What visiting team has a record of 9 5 2?
SELECT "Visitor" FROM table_69611 WHERE "Record" = '9–5–2'
wikisql
CREATE TABLE status ( station_id INTEGER, bikes_available INTEGER, docks_available INTEGER, time TEXT ) CREATE TABLE trip ( id INTEGER, duration INTEGER, start_date TEXT, start_station_name TEXT, start_station_id INTEGER, end_date TEXT, end_station_name TEXT, end_station...
SELECT start_station_name, start_station_id FROM trip
nvbench
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), ...
SELECT city_code, COUNT(*) FROM Student GROUP BY city_code ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_30226 ( "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 (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided a...
SELECT "Written by" FROM table_30226 WHERE "Title" = 'The Feet on the Beach'
wikisql
CREATE TABLE table_name_44 ( engine VARCHAR, driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- I want the engine for luigi villoresi
SELECT engine FROM table_name_44 WHERE driver = "luigi villoresi"
sql_create_context
CREATE TABLE table_10134 ( "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 smallest crowd during a game where ...
SELECT MIN("Crowd") FROM table_10134 WHERE "Home team score" = '12.9 (81)'
wikisql
CREATE TABLE table_name_41 ( role VARCHAR, origin VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the role of the aircraft that originates from the European Union?
SELECT role FROM table_name_41 WHERE origin = "european union"
sql_create_context
CREATE TABLE table_10394 ( "Launch Vehicle" text, "Launch date" text, "Institutional authority" text, "Launch site" text, "Results" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the launch date with Institutional authority of ndc and launch...
SELECT "Launch date" FROM table_10394 WHERE "Institutional authority" = 'ndc' AND "Launch Vehicle" = 'hatf-xi'
wikisql
CREATE TABLE table_name_19 ( max_height__ft_ INTEGER, time_to_ft__m__at_55°__seconds_ VARCHAR, m_v_ft_s VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average maximum height of a shell that travels for more than 16.3 seconds at 55 and has a m...
SELECT AVG(max_height__ft_) FROM table_name_19 WHERE time_to_ft__m__at_55°__seconds_ > 16.3 AND m_v_ft_s = 2200
sql_create_context
CREATE TABLE table_60451 ( "Year" text, "Round" real, "Pick" real, "Overall" real, "Position" text, "NFL team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What number was the pick for the position of DT in 1952, after round 1, where the overa...
SELECT "Pick" FROM table_60451 WHERE "Position" = 'dt' AND "Round" > '1' AND "Overall" < '155' AND "Year" = '1952'
wikisql
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 Founder, SUM(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder
nvbench
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
SELECT MED_ORG_DEPT_CD, MED_ORG_DEPT_NM FROM t_kc22 WHERE STA_DATE BETWEEN '2004-01-19' AND '2011-08-13' AND MED_INV_ITEM_TYPE = '手术费' GROUP BY MED_ORG_DEPT_CD ORDER BY COUNT(*) DESC LIMIT 2
css
CREATE TABLE Invoices ( invoice_number INTEGER, order_id INTEGER, invoice_date DATETIME ) CREATE TABLE Financial_Transactions ( transaction_id INTEGER, account_id INTEGER, invoice_number INTEGER, transaction_type VARCHAR(15), transaction_date DATETIME, transaction_amount DECIMAL(19,...
SELECT order_id, COUNT(DISTINCT product_id) FROM Order_Items
nvbench
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, ...
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 40059) AND STRFTIME('%y-%m', prescriptions.startdate) = '2105-10' ORDER BY prescriptions.startdate LIMIT 1
mimic_iii
CREATE TABLE table_68237 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent when the Washington Nationals had a record of 8-4?
SELECT "Opponent" FROM table_68237 WHERE "Record" = '8-4'
wikisql
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE patients ( row_id n...
SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FR...
mimic_iii
CREATE TABLE table_76402 ( "Year" text, "2009" text, "2008" text, "2007" text, "2006" text, "2005" text, "2004" text, "2003" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2007 with ch callaway's copyright in 2003?
SELECT "2007" FROM table_76402 WHERE "2003" = 'ch callaway''s copyright'
wikisql
CREATE TABLE organisation_types ( organisation_type text, organisation_type_description text ) CREATE TABLE documents ( document_id number, document_type_code text, grant_id number, sent_date time, response_received_date time, other_details text ) CREATE TABLE tasks ( task_id numbe...
SELECT date_to FROM project_staff ORDER BY date_to DESC LIMIT 1
spider
CREATE TABLE table_name_77 ( game INTEGER, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the game number when the record is 30-22?
SELECT AVG(game) FROM table_name_77 WHERE record = "30-22"
sql_create_context
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varcha...
SELECT EMPLOYEE_ID, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE author ( authorid int...
SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'Deep Learning' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid
scholar
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "NS"
mimicsql_data
CREATE TABLE jybgb_jyjgzbb ( JYZBLSH number, YLJGDM text, jyjgzbb_id number ) 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 jyjgzbb.SBBM, jyjgzbb.YQBH, jyjgzbb.YQMC FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '49153085887'
css
CREATE TABLE table_10917 ( "Matches" real, "Innings" real, "Not Outs" real, "Runs" real, "Average" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of runs where the average is less than 27.22?
SELECT COUNT("Runs") FROM table_10917 WHERE "Average" < '27.22'
wikisql
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instruc...
SELECT DISTINCT semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'FRENCH' AND course.number = 660 AND semester.semester_id = course_offering.semester ORDER BY semester.year LIMIT 1
advising
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 labevents.charttime FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'potassium') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3516) AND STRFTIME('%y-%m', labevents.charttime) >= '2103-04' ORDER BY lab...
mimic_iii
CREATE TABLE table_16037 ( "Character" text, "1954 Broadway" text, "1955 broadcast" text, "1960 broadcast" text, "1979 Broadway" text, "1990 Broadway" text, "1991 Broadway" text, "1998 Broadway" text, "1999 Broadway" text ) -- Using valid SQLite, answer the following questions for ...
SELECT COUNT("1999 Broadway") FROM table_16037 WHERE "Character" = 'Mrs. Darling'
wikisql
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE labevents ( row_id number, subject_id number, h...
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 2482 AND DATETIME(admissions.admittime) <= DATETIME(CURRENT_TIME(), '-3 year') ORDER BY admissions.admittime DESC LIMIT 1
mimic_iii
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '26537481' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE AMOUNT >= 4534.41)
css
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,...
SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY AVG(EMPLOYEE_ID) DESC
nvbench
CREATE TABLE table_17518 ( "Year" real, "Mens singles" text, "Womens singles" text, "Mens doubles" text, "Womens doubles" text, "Mixed doubles" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the mens doubles when womens doubles is anastas...
SELECT "Mens doubles" FROM table_17518 WHERE "Womens doubles" = 'Anastasia Chervyakova Romina Gabdullina'
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 COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '张修真' AND t_kc22.STA_DATE BETWEEN '2002-01-10' AND '2014-09-10' AND t_kc21.MED_SER_ORG_NO = '7718159' AND t_kc22.MED_INV_ITEM_TYPE = '西药费'
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 mzjzjlb.JZZDBM, mzjzjlb.JZZDSM FROM hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLS...
css