instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
WITH BountiedPosts AS (SELECT p.* FROM Posts AS p JOIN Votes AS v ON v.PostId = p.Id AND v.VoteTypeId = 8 WHERE p.Score >= 0 AND ClosedDate IS NULL), Percentiles AS (SELECT NTILE(100) OVER (ORDER BY ViewCount) AS Percentile, ViewCount FROM BountiedPosts) SELECT MIN(ViewCount) AS NumberOfViews, Percentile FROM Percentil...
sede
CREATE TABLE table_50119 ( "Points" real, "Score" text, "Premiers" text, "Runners Up" text, "Details" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- During which competition were a total of 36 points scored?
SELECT "Details" FROM table_50119 WHERE "Points" = '36'
wikisql
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREA...
SELECT canUpvote, canDownvote, COUNT(*) AS numUsers FROM (SELECT Id, CASE WHEN Reputation < 15 THEN 'N' ELSE 'Y' END AS canUpvote, CASE WHEN Reputation < 125 THEN 'N' ELSE 'Y' END AS canDownvote FROM Users) AS tmp GROUP BY canUpvote, canDownvote
sede
CREATE TABLE table_77200 ( "Name" text, "Latitude" text, "Longitude" text, "Diameter (km)" real, "Year named" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Longitude, when Name is Raskova Paterae?
SELECT "Longitude" FROM table_77200 WHERE "Name" = 'raskova paterae'
wikisql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemics...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'vascular catheter placement' AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year'))
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 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.insurance = "Government" AND procedures.short_title = "Open incis hern-grft NEC"
mimicsql_data
CREATE TABLE table_name_62 ( rating___percentage_ INTEGER, owner VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the sum of rating % for cctv and position more than 7
SELECT SUM(rating___percentage_) FROM table_name_62 WHERE owner = "cctv" AND position > 7
sql_create_context
CREATE TABLE bank ( branch_id number, bname text, no_of_customers number, city text, state text ) CREATE TABLE loan ( loan_id text, loan_type text, cust_id text, branch_id text, amount number ) CREATE TABLE customer ( cust_id text, cust_name text, acc_type text, ...
SELECT T2.bname FROM loan AS T1 JOIN bank AS T2 ON T1.branch_id = T2.branch_id JOIN customer AS T3 ON T1.cust_id = T3.cust_id WHERE T3.credit_score < 100 GROUP BY T2.bname ORDER BY SUM(T1.amount) DESC LIMIT 1
spider
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
SELECT prescriptions.drug_type, prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Tacrolimus"
mimicsql_data
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE requirement ( ...
SELECT DISTINCT course.name, course.number, program_course.workload FROM course, program_course WHERE course.department LIKE '%ARTDES%' AND program_course.course_id = course.course_id AND program_course.workload < 3
advising
CREATE TABLE table_16677738_1 ( without_the_walls INTEGER, within_the_walls INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When within the walls is larger than 56174.0 what is the lowest amount without the walls?
SELECT MIN(without_the_walls) FROM table_16677738_1 WHERE within_the_walls > 56174.0
sql_create_context
CREATE TABLE table_79279 ( "Constituency number" text, "Name" text, "Reserved for ( SC / ST /None)" text, "District" text, "Number of electorates (2009)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Beohari's reserved for (SC/ST/None)?
SELECT "Reserved for ( SC / ST /None)" FROM table_79279 WHERE "Name" = 'beohari'
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "E9331" AND prescriptions.drug_type = "MAIN"
mimicsql_data
CREATE TABLE table_204_804 ( id number, "version" text, "length" text, "album" text, "remixed by" text, "year" number, "comment" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the last version of this song to be created in 2005 ?
SELECT "version" FROM table_204_804 WHERE "year" = 2005 ORDER BY id DESC LIMIT 1
squall
CREATE TABLE table_26876 ( "Name" text, "Nationality" text, "Position" text, "Los Angeles Sol career" text, "Appearances" real, "Starts" real, "Minutes" real, "Goals" real, "Assists" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Nam...
SELECT "Position" FROM table_26876 WHERE "Minutes" = '132'
wikisql
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConce...
SELECT (SELECT COUNT(*) FROM Posts WHERE Score = 0 AND PostTypeId = 1) AS Zero_Votes, (SELECT COUNT(*) FROM Posts WHERE Score != 0 AND PostTypeId = 1) AS NonZero_Votes
sede
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 prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT; MYOMECTOMY/SDA" AND lab.fluid = "Pleural"
mimicsql_data
CREATE TABLE table_name_10 ( tournament VARCHAR, margin_of_victory VARCHAR, winning_score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Tournament has a Margin of victory of 2 strokes, and a Winning score of 14 (68-66-68=202)?
SELECT tournament FROM table_name_10 WHERE margin_of_victory = "2 strokes" AND winning_score = −14(68 - 66 - 68 = 202)
sql_create_context
CREATE TABLE table_14676 ( "Round" real, "Name" text, "Position" text, "School" text, "Signed" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest round associated with Samuel Scheschuk?
SELECT MIN("Round") FROM table_14676 WHERE "Name" = 'samuel scheschuk'
wikisql
CREATE TABLE table_28281704_1 ( tenant VARCHAR, country VARCHAR, stadium VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of tenants for russia at the saransk stadium
SELECT COUNT(tenant) FROM table_28281704_1 WHERE country = "Russia" AND stadium = "Saransk stadium"
sql_create_context
CREATE TABLE table_19744915_3 ( couple VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many coupless totalled 14.5
SELECT COUNT(couple) FROM table_19744915_3 WHERE total = "14.5"
sql_create_context
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 WHERE demographic.diagnosis = "BRADYCARDIA"
mimicsql_data
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.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb JOIN 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 = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZ...
css
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE vitalperiodic ( vitalp...
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-66126')) AND lab.labname = 'ast (sgot)' AND STRFTIME('%y-%m', lab.labresulttime...
eicu
CREATE TABLE table_name_21 ( position VARCHAR, school_club_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position in the club team of Kansas?
SELECT position FROM table_name_21 WHERE school_club_team = "kansas"
sql_create_context
CREATE TABLE table_29546 ( "District" text, "Incumbent" text, "Party" text, "Elected" real, "Status" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the incumbent for the election in 1978?
SELECT "Incumbent" FROM table_29546 WHERE "Elected" = '1978'
wikisql
CREATE TABLE table_2512 ( "Year" real, "Starts" real, "Wins" real, "Top 5" real, "Top 10" real, "Poles" real, "Avg. Start" text, "Avg. Finish" text, "Winnings" text, "Position" text, "Team(s)" text ) -- Using valid SQLite, answer the following questions for the tables provi...
SELECT COUNT("Top 5") FROM table_2512 WHERE "Winnings" = '$250,667'
wikisql
CREATE TABLE table_42566 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Record with a Date ...
SELECT "Record" FROM table_42566 WHERE "Date" = 'december 20'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "0" AND diagnoses.icd9_code = "5589"
mimicsql_data
CREATE TABLE table_name_16 ( date VARCHAR, catalog VARCHAR, label VARCHAR, format VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date of the label Alfa records, a CD format, and an alca-9201 catalog?
SELECT date FROM table_name_16 WHERE label = "alfa records" AND format = "cd" AND catalog = "alca-9201"
sql_create_context
CREATE TABLE table_name_58 ( attendance INTEGER, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest Attendance at a game with the Result of w 25-17?
SELECT MIN(attendance) FROM table_name_58 WHERE result = "w 25-17"
sql_create_context
CREATE TABLE table_7787 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Ground" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the away team score where the home team ...
SELECT "Away team score" FROM table_7787 WHERE "Home team score" = '2.4.6 (48)'
wikisql
CREATE TABLE table_1231892_4 ( title VARCHAR, broadcast_order VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the title of the episode with a broadcast order s04 e01?
SELECT title FROM table_1231892_4 WHERE broadcast_order = "S04 E01"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "48" AND prescriptions.formulary_drug_cd = "MIDAZBASE"
mimicsql_data
CREATE TABLE table_204_700 ( id number, "name" text, "developer" text, "release" text, "type" text, "game flow" text, "setting" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- in which year was cyber nations released ?
SELECT "release" FROM table_204_700 WHERE "name" = 'cyber nations'
squall
CREATE TABLE table_26030 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (in millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the writer for th...
SELECT "Written by" FROM table_26030 WHERE "Title" = 'What Are You Made Of?'
wikisql
CREATE TABLE table_name_97 ( station_name VARCHAR, arrival VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Station Name has an Arrival time of 01:10?
SELECT station_name FROM table_name_97 WHERE arrival = "01:10"
sql_create_context
CREATE TABLE Timed_Locations_of_Things ( thing_id INTEGER, Date_and_Time DATETIME, Location_Code CHAR(15) ) CREATE TABLE Residents_Services ( resident_id INTEGER, service_id INTEGER, date_moved_in DATETIME, property_id INTEGER, date_requested DATETIME, date_provided DATETIME, ot...
SELECT Type_of_Thing_Code, COUNT(Type_of_Thing_Code) FROM Things GROUP BY Type_of_Thing_Code
nvbench
CREATE TABLE school_performance ( School_Id int, School_Year text, Class_A text, Class_AA text ) CREATE TABLE player ( Player_ID int, Player text, Team text, Age int, Position text, School_ID int ) CREATE TABLE school_details ( School_ID int, Nickname text, Colors t...
SELECT Denomination, COUNT(*) FROM school GROUP BY Denomination ORDER BY COUNT(*)
nvbench
CREATE TABLE table_name_56 ( games VARCHAR, event VARCHAR, medal VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did Pakistan win a Silver Medal in a Men's Competition?
SELECT games FROM table_name_56 WHERE event = "men's competition" AND medal = "silver"
sql_create_context
CREATE TABLE table_name_27 ( outcome VARCHAR, surface VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the outcome of the match played on carpet surface?
SELECT outcome FROM table_name_27 WHERE surface = "carpet"
sql_create_context
CREATE TABLE language ( language_id number, name text, last_update time ) CREATE TABLE address ( address_id number, address text, address2 text, district text, city_id number, postal_code text, phone text, last_update time ) CREATE TABLE film_actor ( actor_id number, ...
SELECT first_name FROM actor GROUP BY first_name ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_17288825_9 ( high_points VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had the most poinst in game 72?
SELECT high_points FROM table_17288825_9 WHERE game = 72
sql_create_context
CREATE TABLE table_75380 ( "Years" text, "2004" real, "2005" real, "2006" real, "2007" real, "2008" real, "2009" real, "2010" real, "2011" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest value in 2011 with less tha...
SELECT MAX("2011") FROM table_75380 WHERE "2006" < '5,049' AND "2008" < '1,380,935'
wikisql
CREATE TABLE table_204_171 ( id number, "wager" text, "winner" text, "loser" text, "location" text, "date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many winners were there before bruno victoria lost ?
SELECT COUNT("winner") FROM table_204_171 WHERE id < (SELECT id FROM table_204_171 WHERE "loser" = 'bruno victoria')
squall
CREATE TABLE table_20887670_1 ( year_joined VARCHAR, colors VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- in what year did the colors red and gold join?
SELECT COUNT(year_joined) FROM table_20887670_1 WHERE colors = "Red and Gold"
sql_create_context
CREATE TABLE Complaints ( complaint_id INTEGER, product_id INTEGER, customer_id INTEGER, complaint_outcome_code VARCHAR(20), complaint_status_code VARCHAR(20), complaint_type_code VARCHAR(20), date_complaint_raised DATETIME, date_complaint_closed DATETIME, staff_id INTEGER ) CREATE ...
SELECT product_category_code, AVG(product_price) FROM Products GROUP BY product_category_code ORDER BY product_category_code DESC
nvbench
CREATE TABLE table_60574 ( "Date" text, "Time" text, "Score" text, "Set 1" text, "Set 2" text, "Set 3" text, "Total" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Time when Set 3 was 25 14?
SELECT "Time" FROM table_60574 WHERE "Set 3" = '25–14'
wikisql
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), AllergyType VARCHAR(20) ) CREATE TABLE Has_Allergy ( StuID INTEGE...
SELECT Fname, COUNT(Fname) FROM Student WHERE Sex = 'F' GROUP BY Fname
nvbench
CREATE TABLE phone_market ( Market_ID int, Phone_ID text, Num_of_stock int ) CREATE TABLE phone ( Name text, Phone_ID int, Memory_in_G int, Carrier text, Price real ) CREATE TABLE market ( Market_ID int, District text, Num_of_employees int, Num_of_shops real, Rankin...
SELECT Name, COUNT(Name) FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID GROUP BY Name ORDER BY Name DESC
nvbench
CREATE TABLE table_17323042_6 ( high_points VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had the high points on December 17?
SELECT high_points FROM table_17323042_6 WHERE date = "December 17"
sql_create_context
CREATE TABLE all_documents ( document_id number, date_stored time, document_type_code text, document_name text, document_description text, other_details text ) CREATE TABLE employees ( employee_id number, role_code text, employee_name text, gender_mfu text, date_of_birth tim...
SELECT employee_name, role_code, date_of_birth FROM employees WHERE employee_name = 'Armani'
spider
CREATE TABLE table_43672 ( "Position" real, "Team" text, "Played" real, "Drawn" real, "Lost" real, "Goals For" real, "Goals Against" real, "Goal Difference" text, "Points 1" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the ...
SELECT MAX("Points 1") FROM table_43672 WHERE "Goals Against" < '97' AND "Lost" < '22' AND "Drawn" = '9' AND "Goal Difference" = '+28'
wikisql
CREATE TABLE table_13290 ( "School" text, "Location" text, "Mascot" text, "Enrollment" real, "IHSAA Class" text, "IHSAA Football Class" text, "# / County" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which IHSAA Football Class has an IHSAA...
SELECT "IHSAA Football Class" FROM table_13290 WHERE "IHSAA Class" = 'aa' AND "Enrollment" = '475'
wikisql
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.Id AS "post_link" FROM Posts AS P, PostTags AS Pt, Tags AS T WHERE P.Id = Pt.PostId AND T.Id = Pt.TagId AND T.TagName = '##tags##' AND P.Tags LIKE '<%##tag2##%>' GROUP BY P.Id
sede
CREATE TABLE table_18208 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many district with candidates being eliot l. engel (d) 85.2% martin ...
SELECT COUNT("District") FROM table_18208 WHERE "Candidates" = 'Eliot L. Engel (D) 85.2% Martin Richman (R) 14.8%'
wikisql
CREATE TABLE table_34371 ( "Name" text, "Nationality" text, "Position" text, "Years" text, "Appearances" real, "Goals" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's Francis Harris' position?
SELECT "Position" FROM table_34371 WHERE "Name" = 'francis harris'
wikisql
CREATE TABLE table_203_634 ( id number, "date" text, "venue" text, "score" text, "victor" text, "comments" text, "match reports" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- in which year did rugby union matches between new zealand and wal...
SELECT "date" FROM table_203_634 GROUP BY "date" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE patient ( uniquep...
SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-44495')) AND microlab.culturesite = 'sputum, tracheal specime...
eicu
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 jyjgzbb.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZ...
css
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 = "Old FB in soft tissue" AND lab.flag = "delta"
mimicsql_data
CREATE TABLE table_14911550_5 ( played INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many games were played?
SELECT MIN(played) FROM table_14911550_5
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
SELECT diagnosis.diagnosistime FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-40287')) AND diagnosis.diagnosisname = 'aortic dissection - d...
eicu
CREATE TABLE table_20178 ( "Week" real, "Date" text, "Result" text, "Record" text, "Opponent" text, "Points For" real, "Points Against" real, "First Downs" real, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the da...
SELECT "Date" FROM table_20178 WHERE "Week" = '9'
wikisql
CREATE TABLE table_name_16 ( award VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which award was given in 2012?
SELECT award FROM table_name_16 WHERE year = "2012"
sql_create_context
CREATE TABLE table_name_23 ( silver INTEGER, bronze VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest Silver, when Bronze is 1, and when Total is less than 3?
SELECT MIN(silver) FROM table_name_23 WHERE bronze = 1 AND total < 3
sql_create_context
CREATE TABLE table_name_21 ( round INTEGER, pick VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many rounds have a Pick of 13?
SELECT SUM(round) FROM table_name_21 WHERE pick = 13
sql_create_context
CREATE TABLE table_name_66 ( rank VARCHAR, year VARCHAR, out_of VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the rank for year of 2012 and out of larger than 176
SELECT rank FROM table_name_66 WHERE year = "2012" AND out_of > 176
sql_create_context
CREATE TABLE table_name_1 ( position VARCHAR, nationality VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the position of the player from the Ukraine?
SELECT position FROM table_name_1 WHERE nationality = "ukraine"
sql_create_context
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, ZYLBDM text, ZYMC text ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ tim...
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
CREATE TABLE table_58756 ( "\"Long\" vowels" text, "17th c." text, "American" text, "British" text, "Australian" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the British pronunciation when the American and Australian is i?
SELECT "British" FROM table_58756 WHERE "American" = 'i' AND "Australian" = 'i'
wikisql
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), ...
SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID
nvbench
CREATE TABLE table_name_42 ( nationality VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Adam Keefe's nationality?
SELECT nationality FROM table_name_42 WHERE player = "adam keefe"
sql_create_context
CREATE TABLE table_name_25 ( opponent VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what opponent has the record of 78-63?
SELECT opponent FROM table_name_25 WHERE record = "78-63"
sql_create_context
CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE time_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_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'MEMPHIS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'TACOMA...
atis
CREATE TABLE Ref_Shipping_Agents ( Id VARCHAR ) CREATE TABLE Documents ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which shipping agent shipped the most documents? List the shipping agent name and the number of documents.
SELECT Ref_Shipping_Agents.shipping_agent_name, COUNT(Documents.document_id) FROM Ref_Shipping_Agents JOIN Documents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code GROUP BY Ref_Shipping_Agents.shipping_agent_code ORDER BY COUNT(Documents.document_id) DESC LIMIT 1
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE cost ( costid number, uniquepid text,...
SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-17834')) AND microlab.culturesite = 'sputum, tracheal specime...
eicu
CREATE TABLE table_name_53 ( attendance VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people attended the game played with the New England Patriots as opponents?
SELECT attendance FROM table_name_53 WHERE opponent = "new england patriots"
sql_create_context
CREATE TABLE table_name_2 ( date VARCHAR, against VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date has an against of pohang steelers?
SELECT date FROM table_name_2 WHERE against = "pohang steelers"
sql_create_context
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 prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT; MYOMECTOMY/SDA" AND demographic.age < "67"
mimicsql_data
CREATE TABLE table_name_16 ( to_par VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of To Par, when Score is '70-75-76=221'?
SELECT COUNT(to_par) FROM table_name_16 WHERE score = 70 - 75 - 76 = 221
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 demographic.dob, demographic.religion FROM demographic WHERE demographic.name = "Jerry Deberry"
mimicsql_data
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "HOME HEALTH CARE" AND procedures.short_title = "Opn mitral valvuloplasty"
mimicsql_data
CREATE TABLE table_name_51 ( tyre VARCHAR, chassis VARCHAR, rounds VARCHAR, engine VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the engine Ford Cosworth DFV 3.0 v8 has a chassis of m23 and in rounds 14-15, what is its Tyre?
SELECT tyre FROM table_name_51 WHERE rounds = "14-15" AND engine = "ford cosworth dfv 3.0 v8" AND chassis = "m23"
sql_create_context
CREATE TABLE table_name_77 ( week INTEGER, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of week(s) with an attendance of 30,751?
SELECT SUM(week) FROM table_name_77 WHERE attendance = 30 OFFSET 751
sql_create_context
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
SELECT transfers.careunit FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 82132 AND admissions.dischtime IS NULL) AND NOT transfers.careunit IS NULL ORDER BY transfers.intime LIMIT 1
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT demographic.ethnicity FROM demographic WHERE demographic.name = "Stephanie Suchan"
mimicsql_data
CREATE TABLE table_73877 ( "Branding" text, "Callsign" text, "Ch. #" text, "Station Type" text, "Power kW (ERP)" text, "Location (Transmitter Site)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The callsign DWEC-TV has what branding?
SELECT "Branding" FROM table_73877 WHERE "Callsign" = 'DWEC-TV'
wikisql
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT COUNT(*) FROM (SELECT qtb.MED_ORG_DEPT_CD FROM qtb WHERE qtb.MED_SER_ORG_NO = '8025333' GROUP BY qtb.MED_ORG_DEPT_CD HAVING AVG(qtb.IN_HOSP_DAYS) > 9 UNION SELECT gyb.MED_ORG_DEPT_CD FROM gyb WHERE gyb.MED_SER_ORG_NO = '8025333' GROUP BY gyb.MED_ORG_DEPT_CD HAVING AVG(gyb.IN_HOSP_DAYS) > 9 UNION SELECT zyb.MED_O...
css
CREATE TABLE useracct ( u_id number, name text ) CREATE TABLE item ( i_id number, title text ) CREATE TABLE review ( a_id number, u_id number, i_id number, rating number, rank number ) CREATE TABLE trust ( source_u_id number, target_u_id number, trust number ) -- Usi...
SELECT AVG(rating), MAX(rating) FROM review
spider
CREATE TABLE table_name_47 ( points VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total points in 1974?
SELECT COUNT(points) FROM table_name_47 WHERE year = 1974
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND prescriptions.formulary_drug_cd = "ABAC300"
mimicsql_data
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 MIN(demographic.age) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.days_stay = "10"
mimicsql_data
CREATE TABLE member_of_club ( stuid number, clubid number, position text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE club ( clubid number, clubname text, clubdes...
SELECT clubdesc FROM club WHERE clubname = "Tennis Club"
spider
CREATE TABLE table_2892 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "U.S. viewers (million)" text, "Original air date" text, "Production code" real ) -- Using valid SQLite, answer the following questions for the tables provided abo...
SELECT "Written by" FROM table_2892 WHERE "Original air date" = 'February 4, 2010'
wikisql
CREATE TABLE diagnoses ( 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 ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2166" AND lab.itemid = "50885"
mimicsql_data
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight i...
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 = 'KANSAS CITY' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CL...
atis
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 t_kc21.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_NM = '王志尚' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 5598.78)
css
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 t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '34943476' AND t_kc21.MED_SER_ORG_NO = '1313131' AND t_kc21.IN_DIAG_DIS_NM LIKE '%癫痫%'
css
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 SUM(t_kc24.MED_AMOUT) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '窦德水' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2000-04-27' AND '2009-12-29' UNION SELECT SUM(t_kc24.MED_AMOUT) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE fgwyjzb.PE...
css