instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_38708 ( "Call sign" text, "Frequency MHz" real, "City of license" text, "ERP W" real, "Class" text, "FCC info" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much Frequency MHz has a Call sign of w264bg?
SELECT COUNT("Frequency MHz") FROM table_38708 WHERE "Call sign" = 'w264bg'
wikisql
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 vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-13899')) AND vitalperiodic.respiration > 7.0 AN...
eicu
CREATE TABLE procedures ( 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Bipol I cur depres NOS" AND lab.fluid = "Ascites"
mimicsql_data
CREATE TABLE table_name_9 ( year VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year saw a score of 8-5?
SELECT year FROM table_name_9 WHERE score = "8-5"
sql_create_context
CREATE TABLE table_name_10 ( attendance INTEGER, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people attended on July 5?
SELECT SUM(attendance) FROM table_name_10 WHERE date = "july 5"
sql_create_context
CREATE TABLE table_name_93 ( constituency VARCHAR, conservative VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What constituency does the Conservative Darren Millar belong to?
SELECT constituency FROM table_name_93 WHERE conservative = "darren millar"
sql_create_context
CREATE TABLE table_2928 ( "Year" real, "Population" real, "Serbs" text, "Germans" text, "Romanians" text, "Hungarians" text, "Croats" text, "Roma" text, "Slovaks" text, "Rest" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What i...
SELECT MIN("Population") FROM table_2928 WHERE "Serbs" = '73.53%'
wikisql
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
SELECT Id AS "post_link", FavoriteCount, CreationDate FROM Posts ORDER BY FavoriteCount DESC LIMIT 500
sede
CREATE TABLE table_name_77 ( cover_model VARCHAR, centerfold_model VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which Cover model has a Centerfold model of jennifer walcott?
SELECT cover_model FROM table_name_77 WHERE centerfold_model = "jennifer walcott"
sql_create_context
CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int )...
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 = 'DALLAS' AND flight.departure_time < 1200 AND flight.to_airport = AIRPORT_SERVICE_1.airpor...
atis
CREATE TABLE table_16168849_1 ( joined VARCHAR, nickname VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the joined for blue hose
SELECT joined FROM table_16168849_1 WHERE nickname = "Blue Hose"
sql_create_context
CREATE TABLE procedures ( 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 lab.fluid FROM lab WHERE lab.subject_id = "6983"
mimicsql_data
CREATE TABLE table_1341453_51 ( incumbent VARCHAR, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who's the incumbent of district Wisconsin 5?
SELECT incumbent FROM table_1341453_51 WHERE district = "Wisconsin 5"
sql_create_context
CREATE TABLE Movie ( mID int, title text, year int, director text ) CREATE TABLE Reviewer ( rID int, name text ) CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What ...
SELECT name, AVG(T1.stars) FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID GROUP BY T2.name ORDER BY name DESC
nvbench
CREATE TABLE table_name_76 ( score INTEGER, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score for Nick Faldo?
SELECT AVG(score) FROM table_name_76 WHERE player = "nick faldo"
sql_create_context
CREATE TABLE Ref_Payment_Methods ( payment_method_code CHAR(10), payment_method_description VARCHAR(80) ) CREATE TABLE Drama_Workshop_Groups ( Workshop_Group_ID INTEGER, Address_ID INTEGER, Currency_Code CHAR(15), Marketing_Region_Code CHAR(15), Store_Name VARCHAR(255), Store_Phone VARC...
SELECT Product_Name, AVG(Product_Price) FROM Products GROUP BY Product_Name
nvbench
CREATE TABLE table_11567 ( "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 lowest crowd when North Melbourne pl...
SELECT MIN("Crowd") FROM table_11567 WHERE "Home team" = 'north melbourne'
wikisql
CREATE TABLE table_58860 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Lawson Little's Money ($) amount?
SELECT "Money ( $ )" FROM table_58860 WHERE "Player" = 'lawson little'
wikisql
CREATE TABLE table_14342592_4 ( points INTEGER, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the least points for patrick
SELECT MIN(points) FROM table_14342592_4 WHERE player = "Patrick"
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT demographic.days_stay, prescriptions.formulary_drug_cd FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Troy Friedman"
mimicsql_data
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 Badges ( Id number, UserId number, Name text, ...
SELECT p.OwnerUserId, v.*, CASE VoteTypeId WHEN 1 THEN 15 END AS accepted, CASE VoteTypeId WHEN 8 THEN -BountyAmount WHEN 9 THEN BountyAmount END AS bounty, CASE VoteTypeId WHEN 2 THEN 10 WHEN 3 THEN -2 ELSE 0 END AS rep FROM Votes AS v INNER JOIN Posts AS p ON p.Id = v.PostId INNER JOIN Users AS u ON u.Id = p.OwnerUse...
sede
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_DIRE_CD text, MED_DIRE_NM text,...
SELECT SUM(t_kc22.QTY), SUM(t_kc22.AMOUNT) FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_NM = '谷维素片' AND t_kc22.STA_DATE BETWEEN '2013-07-30' AND '2020-10-01'
css
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeoutputid ...
SELECT COUNT(*) > 0 FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-7646')) AND DATETIME(allergy.allergytime, 'start of year') = DATETIME(CURREN...
eicu
CREATE TABLE table_64302 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total weeks with more 56,134 attendees against the minnesota vikings?
SELECT SUM("Week") FROM table_64302 WHERE "Attendance" > '56,134' AND "Opponent" = 'minnesota vikings'
wikisql
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 All_Home, AVG(Team_ID) FROM basketball_match GROUP BY All_Home ORDER BY AVG(Team_ID) DESC
nvbench
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.language = "ENGL" AND procedures.long_title = "Infusion of vasopressor agent"
mimicsql_data
CREATE TABLE table_12335 ( "Date" text, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the April 7, 2008 score on a clay surface?
SELECT "Score" FROM table_12335 WHERE "Surface" = 'clay' AND "Date" = 'april 7, 2008'
wikisql
CREATE TABLE table_62990 ( "Title" text, "Series" text, "Director" text, "Production Num." text, "Release date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the release date for Production Number 8181?
SELECT "Release date" FROM table_62990 WHERE "Production Num." = '8181'
wikisql
CREATE TABLE table_35785 ( "Polling Firm" text, "Date of Polling" text, "Link" text, "Liberal" real, "Green" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date of polling was the Polling Firm forum research with 7 green and less than 30 lib...
SELECT "Date of Polling" FROM table_35785 WHERE "Polling Firm" = 'forum research' AND "Green" = '7' AND "Liberal" < '30'
wikisql
CREATE TABLE table_27184837_1 ( asia VARCHAR, americas VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many program data on Asia was written if the organization launched 14 programs iin the Americas?
SELECT COUNT(asia) FROM table_27184837_1 WHERE americas = 14
sql_create_context
CREATE TABLE table_1756284_1 ( bush_number INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the highest vote number for Bush?
SELECT MAX(bush_number) FROM table_1756284_1
sql_create_context
CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
SELECT COUNT(*) FROM zyjzjlb WHERE JZKSMC = '小儿口腔颌面外科' AND RYDJSJ BETWEEN '2003-01-26' AND '2012-09-17'
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 jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGD...
css
CREATE TABLE table_name_64 ( total INTEGER, silver VARCHAR, bronze VARCHAR, gold VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest total for bronzes over 1, golds over 8, and fewer than 10 silvers?
SELECT MIN(total) FROM table_name_64 WHERE bronze > 1 AND gold > 8 AND silver < 10
sql_create_context
CREATE TABLE table_2930244_4 ( number_of_tropical_storms INTEGER, deaths VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the maximum number of tropical storms in the year that had exactly 34 deaths?
SELECT MAX(number_of_tropical_storms) FROM table_2930244_4 WHERE deaths = "34"
sql_create_context
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, Dupli...
SELECT c.Id AS "comment_link", c.Text, c.Score, c.CreationDate AS "comment_date" FROM Comments AS c WHERE UserId = @userId AND (@phrase1 = '' OR LOWER(c.Text) LIKE '%' + @phrase1 + '%') AND (@phrase2 = '' OR LOWER(c.Text) LIKE '%' + @phrase2 + '%') AND (@phrase3 = '' OR LOWER(c.Text) LIKE '%' + @phrase3 + '%') ORDER BY...
sede
CREATE TABLE table_44860 ( "Rank" real, "Name" text, "S-League" text, "Singapore Cup" text, "Singapore League Cup" text, "AFC Cup" text, "Total" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the rank for the total that has 3 (20)?
SELECT "Rank" FROM table_44860 WHERE "Total" = '3 (20)'
wikisql
CREATE TABLE table_24273 ( "Round" real, "Circuit" text, "Date" text, "Pole position" text, "Fastest lap" text, "Winning driver" text, "Winning team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who won when Jamie Green had the best lap?
SELECT "Winning driver" FROM table_24273 WHERE "Fastest lap" = 'Jamie Green'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "HYPERTENSION;RULE OUT CORONARY ARTERY DISEASE\CARDIAC CATH" AND demographic.dod_year <= "2180.0"
mimicsql_data
CREATE TABLE table_38392 ( "Product" text, "Extensions" text, "Projects templates" text, "MSDN integration" text, "Debugging" text, "Profiling" text, "IntelliTrace" text, "Unit test" text, "Code coverage" text, "Test impact analysis" text, "Load testing" text, "Lab manage...
SELECT "MSDN integration" FROM table_38392 WHERE "IntelliTrace" = 'yes'
wikisql
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE flight_stop ( flight_id int, stop_number int, ...
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 = 'CHARLOTTE' AND date_day.day_number = 21 AND date_day.month_number = 2 AND...
atis
CREATE TABLE table_name_89 ( attendance INTEGER, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Of the games with a record of 80-81, what was the highest attendance?
SELECT MAX(attendance) FROM table_name_89 WHERE record = "80-81"
sql_create_context
CREATE TABLE Participants ( Participant_ID INTEGER, Participant_Type_Code CHAR(15), Participant_Details VARCHAR(255) ) CREATE TABLE Services ( Service_ID INTEGER, Service_Type_Code CHAR(15) ) CREATE TABLE Participants_in_Events ( Event_ID INTEGER, Participant_ID INTEGER ) CREATE TABLE Eve...
SELECT Event_Details, COUNT(Event_Details) FROM Events GROUP BY Event_Details ORDER BY COUNT(Event_Details)
nvbench
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TA...
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 (((flight.arrival_time <= 1245 AND flight.arrival_time >= 1115) AND date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 19...
atis
CREATE TABLE table_28466323_2 ( directed_by VARCHAR, us_viewers__million_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who directed the episode watched by 2.01 million US viewers?
SELECT directed_by FROM table_28466323_2 WHERE us_viewers__million_ = "2.01"
sql_create_context
CREATE TABLE table_name_65 ( points INTEGER, year VARCHAR, class VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For years before 1996, having a rank of 3rd in the 125cc class, what is the sum of the points?
SELECT SUM(points) FROM table_name_65 WHERE class = "125cc" AND rank = "3rd" AND year < 1996
sql_create_context
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
SELECT DATE(q.CreationDate), COUNT(DATE(q.CreationDate)) FROM Posts AS q WHERE q.PostTypeId = 1 AND q.AcceptedAnswerId IS NULL AND q.ClosedDate IS NULL AND COALESCE((SELECT MAX(a.Score) FROM Posts AS a WHERE a.ParentId = q.Id AND a.PostTypeId = 2), 0) <= 0 GROUP BY DATE(q.CreationDate) ORDER BY DATE(q.CreationDate)
sede
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) 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, ...
SELECT t_kc21.MED_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_NM = '章俊材' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_CD = '518833181-4')
css
CREATE TABLE wine ( no number, grape text, winery text, appelation text, state text, name text, year number, price number, score number, cases number, drink text ) CREATE TABLE grapes ( id number, grape text, color text ) CREATE TABLE appellations ( no numbe...
SELECT name FROM wine ORDER BY score LIMIT 1
spider
CREATE TABLE table_45313 ( "Season" real, "Team 1" text, "Score" text, "Team 2" text, "Venue" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the total number of Season that has the Team 2 of chonburi, and the Score of 0:1?
SELECT COUNT("Season") FROM table_45313 WHERE "Team 2" = 'chonburi' AND "Score" = '0:1'
wikisql
CREATE TABLE vehicles ( vehicle_id number, vehicle_details text ) CREATE TABLE lessons ( lesson_id number, customer_id number, lesson_status_code text, staff_id number, vehicle_id number, lesson_date time, lesson_time text, price number ) CREATE TABLE customers ( customer_i...
SELECT T2.first_name, T2.last_name FROM addresses AS T1 JOIN staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T1.city = "Damianfort"
spider
CREATE TABLE table_14084 ( "Name" text, "Position" text, "League Apps" text, "League Goals" real, "FA Cup Apps" real, "FA Cup Goals" real, "League Cup Apps" real, "League Cup Goals" real, "Total Apps" text, "Total Goals" real ) -- Using valid SQLite, answer the following questi...
SELECT COUNT("FA Cup Goals") FROM table_14084 WHERE "Name" = 'jimmy nicholson' AND "League Cup Goals" > '0'
wikisql
CREATE TABLE table_name_11 ( director VARCHAR, season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Director, when Season is 1.4?
SELECT director FROM table_name_11 WHERE season = 1.4
sql_create_context
CREATE TABLE table_204_573 ( id number, "#" number, "title" text, "performer(s)" text, "film" text, "length" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how long is the song from the lion king ?
SELECT "length" FROM table_204_573 WHERE "film" = 'the lion king'
squall
CREATE TABLE table_204_513 ( id number, "date" text, "time" text, "opponent#" text, "site" text, "tv" text, "result" text, "attendance" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- when is the next game played after november 17th ?
SELECT "date" FROM table_204_513 WHERE id = (SELECT id FROM table_204_513 WHERE "date" = 'november 16') + 1
squall
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "PHOS250"
mimicsql_data
CREATE TABLE table_54770 ( "Race" text, "Circuit" text, "Date" text, "Pole position" text, "Fastest lap" text, "Winning driver" text, "Constructor" text, "Tyre" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is th...
SELECT "Circuit" FROM table_54770 WHERE "Fastest lap" = 'phil hill'
wikisql
CREATE TABLE table_name_23 ( away_team VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When st kilda was playing at home what was the away teams score?
SELECT away_team AS score FROM table_name_23 WHERE home_team = "st kilda"
sql_create_context
CREATE TABLE table_71801 ( "Result" text, "Date" text, "Race" text, "Venue" text, "Group" text, "Distance" text, "Weight (kg)" real, "Jockey" text, "Winner/2nd" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of th...
SELECT "Result" FROM table_71801 WHERE "Venue" = 'rosehill' AND "Race" = 'todman stakes'
wikisql
CREATE TABLE table_1876825_7 ( written_by VARCHAR, original_air_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number of written by for original air date for may 8, 2005
SELECT COUNT(written_by) FROM table_1876825_7 WHERE original_air_date = "May 8, 2005"
sql_create_context
CREATE TABLE table_1304443_2 ( others_percentage VARCHAR, bush_percentage VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the percentage of votes for other candidates in the county where Bush got 51.6% of the votes?
SELECT others_percentage FROM table_1304443_2 WHERE bush_percentage = "51.6%"
sql_create_context
CREATE TABLE table_18812411_3 ( r1 VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many times did Fiji win r1?
SELECT COUNT(r1) FROM table_18812411_3 WHERE country = "Fiji"
sql_create_context
CREATE TABLE table_name_49 ( tries INTEGER, player VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many tries did the player Paul Sykes take when he earned 0 points?
SELECT MAX(tries) FROM table_name_49 WHERE player = "paul sykes" AND points > 0
sql_create_context
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
SELECT COUNT(*) > 0 FROM course AS COURSE_0, course AS COURSE_1, program_course AS PROGRAM_COURSE_0, program_course AS PROGRAM_COURSE_1 WHERE COURSE_0.department = 'ARTDES' AND COURSE_0.number = 181 AND COURSE_1.department = 'ARTDES' AND COURSE_1.number = 182 AND PROGRAM_COURSE_0.course_id = COURSE_0.course_id AND PROG...
advising
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 SOC_SRT_DIRE_CD, SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID = '85755686668' AND HOSP_DOC_NM LIKE '韦%'
css
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 DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'medication' AND cost.eventid IN (SELECT medication.medicationid FROM medication WHERE medication.drugname = 'atorvastatin calcium 80 mg po tabs')
eicu
CREATE TABLE person_info_hz_info ( RYBH text, KH number, KLX number, YLJGDM number ) 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 t...
SELECT COUNT(person_info.RYBH) FROM hz_info JOIN mzjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGD...
css
CREATE TABLE table_39704 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many total medals for the nation with 1 gold and 6 bronzes?
SELECT COUNT("Total") FROM table_39704 WHERE "Gold" = '1' AND "Bronze" = '6'
wikisql
CREATE TABLE table_train_50 ( "id" int, "raynaud_syndrome" bool, "active_infection" bool, "antibiotic_treatment" bool, "receiving_vasopressor" bool, "sepsis" bool, "vasospastic_diathesis" bool, "organ_failure" bool, "septic_shock" bool, "NOUSE" float ) -- Using valid SQLite, an...
SELECT * FROM table_train_50 WHERE sepsis = 1 AND receiving_vasopressor = 1
criteria2sql
CREATE TABLE table_12823 ( "Election" text, "1st Member" text, "1st Party" text, "2nd Member" text, "2nd Party" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is 1st Member, when 1st Party is 'Constituency Abolished'?
SELECT "1st Member" FROM table_12823 WHERE "1st Party" = 'constituency abolished'
wikisql
CREATE TABLE table_1610496_3 ( gdp_adjusted__$_billions_ VARCHAR, gdp_per_capita_nominal__$_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the adjusted GDP when the nominal GDP per capita is 2874?
SELECT gdp_adjusted__$_billions_ FROM table_1610496_3 WHERE gdp_per_capita_nominal__$_ = 2874
sql_create_context
CREATE TABLE table_23185 ( "Rank" real, "Mountain Peak" text, "Mountain Range" text, "Elevation" text, "Prominence" text, "Isolation" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many different isolation numbers does the Jack Mountain peak...
SELECT COUNT("Isolation") FROM table_23185 WHERE "Mountain Peak" = 'Jack Mountain'
wikisql
CREATE TABLE table_name_58 ( high_assists VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had the high assists against San Antonio?
SELECT high_assists FROM table_name_58 WHERE team = "san antonio"
sql_create_context
CREATE TABLE flight ( flno number(4,0), origin varchar2(20), destination varchar2(20), distance number(6,0), departure_date date, arrival_date date, price number(7,2), aid number(9,0) ) CREATE TABLE certificate ( eid number(9,0), aid number(9,0) ) CREATE TABLE employee ( ei...
SELECT name, COUNT(*) FROM flight AS T1 JOIN aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid ORDER BY name DESC
nvbench
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE T...
SELECT c.Text, c.Id AS "comment_link", p.Score, c.CreationDate, p.ViewCount, LENGTH(c.Text) AS "Len", p.Id AS "post_link" FROM Comments AS c INNER JOIN Posts AS p ON c.PostId = p.Id WHERE c.Text LIKE '_hat have you tri%' AND NOT p.AcceptedAnswerId IS NULL AND LENGTH(c.Text) < 80 ORDER BY p.LastEditDate LIMIT 100
sede
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND demographic.age < "67"
mimicsql_data
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course ( course_id int, name varchar, dep...
SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%Other%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_c...
advising
CREATE TABLE table_name_53 ( years_for_jazz VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What years did Eddie Hughes play for the Jazz?
SELECT years_for_jazz FROM table_name_53 WHERE player = "eddie hughes"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Medicaid" AND procedures.long_title = "Continuous invasive mechanical ventilation for 96 consecutive hours or more"
mimicsql_data
CREATE TABLE table_78392 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score of the tournament against Isha Lakhani?
SELECT "Score" FROM table_78392 WHERE "Opponent" = 'isha lakhani'
wikisql
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TAB...
SELECT Users.Id AS "user_link" FROM Posts INNER JOIN Users ON Users.Id = OwnerUserId WHERE PostTypeId = 1 GROUP BY Users.Id HAVING COUNT(Posts.Id) = 1
sede
CREATE TABLE table_50955 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is David Frost from?
SELECT "Place" FROM table_50955 WHERE "Player" = 'david frost'
wikisql
CREATE TABLE table_19517448_3 ( completion_percentage VARCHAR, yards_per_attempt VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the completion percentage when yards per attempt was done by Steve McNair : 2003?
SELECT completion_percentage FROM table_19517448_3 WHERE yards_per_attempt = "Steve McNair : 2003"
sql_create_context
CREATE TABLE table_61695 ( "Goalkeeper" text, "Goals" real, "Matches" real, "Average" real, "Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Goals has a Team of zamora, and Average larger than 0.89?
SELECT AVG("Goals") FROM table_61695 WHERE "Team" = 'zamora' AND "Average" > '0.89'
wikisql
CREATE TABLE table_name_95 ( result VARCHAR, week VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of the game that was played on week 15?
SELECT result FROM table_name_95 WHERE week = 15
sql_create_context
CREATE TABLE drivers ( driverid number, driverref text, number number, code text, forename text, surname text, dob text, nationality text, url text ) CREATE TABLE constructorresults ( constructorresultsid number, raceid number, constructorid number, points number, ...
SELECT name FROM circuits WHERE country = "UK" OR country = "Malaysia"
spider
CREATE TABLE Transactions_Lots ( transaction_id INTEGER, lot_id INTEGER ) CREATE TABLE Ref_Transaction_Types ( transaction_type_code VARCHAR(10), transaction_type_description VARCHAR(80) ) CREATE TABLE Lots ( lot_id INTEGER, investor_id INTEGER, lot_details VARCHAR(255) ) CREATE TABLE Sal...
SELECT transaction_type_code, AVG(amount_of_transaction) FROM Transactions GROUP BY transaction_type_code
nvbench
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE admissions ( row_id numbe...
SELECT COUNT(*) > 0 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 = 14611)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp mean'...
mimic_iii
CREATE TABLE Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) 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 Allergy_Type ( Allergy VARCHAR(20), ...
SELECT Fname, COUNT(Fname) FROM Student WHERE Sex = 'F' GROUP BY Fname ORDER BY Fname
nvbench
CREATE TABLE table_15530244_5 ( driver VARCHAR, race_2 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the driver for race 2 7
SELECT driver FROM table_15530244_5 WHERE race_2 = "7"
sql_create_context
CREATE TABLE table_63116 ( "Tournament" text, "Wins" real, "Top-5" real, "Events" real, "Cuts made" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the least Top-5 when 1 is the cuts made?
SELECT MIN("Top-5") FROM table_63116 WHERE "Cuts made" = '1'
wikisql
CREATE TABLE table_39377 ( "Year" real, "English title" text, "Original title" text, "Country" text, "Director" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Original title of / vozvrashcheniye had what English title?
SELECT "English title" FROM table_39377 WHERE "Original title" = 'возвращение / vozvrashcheniye'
wikisql
CREATE TABLE table_17951 ( "Season" text, "Airdate" text, "The Mole" text, "Winner" text, "Runner-up" text, "Prize money" text, "International destination" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's airdate with international dest...
SELECT "Airdate" FROM table_17951 WHERE "International destination" = 'Scotland'
wikisql
CREATE TABLE actor ( Actor_ID int, Name text, Musical_ID int, Character text, Duration text, age int ) CREATE TABLE musical ( Musical_ID int, Name text, Year int, Award text, Category text, Nominee text, Result text ) -- Using valid SQLite, answer the following que...
SELECT T2.Name, COUNT(*) FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID GROUP BY T1.Musical_ID ORDER BY T2.Name DESC
nvbench
CREATE TABLE grapes ( id number, grape text, color text ) CREATE TABLE appellations ( no number, appelation text, county text, state text, area text, isava text ) CREATE TABLE wine ( no number, grape text, winery text, appelation text, state text, name text,...
SELECT grape, winery, year FROM wine WHERE price > 100 ORDER BY year
spider
CREATE TABLE table_1566850_9 ( centerfold_model VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many centerfolds were in the 9-98 issue?
SELECT COUNT(centerfold_model) FROM table_1566850_9 WHERE date = "9-98"
sql_create_context
CREATE TABLE table_46859 ( "Province" text, "Total" real, "Hindu" real, "% Hindu 2010" text, "% Hindu 2000" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total when the Hindu is greater than 1,076, in the Jawa Barat province?
SELECT COUNT("Total") FROM table_46859 WHERE "Hindu" > '1,076' AND "Province" = 'jawa barat'
wikisql
CREATE TABLE table_32057 ( "Begin Date" text, "Representative" text, "Date of birth" text, "House term" text, "State served" text, "Party" text, "Age (years, days)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the age of the membe...
SELECT "Age (years, days)" FROM table_32057 WHERE "Begin Date" = 'may 7, 1886'
wikisql
CREATE TABLE table_55414 ( "Edition" text, "Round" text, "Date" text, "Surface" text, "Opponent" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the 1991 world group I with the opponent of Li Fang?
SELECT "Date" FROM table_55414 WHERE "Edition" = '1991 world group i' AND "Opponent" = 'li fang'
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.diagnosis = "BLADDER CANCER/SDA" AND procedures.short_title = "Percu endosc gastrostomy"
mimicsql_data