context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_76967 ( "Date" text, "Opponent" text, "Score" text, "Result" text, "Record" text )
WHAT IS THE SCORE WITH A RECORD OF 1-0?
SELECT "Score" FROM table_76967 WHERE "Record" = '1-0'
wikisql
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
门诊诊断为疾病P75.635的患者的检测指标177326数值的平均值以及最值分别是多少?
SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE wdmzjzjlb.JZZDBM = 'P75.635' AND jyjgzbb.JCZBDM = '...
css
CREATE TABLE table_name_90 ( outcome VARCHAR, tournament VARCHAR )
What is Outcome, when Tournament is 'Chiang Mai , Thailand'?
SELECT outcome FROM table_name_90 WHERE tournament = "chiang mai , thailand"
sql_create_context
CREATE TABLE table_13176 ( "Ranking" text, "Nationality" text, "Name" text, "Years" text, "Goals" real )
What was the nationality for the player with 33 goals?
SELECT "Nationality" FROM table_13176 WHERE "Goals" = '33'
wikisql
CREATE TABLE table_43646 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text )
What is the number that is the lowest overall for the College of Baylor?
SELECT MIN("Overall") FROM table_43646 WHERE "College" = 'baylor'
wikisql
CREATE TABLE table_name_68 ( manufacturer VARCHAR, type VARCHAR )
Which manucfaturer's type was 2-6-0?
SELECT manufacturer FROM table_name_68 WHERE type = "2-6-0"
sql_create_context
CREATE TABLE table_35769 ( "Name" text, "Goals" real, "Apps" real, "Avge" real, "Career" text )
What is the highest number of apps of the player with more than 63 goals and an avge of 0.45?
SELECT MAX("Apps") FROM table_35769 WHERE "Goals" > '63' AND "Avge" = '0.45'
wikisql
CREATE TABLE table_25042332_27 ( fixed_telephone_line VARCHAR, vehicle VARCHAR )
Name the fixed telephone line for 25.6% vehicle
SELECT fixed_telephone_line FROM table_25042332_27 WHERE vehicle = "25.6%"
sql_create_context
CREATE TABLE table_27982 ( "No. in series" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (million)" text )
Who directed episode number 18 in the series?
SELECT "Directed by" FROM table_27982 WHERE "No. in series" = '18'
wikisql
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, U...
Fetching Title with relevant information.
SELECT Id, Title, Score, AnswerCount, FavoriteCount, ViewCount, CreationDate, ClosedDate FROM Posts
sede
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostHistory...
Number of downvotes and upvotes per month.
SELECT LAST_DATE_OF_MONTH(CreationDate), SUM(CASE WHEN VoteTypeId = 3 THEN 1 ELSE 0 END) AS downvotes, SUM(CASE WHEN VoteTypeId = 2 THEN 1 ELSE 0 END) AS upvotes, ROUND(1.0 * SUM(CASE WHEN VoteTypeId = 3 THEN 1 ELSE 0 END) / SUM(CASE WHEN VoteTypeId = 2 THEN 1 ELSE 0 END), 3) AS ratio FROM Votes WHERE VoteTypeId IN (2,...
sede
CREATE TABLE table_name_76 ( total INTEGER, rank VARCHAR, bronze VARCHAR, silver VARCHAR )
What is the average total with less than 8 bronze, 3 silver, and a Rank smaller than 2?
SELECT AVG(total) FROM table_name_76 WHERE bronze < 8 AND silver = 3 AND rank < 2
sql_create_context
CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
What are some of the most useful courses to take before taking NEUROSCI 619 ?
SELECT DISTINCT advisory_requirement FROM course WHERE department = 'NEUROSCI' AND number = 619
advising
CREATE TABLE zyb ( CLINIC_ID 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, INSU_TYPE text, IN...
从一一年九月七日到一八年七月十七日,医疗机构6788679给患者51816664做过多少次检查
SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '51816664' AND t_kc22.STA_DATE BETWEEN '2011-09-07' AND '2018-07-17' AND qtb.MED_SER_ORG_NO = '6788679' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED...
css
CREATE TABLE table_name_34 ( intergiro_classification VARCHAR, points_classification VARCHAR, winner VARCHAR )
What is the Intergiro classification of Nicolaj bo Larsen, who has a Fabrizio guidi point classification?
SELECT intergiro_classification FROM table_name_34 WHERE points_classification = "fabrizio guidi" AND winner = "nicolaj bo larsen"
sql_create_context
CREATE TABLE table_78059 ( "Track" real, "Recorded" text, "Catalogue" text, "Release Date" text, "Song Title" text, "Time" text )
Tell me the track that has the catalogue of apbo 0280
SELECT "Track" FROM table_78059 WHERE "Catalogue" = 'apbo 0280'
wikisql
CREATE TABLE table_name_45 ( date VARCHAR, place VARCHAR )
When 7th place, what is the date?
SELECT date FROM table_name_45 WHERE place = "7th"
sql_create_context
CREATE TABLE table_name_55 ( seats INTEGER, share_of_votes VARCHAR )
What is the lowest number of seats from the election with 27.0% of votes?
SELECT MIN(seats) FROM table_name_55 WHERE share_of_votes = "27.0%"
sql_create_context
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, Deletio...
Top 1000 users with keywords sorted by reputation. Top 100 by votes users in tag c#
SELECT Users.Id, Users.DisplayName, Users.Reputation FROM Users WHERE EXISTS(SELECT u.Id FROM Tags AS t WITH (nolock) INNER JOIN PostTags AS pt WITH (nolock) ON pt.TagId = t.Id INNER JOIN Posts AS p WITH (nolock) ON p.ParentId = pt.PostId INNER JOIN Users AS u WITH (nolock) ON u.Id = p.OwnerUserId WHERE p.CommunityOwne...
sede
CREATE TABLE table_65442 ( "Rank" real, "Player" text, "County" text, "Tally" text, "Total" real, "Matches" real, "Average" real )
What is the number of matches with an average larger than 6.33, with a rank of 1?
SELECT SUM("Matches") FROM table_65442 WHERE "Average" > '6.33' AND "Rank" = '1'
wikisql
CREATE TABLE table_name_75 ( ties INTEGER, years VARCHAR, pct VARCHAR )
How many Ties have Years of 1919 1925, and a Pct larger than 0.734?
SELECT SUM(ties) FROM table_name_75 WHERE years = "1919–1925" AND pct > 0.734
sql_create_context
CREATE TABLE table_64811 ( "Class" text, "Railway number(s)" text, "DRG number(s)" text, "Quantity" real, "Year(s) of manufacture" text, "Axle arrangement ( UIC ) Bauart" text )
Which DRG number has xxx railway number?
SELECT "DRG number(s)" FROM table_64811 WHERE "Railway number(s)" = 'xxx'
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...
what is the monthly minimum ca-125 value for patient 10425 during a year before?
SELECT MIN(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10425) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'ca-125') AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURR...
mimic_iii
CREATE TABLE table_name_53 ( _percentage_of_popular_vote VARCHAR, _number_of_seats_available VARCHAR )
What is the percentage of the popular vote when there were 90 seats available?
SELECT _percentage_of_popular_vote FROM table_name_53 WHERE _number_of_seats_available = 90
sql_create_context
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...
Find any name change in the history..
SELECT Id, LEFT(SUBSTRING(Text, STR_POSITION(Text, '@') + 1, LENGTH(Text)), PATINDEX('%^a-z%', SUBSTRING(Text, STR_POSITION(Text, '@') + 1, LENGTH(Text))) - 1) AS oldName, Text FROM Comments AS msq WHERE Id = 246568
sede
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 ...
what did patient 23929 first have as his intake?
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT inputevents_cv.itemid FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23929)) ORDER BY inputevents_cv.char...
mimic_iii
CREATE TABLE table_name_83 ( position VARCHAR, jersey__number VARCHAR, birthdate VARCHAR )
What is the position of the player with a jersey # greater than 30 and a December 23, 1986 birthdate?
SELECT position FROM table_name_83 WHERE jersey__number > 30 AND birthdate = "december 23, 1986"
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, ...
what was the top three most frequent procedures given to patients in the same hospital visit after they were diagnosed with s/p aortobifemoral bypass until 4 years ago?
SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 's/p a...
eicu
CREATE TABLE table_17118006_2 ( department VARCHAR, local_investment__us$_ VARCHAR )
What was the department that got $626,798 in local investments?
SELECT department FROM table_17118006_2 WHERE local_investment__us$_ = "626,798"
sql_create_context
CREATE TABLE Accounts ( Account_ID INTEGER, Statement_ID INTEGER, Account_Details VARCHAR(255) ) CREATE TABLE Projects ( Project_ID INTEGER, Project_Details VARCHAR(255) ) CREATE TABLE Statements ( Statement_ID INTEGER, Statement_Details VARCHAR(255) ) CREATE TABLE Documents ( Documen...
Show the number of documents created in each day and bin document date by year interval and group by document type with a group line chart, and I want to order by the x-axis in asc.
SELECT Document_Date, COUNT(Document_Date) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code GROUP BY Document_Type_Name ORDER BY Document_Date
nvbench
CREATE TABLE table_name_99 ( venue VARCHAR, club VARCHAR )
Which Venue has a Club of west bromwich albion?
SELECT venue FROM table_name_99 WHERE club = "west bromwich albion"
sql_create_context
CREATE TABLE table_203_138 ( id number, "#" number, "date" text, "venue" text, "opponent" text, "score" text, "result" text, "competition" text )
how many competitions were not friendly ?
SELECT COUNT(DISTINCT "date") FROM table_203_138 WHERE "competition" <> 'friendly'
squall
CREATE TABLE table_26227 ( "No" real, "Player" text, "Height (m)" text, "Height (f)" text, "Position" text, "Year born" real, "Current Club" text )
Name the number for 1.96 height
SELECT "No" FROM table_26227 WHERE "Height (m)" = '1.96'
wikisql
CREATE TABLE table_30291 ( "Religion" text, "Births" real, "Conversions" text, "New adherents per year" real, "Growth rate" text )
Name the religion that has a growth rate of 1.56%
SELECT "Religion" FROM table_30291 WHERE "Growth rate" = '1.56%'
wikisql
CREATE TABLE table_name_32 ( total INTEGER, nation VARCHAR, silver VARCHAR )
What is the lowest Total for Italy with less than 0 silver?
SELECT MIN(total) FROM table_name_32 WHERE nation = "italy" AND silver < 0
sql_create_context
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...
Tell me the number of patients with bladder cancer/sda primary disease who died in or before 2173.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "BLADDER CANCER/SDA" AND demographic.dod_year <= "2173.0"
mimicsql_data
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 ) ...
provide the number of patients whose item id is 50915?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "50915"
mimicsql_data
CREATE TABLE table_7279 ( "Place" text, "Player" text, "Country" text, "To par" text, "Hole" real )
How many holes does Player Vijay Singh have?
SELECT COUNT("Hole") FROM table_7279 WHERE "Player" = 'vijay singh'
wikisql
CREATE TABLE table_name_49 ( runner_up VARCHAR, year VARCHAR, champion VARCHAR )
Which Runner-up has a Year smaller than 2008, and a Champion of jos acasuso?
SELECT runner_up FROM table_name_49 WHERE year < 2008 AND champion = "josé acasuso"
sql_create_context
CREATE TABLE table_51465 ( "Driver" text, "Constructor" text, "Laps" text, "Time/Retired" text, "Grid" text )
What's the time for someone on grid 9?
SELECT "Time/Retired" FROM table_51465 WHERE "Grid" = '9'
wikisql
CREATE TABLE table_name_17 ( final_placing VARCHAR, season VARCHAR )
What was the 2009 final placing?
SELECT final_placing FROM table_name_17 WHERE season = 2009
sql_create_context
CREATE TABLE zyjybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH number, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, ...
患者卫夏岚以前出现过哪些异常的反应
SELECT * 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_MZJZJLB AND zyjybgb.YLJGDM = jyjgzb...
css
CREATE TABLE table_name_76 ( bsu_head_coach VARCHAR, opponent VARCHAR, year VARCHAR )
Who is the BSU head coach of the tournament after 1994 with louisville as the opponent?
SELECT bsu_head_coach FROM table_name_76 WHERE opponent = "louisville" AND year > 1994
sql_create_context
CREATE TABLE table_71497 ( "Direction" text, "Name" text, "Japanese" text, "Terminals" text, "Length (km)" real )
What line is 24.7 km and head towards Toyohashi East?
SELECT "Name" FROM table_71497 WHERE "Direction" = 'toyohashi east' AND "Length (km)" = '24.7'
wikisql
CREATE TABLE Ref_Budget_Codes ( Budget_Type_Code CHAR(15), Budget_Type_Description VARCHAR(255) ) CREATE TABLE Statements ( Statement_ID INTEGER, Statement_Details VARCHAR(255) ) CREATE TABLE Documents_with_Expenses ( Document_ID INTEGER, Budget_Type_Code CHAR(15), Document_Details VARCHAR...
Give me a bar chart for the total number of each budget type code, I want to sort x axis in asc order.
SELECT Budget_Type_Code, COUNT(*) FROM Documents_with_Expenses GROUP BY Budget_Type_Code ORDER BY Budget_Type_Code
nvbench
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...
Comments telling people to migrate to ELL.
SELECT Id AS "post_link", Score, ClosedDate FROM Posts AS P WHERE P.Id IN (SELECT PostId FROM Comments WHERE Text LIKE '%on ELL%' OR Text LIKE '%on English Language Learners%') AND PostTypeId = 1 ORDER BY Id
sede
CREATE TABLE table_76412 ( "Name" text, "Championship" real, "FA Cup" real, "League Cup" real, "Total" real )
What is the total championships of James Henry that has a league cup more than 1?
SELECT SUM("Championship") FROM table_76412 WHERE "League Cup" > '1' AND "Name" = 'james henry'
wikisql
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId ...
Comments asking for a jurisdiction on a question.
SELECT Posts.Id AS "post_link", Comments.Text FROM Comments, Posts WHERE Text LIKE '%which%jurisdiction%' AND Comments.PostId = Posts.Id AND Posts.PostTypeId = 1
sede
CREATE TABLE table_11562 ( "HP Model" text, "Command Set" text, "# FDD" real, "FDD Type" text, "Sides" text, "FDD Capacity (each)" text, "# HDD" real, "HDD Capacity" text )
Tell me the HDD capacity for # FDD larger than 0 when FDD capacity is 710kb
SELECT "HDD Capacity" FROM table_11562 WHERE "# FDD" > '0' AND "FDD Capacity (each)" = '710kb'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, ...
找出在医院7077773的就诊记录里范修然的记录,其中入院时科室名字要有药房的
SELECT * FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '范修然' AND hz_info.YLJGDM = '7077773' AND zyjzjlb.JZKSMC LIKE '%药房%'
css
CREATE TABLE table_39494 ( "Rank" real, "Player" text, "Country" text, "Earnings ( $ )" real, "Wins" real )
What's the smallest amount of earnings when the wins are less than 72 and the rank is more than 3?
SELECT MIN("Earnings ( $ )") FROM table_39494 WHERE "Wins" < '72' AND "Rank" > '3'
wikisql
CREATE TABLE Students ( student_id INTEGER, date_of_registration DATETIME, date_of_latest_logon DATETIME, login_name VARCHAR(40), password VARCHAR(10), personal_name VARCHAR(40), middle_name VARCHAR(40), family_name VARCHAR(40) ) CREATE TABLE Course_Authors_and_Tutors ( author_id IN...
Find the number of courses for each subject in a bar chart, and list by the Y in asc please.
SELECT subject_name, COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id GROUP BY T1.subject_id ORDER BY COUNT(*)
nvbench
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, d...
how many days has passed since patient 739 last received a lab test for hematocrit in this hospital encounter?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', labevents.charttime)) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'hematocrit') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 739 AND admissions...
mimic_iii
CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_...
Are there any FIN classes besides on Friday ?
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course_offering.friday = 'N' AND course.department = 'FIN' AND semester.semester = 'WN' AND se...
advising
CREATE TABLE table_10156 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Which home team has an away team score of 4.9 (33)?
SELECT "Home team" FROM table_10156 WHERE "Away team score" = '4.9 (33)'
wikisql
CREATE TABLE table_name_98 ( average INTEGER, week VARCHAR, yards VARCHAR, team VARCHAR )
Which Average has Yards larger than 167, and a Team of at tb, and a Week larger than 7?
SELECT MIN(average) FROM table_name_98 WHERE yards > 167 AND team = "at tb" AND week > 7
sql_create_context
CREATE TABLE table_44967 ( "Pollutant" text, "Type" text, "Standard" text, "Averaging Time" text, "Regulatory Citation" text )
what is the standard when the pollutant is o 3 and averaging time is 8-hour?
SELECT "Standard" FROM table_44967 WHERE "Pollutant" = 'o 3' AND "Averaging Time" = '8-hour'
wikisql
CREATE TABLE table_name_52 ( opponent VARCHAR, date VARCHAR )
Which Opponent was played on 1991-10-13?
SELECT opponent FROM table_name_52 WHERE date = "1991-10-13"
sql_create_context
CREATE TABLE table_42914 ( "m\u00e5cha" text, "indicative" text, "imperative" text, "subjunctive" text, "inverse subjunctive" text )
What subjunctive also has an inverse subjunctive of m chadns?
SELECT "subjunctive" FROM table_42914 WHERE "inverse subjunctive" = 'måchadns'
wikisql
CREATE TABLE table_204_850 ( id number, "name" text, "railway" text, "series" text, "maker" text, "dates" text, "drive" text, "wheel arrangement" text, "weight" text, "power" text, "notes" text )
how many locomotives make the list of the largest locomotives ?
SELECT COUNT("name") FROM table_204_850
squall
CREATE TABLE table_69241 ( "Team 1" text, "Agg." text, "Team 2" text, "1st leg" text, "2nd leg" text )
What team 2 had a second leg of 3-2?
SELECT "Team 2" FROM table_69241 WHERE "2nd leg" = '3-2'
wikisql
CREATE TABLE table_10700 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Attendance" real, "Record" text )
How many people were in attendance for the game with a score of 98 111?
SELECT SUM("Attendance") FROM table_10700 WHERE "Score" = '98–111'
wikisql
CREATE TABLE table_80455 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
Which loss has an attendance greater than 49,688 and 11-8 as the record?
SELECT "Loss" FROM table_80455 WHERE "Attendance" > '49,688' AND "Record" = '11-8'
wikisql
CREATE TABLE fzzmzjzjlb ( 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...
列出患者20499920在10年5月11日到20年4月9日内被开出的所有检验报告单的检验报告单号是多少?
SELECT jybgb.BGDH FROM hz_info JOIN zzmzjzjlb JOIN jybgb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '20499920' AND jybgb.BGRQ BETWEEN '2010-05-11' AND '2020-...
css
CREATE TABLE table_11677691_1 ( position VARCHAR, hometown VARCHAR )
What position did the player from Jersey City, New Jersey play?
SELECT position FROM table_11677691_1 WHERE hometown = "Jersey City, New Jersey"
sql_create_context
CREATE TABLE table_204_988 ( id number, "responsible minister(s)" text, "crown entities" text, "monitoring department(s)" text, "category / type" text, "empowering legislation" text )
which monitoring department is listed the most ?
SELECT "monitoring department(s)" FROM table_204_988 GROUP BY "monitoring department(s)" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
54857048630这个住院就诊的出院病区叫什么?代码是什么?以及出院的床位是哪一个
SELECT wdmzjzjlb.CYBQDM, wdmzjzjlb.CYBQMC, wdmzjzjlb.CYCWH FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '54857048630' UNION SELECT bdmzjzjlb.CYBQDM, bdmzjzjlb.CYBQMC, bdmzjzjlb.CYCWH FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '54857048630'
css
CREATE TABLE table_16469 ( "No. in season" real, "No. in series" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (million)" text )
How many millions of views in the country watched 'Line of Departure'?
SELECT "U.S. viewers (million)" FROM table_16469 WHERE "Title" = 'Line of Departure'
wikisql
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test...
A 800 lab , does one exist ?
SELECT COUNT(*) > 0 FROM course WHERE department = 'EECS' AND has_lab = 'Y' AND number = 800
advising
CREATE TABLE table_25355501_2 ( november_3 VARCHAR, august_21_22 VARCHAR )
What is shown for november 3 when august 21-22 is august 22, 1998?
SELECT november_3 FROM table_25355501_2 WHERE august_21_22 = "August 22, 1998"
sql_create_context
CREATE TABLE table_30209 ( "Event Date" text, "Event Day" text, "Approx. Duration" text, "Starting Time" text, "Event Details" text )
How many event dates occurred when event details were women's sabre?
SELECT COUNT("Event Date") FROM table_30209 WHERE "Event Details" = 'Women''s Sabre'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
Give me the number of patients diagnosed with chronic kidney disease nos and have drug route as sc.
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.short_title = "Chronic kidney dis NOS" AND prescriptions.route = "SC"
mimicsql_data
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, ...
what is the number of urgent hospital admission patients for whom joint fluid lab test was ordered?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "URGENT" AND lab.fluid = "Joint Fluid"
mimicsql_data
CREATE TABLE film_market_estimation ( estimation_id number, low_estimate number, high_estimate number, film_id number, type text, market_id number, year number ) CREATE TABLE market ( market_id number, country text, number_cities number ) CREATE TABLE film ( film_id number,...
Return the average gross sales in dollars across all films.
SELECT AVG(gross_in_dollar) FROM film
spider
CREATE TABLE table_15300 ( "Club" text, "Winners" text, "Finalists" text, "Winning editions" text, "Not winning editions" text )
Who is Winners that has editions of 1992, 2003 as Not Winning
SELECT "Winners" FROM table_15300 WHERE "Not winning editions" = '1992, 2003'
wikisql
CREATE TABLE table_6481 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
Which score has a visitor of New York?
SELECT "Score" FROM table_6481 WHERE "Visitor" = 'new york'
wikisql
CREATE TABLE zyjybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH number, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, ...
为病人陶宏伯检测降钙素原的在06年5月31日到21年10月31日内的医务人员工号及姓名都是什么?
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM 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_MZJZJLB ...
css
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, ...
give me the number of patients whose diagnoses short title is b-complex defic nec and lab test abnormal status is abnormal?
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 = "B-complex defic NEC" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE table_name_75 ( unit VARCHAR, authors VARCHAR )
What is varricchio's unit?
SELECT unit FROM table_name_75 WHERE authors = "varricchio"
sql_create_context
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...
count the number of patients who in this year had an intake of iv flush.
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT intakeoutput.patientunitstayid FROM intakeoutput WHERE intakeoutput.celllabel = 'iv flush' AND intakeoutput.cellpath LIKE '%input%' AND DATETIME(intakeoutput.intakeoutputtime, 'start of year') = DATETIME(CURRENT_TIME(), 'st...
eicu
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime t...
calculate the duration of stay of patient 017-87754 of the first hospital stay.
SELECT STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', patient.hospitaladmittime) FROM patient WHERE patient.uniquepid = '017-87754' AND NOT patient.hospitaladmittime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1
eicu
CREATE TABLE table_name_87 ( date VARCHAR, tournament VARCHAR )
What is Date, when Tournament is Alfred Dunhill Championship 1?
SELECT date FROM table_name_87 WHERE tournament = "alfred dunhill championship 1"
sql_create_context
CREATE TABLE table_14903491_1 ( year VARCHAR, womens_doubles VARCHAR )
Name the year for victoria hristova neli nedialkova
SELECT year FROM table_14903491_1 WHERE womens_doubles = "Victoria Hristova Neli Nedialkova"
sql_create_context
CREATE TABLE people ( people_id number, name text, height number, weight number, home town text ) CREATE TABLE perpetrator ( perpetrator_id number, people_id number, date text, year number, location text, country text, killed number, injured number )
List the names of people that are not perpetrators.
SELECT name FROM people WHERE NOT people_id IN (SELECT people_id FROM perpetrator)
spider
CREATE TABLE table_2597876_2 ( year VARCHAR, avg_start VARCHAR )
What is every year with average start of 27.2?
SELECT year FROM table_2597876_2 WHERE avg_start = "27.2"
sql_create_context
CREATE TABLE table_23502 ( "No. in series" text, "No. in season" text, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (millions)" text )
How many millions of people in the US saw the episode with production code 214?
SELECT "U.S. viewers (millions)" FROM table_23502 WHERE "Production code" = '214'
wikisql
CREATE TABLE table_51273 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text )
What was the record when chicago was the visiting team?
SELECT "Record" FROM table_51273 WHERE "Visitor" = 'chicago'
wikisql
CREATE TABLE engineer_visits ( engineer_visit_id number, contact_staff_id number, engineer_id number, fault_log_entry_id number, fault_status text, visit_start_datetime time, visit_end_datetime time, other_visit_details text ) CREATE TABLE engineer_skills ( engineer_id number, s...
How many assets does each third party company supply? List the count and the company id.
SELECT COUNT(*), T1.company_id FROM third_party_companies AS T1 JOIN assets AS T2 ON T1.company_id = T2.supplier_company_id GROUP BY T1.company_id
spider
CREATE TABLE table_79400 ( "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the average Gold entry for the Netherlands that also has a Bronze entry that is greater than 0?
SELECT AVG("Gold") FROM table_79400 WHERE "Nation" = 'netherlands' AND "Bronze" > '0'
wikisql
CREATE TABLE table_77515 ( "Name" text, "Position" text, "Height" text, "Weight" real, "Year" text, "Home Town" text, "High School" text )
What is the Name with a Year with freshman, and a Home Town with los angeles, ca, and a Height of 6 4?
SELECT "Name" FROM table_77515 WHERE "Year" = 'freshman' AND "Home Town" = 'los angeles, ca' AND "Height" = '6–4'
wikisql
CREATE TABLE table_19744915_3 ( order VARCHAR, public_vote VARCHAR )
what is the order when public vote was 18.155%
SELECT order FROM table_19744915_3 WHERE public_vote = "18.155%"
sql_create_context
CREATE TABLE table_77992 ( "Name" text, "Location" text, "Length in km (mi)" text, "Year Completed" text, "Line" text )
What year was the Line of Gardermobanen completed?
SELECT "Year Completed" FROM table_77992 WHERE "Line" = 'gardermobanen'
wikisql
CREATE TABLE table_25246 ( "Year" text, "Date" text, "Driver" text, "Team" text, "Manufacturer" text, "Laps" real, "Miles (km)" text, "Race Time" text, "Average Speed (mph)" text, "Report" text )
In what year was the average speed 92.68?
SELECT "Year" FROM table_25246 WHERE "Average Speed (mph)" = '92.68'
wikisql
CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE date_day ( ...
show me the flights that go from ATLANTA to WASHINGTON on THURSDAY mornings
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, days, flight WHERE ((CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name =...
atis
CREATE TABLE table_70796 ( "Player" text, "Height" real, "Position" text, "Year born" real, "Current Club" text )
What year was the Guard who currently plays for the Memphis Grizzlies born?
SELECT "Year born" FROM table_70796 WHERE "Position" = 'guard' AND "Current Club" = 'memphis grizzlies'
wikisql
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
enteral two kal hn had ever been given to patient 006-80884 on the first intensive care unit visit?
SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-80884') AND NOT patient.unitdischargetime IS NULL ORDER BY patient...
eicu
CREATE TABLE zyb ( CLINIC_ID 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, INSU_TYPE text, IN...
叫做钱曼珠的病人的医疗记录中哪些医疗费总额高于143.68元,其有啥病是入院诊断出来的,病的编号是啥?
SELECT qtb.IN_DIAG_DIS_CD, qtb.IN_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_NM = '钱曼珠' AND qtb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 143.68) UNION SELECT gyb.IN_DIAG_DIS_CD, gyb.IN_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_NM = '钱曼珠' AND gyb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINI...
css
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...
这位患者68694812过往有过哪些异常情况么?
SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.RYBH = '...
css
CREATE TABLE table_44303 ( "Date" text, "Round" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" real )
What was the result when the opponent was manchester united in venue h?
SELECT "Result" FROM table_44303 WHERE "Opponent" = 'manchester united' AND "Venue" = 'h'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost numbe...
when was last the systemicsystolic of patient 002-56853 measured since 07/25/2105?
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 = '002-56853')) AND NOT vitalperiodic.systemicsystolic...
eicu