context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_41643 ( "Date" text, "Home captain" text, "Away captain" text, "Venue" text, "Result" text )
What is the Date when the match Resulted in a draw?
SELECT "Date" FROM table_41643 WHERE "Result" = 'draw'
wikisql
CREATE TABLE table_name_91 ( work VARCHAR, result VARCHAR, year VARCHAR )
what is the work when the result is won and the year is after 2002?
SELECT work FROM table_name_91 WHERE result = "won" AND year > 2002
sql_create_context
CREATE TABLE table_34599 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
What was the record on March 22?
SELECT "Record" FROM table_34599 WHERE "Date" = 'march 22'
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, ...
how many prescriptions was prescribed since 2 years ago for aspirin 81 mg chewable tablet?
SELECT COUNT(*) FROM medication WHERE medication.drugname = 'aspirin 81 mg chewable tablet' AND DATETIME(medication.drugstarttime) >= DATETIME(CURRENT_TIME(), '-2 year')
eicu
CREATE TABLE table_273617_6 ( status VARCHAR )
What is the 2011 number (,000) when the status is separated?
SELECT 2011 AS _number__, 000 AS _ FROM table_273617_6 WHERE status = "Separated"
sql_create_context
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, pro...
i want a flight on TW from BOSTON to DENVER
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON...
atis
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 year of death is less than or equal to 2111 and lab test fluid is pleural?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2111.0" AND lab.fluid = "Pleural"
mimicsql_data
CREATE TABLE table_69836 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text )
Who had the placekicker position with a round above 10?
SELECT "Name" FROM table_69836 WHERE "Round" > '10' AND "Position" = 'placekicker'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE hz_info_mzjzjlb ( JZLSH number, YLJGDM number, mzjzjlb_id number ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text,...
名为任凌霜的病人有哪些检验报告单的检验结果指标均正常?列出这些检验报告的单号
SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB ...
css
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text,...
Would-be Diversity Badge Winners (alternate).
SELECT ROUND(t.Reputation / 5, -3) * 5, COUNT(t.Id) FROM (SELECT u.Id, u.Reputation FROM (SELECT a.OwnerUserId, pt.TagId FROM PostTags AS pt JOIN Posts AS q ON pt.PostId = q.Id JOIN Posts AS a ON a.ParentId = q.Id JOIN (SELECT * FROM Tags ORDER BY Count DESC LIMIT 40) AS t ON pt.TagId = t.Id GROUP BY a.OwnerUserId, pt....
sede
CREATE TABLE table_37341 ( "Player" text, "League" real, "Malaysia Cup" real, "FA Cup" real, "Total" real )
How many league cups for m patrick maria with 0 total?
SELECT SUM("League") FROM table_37341 WHERE "Player" = 'm patrick maria' AND "Total" < '0'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE cost ( costid number, ...
what was the name of that output that patient 015-8398 last had on the last intensive care unit visit?
SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-8398') AND NOT patient.unitdischargetime IS NULL ORDER B...
eicu
CREATE TABLE supplier_addresses ( supplier_id number, address_id number, date_from time, date_to time ) CREATE TABLE addresses ( address_id number, address_details text ) CREATE TABLE department_stores ( dept_store_id number, dept_store_chain_id number, store_name text, store_a...
Give the ids of the three products purchased in the largest amounts.
SELECT product_id FROM product_suppliers ORDER BY total_amount_purchased DESC LIMIT 3
spider
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE S...
Get all down votes on my posts.
SELECT v.CreationDate, pt.Name, CASE p.PostTypeId WHEN 1 THEN CONCAT('http://stackoverflow.com/q/', p.Id) ELSE CONCAT('http://stackoverflow.com/a/', p.Id) END AS Link, p.Title, p.Body FROM Votes AS v LEFT JOIN VoteTypes AS vt ON vt.Id = v.VoteTypeId LEFT JOIN Posts AS p ON v.PostId = p.Id LEFT JOIN PostTypes AS pt ON p...
sede
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 Votes ( Id number, PostId number, VoteTypeId nu...
# of posts on Stack Overflow.
SELECT COUNT(*) FROM Posts
sede
CREATE TABLE table_819 ( "Year" real, "Winner" text, "Language" text, "Artist" text, "Song" text, "Points" real, "Margin" real, "Second place" text, "Date" text, "Venue" text, "Location" text, "Participants" real )
where is hte second place winner from united kingdom?
SELECT "Winner" FROM table_819 WHERE "Second place" = 'United Kingdom'
wikisql
CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) ...
Show me about the distribution of meter_400 and ID in a bar chart.
SELECT meter_400, ID FROM swimmer
nvbench
CREATE TABLE table_name_7 ( venue VARCHAR, competition VARCHAR )
Which venue is the friendly match in?
SELECT venue FROM table_name_7 WHERE competition = "friendly match"
sql_create_context
CREATE TABLE table_train_67 ( "id" int, "corticosteroid_therapy" bool, "viral_infection" bool, "active_infection" bool, "hiv_infection" bool, "neutropenia" int, "receiving_prednisolone" int, "age" float, "NOUSE" float )
neutropenia as < 500 neutrophils / ul
SELECT * FROM table_train_67 WHERE neutropenia < 500
criteria2sql
CREATE TABLE table_name_52 ( name_of_ship VARCHAR, date VARCHAR )
Which ship was raided on 26 September 1940?
SELECT name_of_ship FROM table_name_52 WHERE date = "26 september 1940"
sql_create_context
CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Coun...
A bar chart shows the distribution of meter_500 and meter_100 , and list by the Y-axis in asc.
SELECT meter_500, meter_100 FROM swimmer ORDER BY meter_100
nvbench
CREATE TABLE table_78687 ( "Tournament" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text )
What is 2011, when 2010 is 'WTA Premier 5 Tournaments'?
SELECT "2011" FROM table_78687 WHERE "2010" = 'wta premier 5 tournaments'
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 prescriptions ( subject_id text, hadm_id...
what is maximum age of patients whose insurance is private and days of hospital stay is 8?
SELECT MAX(demographic.age) FROM demographic WHERE demographic.insurance = "Private" AND demographic.days_stay = "8"
mimicsql_data
CREATE TABLE table_10001 ( "Line name" text, "Opened" real, "Last extension" real, "Stations served" real, "Length" text, "Average Interstation" text, "Journeys made (per annum)" real )
What is the average opened year of the line with 59 stations served and more than 145,000,000 journeys made per annum?
SELECT AVG("Opened") FROM table_10001 WHERE "Stations served" = '59' AND "Journeys made (per annum)" > '145,000,000'
wikisql
CREATE TABLE table_53059 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the name of the home team that played against Hawthorn?
SELECT "Home team" FROM table_53059 WHERE "Away team" = 'hawthorn'
wikisql
CREATE TABLE table_46730 ( "Model" text, "Memory ( RAM )" text, "Storage ( flash )" text, "Operating system version" text, "Memory card" text, "Weight, dimensions" text, "Retail availability" text )
Which operating system has a storage (flash) of 128MB?
SELECT "Operating system version" FROM table_46730 WHERE "Storage ( flash )" = '128mb'
wikisql
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...
what is the age and diagnosis icd9 code of subject id 2560?
SELECT demographic.age, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "2560"
mimicsql_data
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...
慢性牙周炎的患者,门诊诊断的α-羟丁酸脱氢酶数值的平均值以及最值具体均是?
SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJ...
css
CREATE TABLE table_name_28 ( crowd VARCHAR, away_team VARCHAR )
Which Crowd has an Away team of st kilda?
SELECT crowd FROM table_name_28 WHERE away_team = "st kilda"
sql_create_context
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, ...
what are the four most commonly prescribed drugs that patients of the 60 or above were prescribed within 2 months after having been diagnosed with dmi ophth nt st uncntrld in a year before?
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE ...
mimic_iii
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDat...
select Body, Id,PostId,Text from Posts, Comments where Id=PostID.
SELECT Body, Posts.Id, Comments.PostId, Comments.Text FROM Posts, Comments WHERE Posts.Id = Comments.PostId ORDER BY Comments.Score LIMIT 5
sede
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, ...
what is average age of patients whose admission location is phys referral/normal deli and primary disease is celo-vessicle fistula?
SELECT AVG(demographic.age) FROM demographic WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND demographic.diagnosis = "CELO-VESSICLE FISTULA"
mimicsql_data
CREATE TABLE table_28211988_1 ( mens_doubles VARCHAR, mens_singles VARCHAR )
Who is everyone on the men's doubles when men's singles is Ma Wenge?
SELECT mens_doubles FROM table_28211988_1 WHERE mens_singles = "Ma Wenge"
sql_create_context
CREATE TABLE table_name_88 ( attendance INTEGER, score VARCHAR )
How many Attendances have a Score of 4 5? Question 4
SELECT MAX(attendance) FROM table_name_88 WHERE score = "4 – 5"
sql_create_context
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAd...
Search posts by user and partial title.
SELECT p.Id AS "post_link", p.CreationDate, p.Score FROM Posts AS p LEFT OUTER JOIN Posts AS q ON p.ParentId = q.Id WHERE p.OwnerUserId = '##UserId:int##' AND COALESCE(p.Title, q.Title) LIKE '%##Query##%' ORDER BY p.CreationDate DESC
sede
CREATE TABLE table_name_45 ( height__m_ INTEGER, peak VARCHAR, class VARCHAR, prom__m_ VARCHAR )
What is the average height for hewitt class, with prom less than 86, and a Peak of gragareth?
SELECT AVG(height__m_) FROM table_name_45 WHERE class = "hewitt" AND prom__m_ < 86 AND peak = "gragareth"
sql_create_context
CREATE TABLE table_55049 ( "Name" text, "Model" text, "Park" text, "Opened" text, "Status" text )
What is the name of the coaster that opened in 2011 and is a euro-fighter model?
SELECT "Name" FROM table_55049 WHERE "Model" = 'euro-fighter' AND "Opened" = '2011'
wikisql
CREATE TABLE table_16351 ( "Year" text, "Division" text, "League" text, "Reg. Season" text, "Playoffs" text, "Avg. Attendance" real )
What is the division for the division semifinals playoffs?
SELECT "Division" FROM table_16351 WHERE "Playoffs" = 'Division Semifinals'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
Bring the list of patients with hyperglycemia (hyponatremia) as their primary disease who are discharged to snf.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SNF" AND demographic.diagnosis = "HYPERGLYCEMIA;HYPONATREMIA"
mimicsql_data
CREATE TABLE table_name_45 ( bronze INTEGER, silver INTEGER )
Name the least bronze for silver being less than 0
SELECT MIN(bronze) FROM table_name_45 WHERE silver < 0
sql_create_context
CREATE TABLE table_name_75 ( nationality VARCHAR, player VARCHAR, position VARCHAR, round VARCHAR )
What nationality has a position of left wing, and a round greater than 4, with mattia baldi as the player?
SELECT nationality FROM table_name_75 WHERE position = "left wing" AND round > 4 AND player = "mattia baldi"
sql_create_context
CREATE TABLE table_203_489 ( id number, "year" number, "title" text, "system" text, "developer" text, "publisher" text )
how many games were produced from 1988 to 1993 ?
SELECT COUNT("title") FROM table_203_489 WHERE "year" >= 1988 AND "year" <= 1993
squall
CREATE TABLE table_name_75 ( character VARCHAR, artist VARCHAR, year VARCHAR )
who is the character when the artist is take and the year is before 2006?
SELECT character FROM table_name_75 WHERE artist = "take" AND year < 2006
sql_create_context
CREATE TABLE table_name_28 ( winning_score VARCHAR, tournament VARCHAR )
In the Phoenix Open, what was the winning score?
SELECT winning_score FROM table_name_28 WHERE tournament = "phoenix open"
sql_create_context
CREATE TABLE table_name_10 ( type VARCHAR, platform VARCHAR )
What is the type of electronic with the Gamecube Platform?
SELECT type FROM table_name_10 WHERE platform = "gamecube"
sql_create_context
CREATE TABLE prereq ( course_id varchar(8), prereq_id varchar(8) ) CREATE TABLE advisor ( s_ID varchar(5), i_ID varchar(5) ) CREATE TABLE course ( course_id varchar(8), title varchar(50), dept_name varchar(20), credits numeric(2,0) ) CREATE TABLE takes ( ID varchar(5), course_...
Bar chart x axis building y axis maximal capacity, show by the X-axis from high to low.
SELECT building, MAX(capacity) FROM classroom GROUP BY building ORDER BY building DESC
nvbench
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, ...
Python posts containing the mojibake ' '.
SELECT Id AS "post_link", Title, CreationDate, Tags FROM Posts WHERE Tags LIKE '%python%' AND Body LIKE '% %' ORDER BY CreationDate DESC LIMIT 25
sede
CREATE TABLE table_32164 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What date was there a crowd larger than 30,343?
SELECT "Date" FROM table_32164 WHERE "Crowd" > '30,343'
wikisql
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, even...
count the number of patients that are prescribed metoprolol tartrate in the same hospital encounter after having been diagnosed with abn react-cardiac cath until 3 years ago.
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title =...
mimic_iii
CREATE TABLE table_name_59 ( time_retired VARCHAR, grid VARCHAR, driver VARCHAR )
What was the time of the race for Driver Jarno Trulli on a grid smaller than 13?
SELECT time_retired FROM table_name_59 WHERE grid < 13 AND driver = "jarno trulli"
sql_create_context
CREATE TABLE race ( race_id number, name text, class text, date text, track_id text ) CREATE TABLE track ( track_id number, name text, location text, seating number, year_opened number )
What are the names and dates of races, and the names of the tracks where they are held?
SELECT T1.name, T1.date, T2.name FROM race AS T1 JOIN track AS T2 ON T1.track_id = T2.track_id
spider
CREATE TABLE table_name_27 ( award VARCHAR, year VARCHAR, result VARCHAR, category VARCHAR )
For the category of most popular star with a result of won for 2007, what was the award?
SELECT award FROM table_name_27 WHERE result = "won" AND category = "most popular star" AND year = 2007
sql_create_context
CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number, ZZBZ number, WDBZ number, JZKSBM text, JZKSMC text, JZKSRQ time, ...
沈志诚作为检测人在2001年7月4日到2009年2月9日期间为病患袁晶辉检验的结果指标记录的检验指标流水号都是多少?
(SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM =...
css
CREATE TABLE table_56673 ( "Outcome" text, "Tournament" text, "Surface" text, "Partnering" text, "Score in the final" text )
What score in the final had a tournament of $25,000 Glasgow, Great Britain?
SELECT "Score in the final" FROM table_56673 WHERE "Tournament" = '$25,000 glasgow, great britain'
wikisql
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
是否所有的费用明细项目都结算好了,就是72791261819的那次医疗就诊
SELECT (SELECT SUM(STA_FLG) FROM t_kc22 WHERE MED_CLINIC_ID = '72791261819') = (SELECT COUNT(*) FROM t_kc22 WHERE MED_CLINIC_ID = '72791261819')
css
CREATE TABLE table_name_44 ( method VARCHAR, record VARCHAR, res VARCHAR, round VARCHAR )
What is the method of the match with a win res., 1 round, and a 3-2 record?
SELECT method FROM table_name_44 WHERE res = "win" AND round = 1 AND record = "3-2"
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...
Number of users by reputation range (15K-75K). High rep users based on the amount of reputation they have earned per day
SELECT Id AS "user_link", DisplayName, Reputation, Location FROM Users WHERE (Reputation >= 15000) AND (Reputation <= 75000) ORDER BY Reputation DESC
sede
CREATE TABLE table_name_83 ( grid INTEGER, laps VARCHAR, time_retired VARCHAR, driver VARCHAR )
Tell me the lowest Grid for engine and driver of emerson fittipaldi with more laps than 70
SELECT MIN(grid) FROM table_name_83 WHERE time_retired = "engine" AND driver = "emerson fittipaldi" AND laps > 70
sql_create_context
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...
how many days have passed since the first heparin lock iv fluids of patient 004-86136 on this hospital encounter?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-86136'...
eicu
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 vitalperiodic ( vitalperiodici...
what are the four most frequently ordered procedures for patients who have previously received antiviral therapy - acyclovir within 2 months, since 2105?
SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'antiviral therapy - acyclovir' AND STRFT...
eicu
CREATE TABLE table_name_88 ( outcome VARCHAR, year VARCHAR, score VARCHAR )
What is the Outcome of the Match played after 2003 with a Score of 6 0, 6 3?
SELECT outcome FROM table_name_88 WHERE year > 2003 AND score = "6–0, 6–3"
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...
provide the number of patients whose days of hospital stay is greater than 14 and lab test name is bilirubin, direct?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "14" AND lab.label = "Bilirubin, Direct"
mimicsql_data
CREATE TABLE table_11707 ( "Date" text, "Course" text, "Distance" text, "Type" text, "Winner" text )
What was the course type on 22 May?
SELECT "Type" FROM table_11707 WHERE "Date" = '22 may'
wikisql
CREATE TABLE table_57108 ( "Pick #" real, "Player" text, "Nationality" text, "Position" text, "Team from" text, "League from" text )
What is the lowest pick from Elitserien (Sweden)?
SELECT MIN("Pick #") FROM table_57108 WHERE "League from" = 'elitserien (sweden)'
wikisql
CREATE TABLE table_204_25 ( id number, "rank" number, "mountain peak" text, "mountain range" text, "elevation" text, "prominence" text, "isolation" text, "location" text )
what is the tallest peak in the sierra nevadas ?
SELECT "mountain peak" FROM table_204_25 WHERE "mountain range" = 'sierra nevada' ORDER BY "elevation" DESC LIMIT 1
squall
CREATE TABLE table_name_64 ( year VARCHAR, championship VARCHAR )
How many years was there a peter jackson classic?
SELECT COUNT(year) FROM table_name_64 WHERE championship = "peter jackson classic"
sql_create_context
CREATE TABLE competition ( Competition_ID int, Year real, Competition_type text, Country text ) CREATE TABLE competition_result ( Competition_ID int, Club_ID_1 int, Club_ID_2 int, Score text ) CREATE TABLE club ( Club_ID int, name text, Region text, Start_year text ) C...
A stacked bar chart about the total number in each competition type, and then split by country, and rank by the y axis in desc please.
SELECT Country, COUNT(Country) FROM competition GROUP BY Competition_type, Country ORDER BY COUNT(Country) DESC
nvbench
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 ...
列出患者苏明知从06年8月16日到2010年2月4日内检测人为14927928的所有检验结果指标记录的检验指数流水编号都是啥?
SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jy...
css
CREATE TABLE table_43408 ( "Year (Ceremony)" text, "Film title used in nomination" text, "Serbian title" text, "Director" text, "Result" text )
What is the Film title used in nomination of the Film with a Serbian title of ?
SELECT "Film title used in nomination" FROM table_43408 WHERE "Serbian title" = 'бело одело'
wikisql
CREATE TABLE table_8802 ( "Runs" text, "Wicket" text, "Batting partners" text, "Batting team" text, "Fielding team" text, "Venue" text, "Season" text )
What batting team played in Chittagong in 2003?
SELECT "Batting team" FROM table_8802 WHERE "Venue" = 'chittagong' AND "Season" = '2003'
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...
编号94613392270的医疗就诊中,超过12份检验报告单的有哪些报告人,把这些报告人的工号还有名字列出来
SELECT zyjybgb.BGRGH, zyjybgb.BGRXM FROM zyjybgb WHERE zyjybgb.JZLSH = '94613392270' GROUP BY zyjybgb.BGRGH HAVING COUNT(*) > 12 UNION SELECT mzjybgb.BGRGH, mzjybgb.BGRXM FROM mzjybgb WHERE mzjybgb.JZLSH = '94613392270' GROUP BY mzjybgb.BGRGH HAVING COUNT(*) > 12
css
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, ...
show me the flights from MIAMI to DENVER
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 = 'MIAMI' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' ...
atis
CREATE TABLE table_57630 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
What is the total grid number where the time/retired is +58.182 and the lap number is less than 67?
SELECT SUM("Grid") FROM table_57630 WHERE "Time/Retired" = '+58.182' AND "Laps" < '67'
wikisql
CREATE TABLE gyb ( 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...
患者一旦被诊断出疾病U14.078,被开出的药品的编号和名称有哪些
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.IN_DIAG_DIS_CD = 'U14.078' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.IN_DIAG_DIS_CD = 'U14.078' UN...
css
CREATE TABLE table_name_94 ( average_attendance INTEGER, season VARCHAR )
What was the highest average attendance in the 2009 season?
SELECT MAX(average_attendance) FROM table_name_94 WHERE season = "2009"
sql_create_context
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, Revision...
Top users by bounties on Writing.SE.
SELECT UserId AS "user_link", SUM(BountyAmount) FROM Votes WHERE NOT BountyAmount IS NULL AND VoteTypeId = 8 GROUP BY UserId ORDER BY SUM(BountyAmount) DESC
sede
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 mzjybgb ( BBCJBW text, BBDM t...
找一下95467860患者64688433912那次医疗就诊的检验报告单
SELECT * FROM zyjybgb WHERE zyjybgb.JZLSH = '64688433912' UNION SELECT * FROM mzjybgb WHERE mzjybgb.JZLSH = '64688433912'
css
CREATE TABLE table_40651 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Record" text )
Which date had the Hornets as the home team?
SELECT "Date" FROM table_40651 WHERE "Home" = 'hornets'
wikisql
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...
能知道患者39646244在2005.11.19到2013.12.1这段期间做过的检查次数吗
SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '39646244' AND t_kc22.STA_DATE BETWEEN '2005-11-19' AND '2013-12-01' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
Top answers by score or the year.
SELECT Id AS "post_link", Score FROM Posts AS p WHERE YEAR(CreationDate) = '##year?2016##' AND p.PostTypeId = 2 ORDER BY Score DESC LIMIT 10
sede
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE flight ( aircraft_code_sequence text, ...
what is the fare from BOSTON to OAKLAND on UA
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city...
atis
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JO...
For employees with first names that end with the letter m, groups and count the first name to visualize a bar graph, and could you display in desc by the x-axis?
SELECT FIRST_NAME, COUNT(FIRST_NAME) FROM employees WHERE FIRST_NAME LIKE '%m' GROUP BY FIRST_NAME ORDER BY FIRST_NAME DESC
nvbench
CREATE TABLE table_3441 ( "Actor/Actress" text, "Character" text, "First Appearance" text, "Last Appearance" text, "Duration" text, "Total" real )
Who was the actor/actress with a first appearance is 3 june 2007?
SELECT "Actor/Actress" FROM table_3441 WHERE "First Appearance" = '3 June 2007'
wikisql
CREATE TABLE table_78295 ( "Pick" real, "Round" text, "Player" text, "Position" text, "School" text )
What is the highest pick from Washington?
SELECT MAX("Pick") FROM table_78295 WHERE "School" = 'washington'
wikisql
CREATE TABLE table_54471 ( "Rank" real, "Player" text, "Country" text, "Earnings ( $ )" real, "Events" real, "Wins" real )
What are the earnings for jim colbert with under 4 wins?
SELECT COUNT("Earnings ( $ )") FROM table_54471 WHERE "Player" = 'jim colbert' AND "Wins" < '4'
wikisql
CREATE TABLE table_30759 ( "No in. series" real, "No in. season" real, "Title" text, "Original air date" text, "Production Code" real, "U.S. viewers (millions)" text )
What is the highest production code of the episodes having a US viewership of exactly 2.3?
SELECT MAX("Production Code") FROM table_30759 WHERE "U.S. viewers (millions)" = '2.3'
wikisql
CREATE TABLE table_name_13 ( february VARCHAR, september VARCHAR )
Who is in February where has September is kristine hanson?
SELECT february FROM table_name_13 WHERE september = "kristine hanson"
sql_create_context
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...
70863313952的检验结果指标记录是什么检测项目名称,其相对应的检测指标代码及名称、检测方法又是什么
SELECT jyjgzbb.JCXMMC, jyjgzbb.JCZBDM, jyjgzbb.JCZBMC, jyjgzbb.JCFF FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '70863313952'
css
CREATE TABLE table_name_68 ( runners INTEGER, jockey VARCHAR, placing VARCHAR )
what is the highest runners when the jockey is frankie dettori and the placing is higher than 1?
SELECT MAX(runners) FROM table_name_68 WHERE jockey = "frankie dettori" AND placing > 1
sql_create_context
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 int, capacity int, pay_load int, cruising_speed int, range_...
i would like to find a flight that goes from BOSTON to ORLANDO i would like it to have a stop in NEW YORK and i would like a flight that serves BREAKFAST
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop, food_service WHERE ((CITY_2.city_code = AIRPORT_SERVICE_2.city_code AND CITY_2.city_name = 'NEW YOR...
atis
CREATE TABLE Product_Suppliers ( product_id INTEGER, supplier_id INTEGER, date_supplied_from DATETIME, date_supplied_to DATETIME, total_amount_purchased VARCHAR(80), total_value_purchased DECIMAL(19,4) ) CREATE TABLE Department_Stores ( dept_store_id INTEGER, dept_store_chain_id INTEGER...
Return the names and ids of customers who have TN in their address by a bar chart, and sort in ascending by the y axis please.
SELECT customer_name, customer_id FROM Customers WHERE customer_address LIKE "%TN%" ORDER BY customer_id
nvbench
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, sh...
when did patient 45316 recieve tissue microbiology test for the last time since 58 months ago?
SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 45316) AND microbiologyevents.spec_type_desc = 'tissue' AND DATETIME(microbiologyevents.charttime) >= DATETIME(CURRENT_TIME(), '-58 month') ORDER BY mi...
mimic_iii
CREATE TABLE table_9335 ( "Game" real, "March" real, "Opponent" text, "Score" text, "Record" text )
what is the score when the game is higher than 66 on march 28?
SELECT "Score" FROM table_9335 WHERE "Game" > '66' AND "March" = '28'
wikisql
CREATE TABLE table_44001 ( "Player" text, "Nationality" text, "Position" text, "Years for Grizzlies" text, "School/Club Team" text )
What position did Rich Manning play?
SELECT "Position" FROM table_44001 WHERE "Player" = 'rich manning'
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...
give me the number of office admitted patients who had endoscopic retrograde cholangiopancreatography procedure.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND procedures.short_title = "Endosc retro cholangiopa"
mimicsql_data
CREATE TABLE table_15187735_15 ( segment_a VARCHAR, segment_c VARCHAR )
What is Segment A where Segment C is Sushi (part 1)?
SELECT segment_a FROM table_15187735_15 WHERE segment_c = "Sushi (Part 1)"
sql_create_context
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal...
For those employees who was hired before 2002-06-21, find hire_date and the sum of department_id bin hire_date by weekday, and visualize them by a bar chart, could you order from high to low by the y axis please?
SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(DEPARTMENT_ID) DESC
nvbench
CREATE TABLE table_50441 ( "Fin. Pos" text, "Car No." text, "Driver" text, "Team" text, "Laps" text, "Time/Retired" text, "Grid" text, "Laps Led" text, "Points" text )
Which driver had 35+3 points?
SELECT "Driver" FROM table_50441 WHERE "Points" = '35+3'
wikisql
CREATE TABLE table_77247 ( "Round" real, "Player" text, "Position" text, "Nationality" text, "College/Junior/Club Team (League)" text )
What position did Luca Sbisa play for the Philadelphia Flyers?
SELECT "Position" FROM table_77247 WHERE "Player" = 'luca sbisa'
wikisql
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE procedures_icd ( ...
how many patients were diagnosed with dmii oth nt st uncntrld but did not come back to the hospital within 2 months until 2 years ago?
SELECT (SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'dmii oth n...
mimic_iii