context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
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 patients who had iron lab tests done?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "Iron"
mimicsql_data
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD...
在2007年2月6日到2018年12月21日内,查出编号为1388267的医院非科室72353负责的所有医疗就诊记录
SELECT * FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '1388267' AND t_kc21.IN_HOSP_DATE BETWEEN '2007-02-06' AND '2018-12-21' EXCEPT SELECT * FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '1388267' AND t_kc21.IN_HOSP_DATE BETWEEN '2007-02-06' AND '2018-12-21' AND t_kc21.MED_ORG_DEPT_CD = '72353'
css
CREATE TABLE table_name_16 ( date VARCHAR, visiting_team VARCHAR )
Tell me the date for pittsburgh steelers
SELECT date FROM table_name_16 WHERE visiting_team = "pittsburgh steelers"
sql_create_context
CREATE TABLE table_50793 ( "Event" text, "Long Course/Short Course" text, "Year Set" real, "Time" text, "Meet" text )
What was the latest year that had a 100m freestyle?
SELECT MAX("Year Set") FROM table_50793 WHERE "Event" = '100m freestyle'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ...
what is primary disease and lab test fluid of subject name wilbur braatz?
SELECT demographic.diagnosis, lab.fluid FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = "Wilbur Braatz"
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 ) ...
how many patients whose discharge location is short term hospital and year of birth is less than 2076?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND demographic.dob_year < "2076"
mimicsql_data
CREATE TABLE table_name_98 ( date VARCHAR, winning_score VARCHAR )
When has a Winning score of 16 (70-65-65=200)?
SELECT date FROM table_name_98 WHERE winning_score = –16(70 - 65 - 65 = 200)
sql_create_context
CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE field ( fieldid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABL...
most common topics at ACL 2014
SELECT DISTINCT COUNT(paper.paperid), keyphrase.keyphraseid FROM keyphrase, paper, paperkeyphrase, venue WHERE paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year = 2014 AND venue.venueid = paper.venueid AND venue.venuename = 'ACL' GROUP BY keyphrase.keyphraseid ...
scholar
CREATE TABLE table_name_16 ( date VARCHAR, road_team VARCHAR, game VARCHAR )
Which Date has a Road team of portland, and a Game of game 5?
SELECT date FROM table_name_16 WHERE road_team = "portland" AND game = "game 5"
sql_create_context
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostLin...
Top SO users from Arizona.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE Reputation >= (SELECT Reputation FROM Users WHERE Id = 5285908) AND (UPPER(Location) LIKE '% AZ%' OR UPPER(Location) LIKE '% ARIZONA%') ORDER BY Reputation DESC
sede
CREATE TABLE Movie ( mID int, title text, year int, director text ) CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) CREATE TABLE Reviewer ( rID int, name text )
Please tell me the average star ratings of each movie title using a bar chart, and could you show by the bar in desc?
SELECT title, AVG(stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY title ORDER BY title DESC
nvbench
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, ...
count the number of patients on buccal route of drug administration who were admitted before the year 2173.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2173" AND prescriptions.route = "BUCCAL"
mimicsql_data
CREATE TABLE table_name_74 ( place VARCHAR, player VARCHAR )
What place did Lee Westwood finish in?
SELECT place FROM table_name_74 WHERE player = "lee westwood"
sql_create_context
CREATE TABLE table_203_204 ( id number, "year" number, "film" text, "language" text, "actors" text, "music" text, "banner" text, "note" text )
what was the last film directed by c. v. sridhar ?
SELECT "film" FROM table_203_204 ORDER BY "year" DESC LIMIT 1
squall
CREATE TABLE table_name_61 ( games VARCHAR, bronze VARCHAR, gold VARCHAR )
Which game had 8 bronze and 4 gold?
SELECT games FROM table_name_61 WHERE bronze = "8" AND gold = "4"
sql_create_context
CREATE TABLE table_4498 ( "Name" text, "Pole Position" text, "Fastest Lap" text, "Winning driver" text, "Winning team" text, "Report" text )
Who was Kraco Twin 125 (R2)'s Winning Driver?
SELECT "Winning driver" FROM table_4498 WHERE "Name" = 'kraco twin 125 (r2)'
wikisql
CREATE TABLE table_name_20 ( played VARCHAR, wins VARCHAR, goals_against VARCHAR )
How many played have 8 wins and more than 58 goals against?
SELECT COUNT(played) FROM table_name_20 WHERE wins = 8 AND goals_against > 58
sql_create_context
CREATE TABLE table_name_62 ( current_affiliation VARCHAR, years_owned VARCHAR )
What is the current affiliation when the years owned is between 1955 1995?
SELECT current_affiliation FROM table_name_62 WHERE years_owned = "1955–1995"
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, ...
get me the number of patients on iv route of drug administration who are diagnosed with closed fracture of surgical neck of humerus.
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 = "Fx surg nck humerus-clos" AND prescriptions.route = "IV"
mimicsql_data
CREATE TABLE table_67733 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text )
What's the lowest Overall average that has a College of Arkansas, and a Round larger than 3?
SELECT MIN("Overall") FROM table_67733 WHERE "College" = 'arkansas' AND "Round" > '3'
wikisql
CREATE TABLE table_23601 ( "Draw" real, "Artist" text, "Song" text, "Regions" real, "Studio Audience" real, "Press Jury" real, "Oil Rig" real, "Total Points" real, "Place" text )
How many points did the song with a draw number 3 get?
SELECT "Total Points" FROM table_23601 WHERE "Draw" = '3'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, ...
两千年十二月二十一日到一六年十二月二日,患者尤清润的二氧化碳情况是怎样的
SELECT * 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 = jyjgzbb.YLJGDM...
css
CREATE TABLE table_name_56 ( year INTEGER, partnering VARCHAR, championship VARCHAR )
What year was the US Open that had a partnering of Maikel Scheffers?
SELECT SUM(year) FROM table_name_56 WHERE partnering = "maikel scheffers" AND championship = "us open"
sql_create_context
CREATE TABLE table_name_13 ( year_left INTEGER, school VARCHAR, year_joined VARCHAR )
Which Year Left is the lowest one that has a School of calumet, and a Year Joined larger than 1993?
SELECT MIN(year_left) FROM table_name_13 WHERE school = "calumet" AND year_joined > 1993
sql_create_context
CREATE TABLE table_37024 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Notes" text )
Which Position has a Competition of world championships, and a Year larger than 1997?
SELECT "Position" FROM table_37024 WHERE "Competition" = 'world championships' AND "Year" > '1997'
wikisql
CREATE TABLE Ref_Shipping_Agents ( document_id VARCHAR, document_status_code VARCHAR, document_type_code VARCHAR ) CREATE TABLE Documents ( document_id VARCHAR, document_status_code VARCHAR, document_type_code VARCHAR )
List document id of documents status is done and document type is Paper and the document is shipped by shipping agent named USPS.
SELECT document_id FROM Documents WHERE document_status_code = "done" AND document_type_code = "Paper" INTERSECT SELECT document_id FROM Documents JOIN Ref_Shipping_Agents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Ref_Shipping_Agents.shipping_agent_name = "USPS"
sql_create_context
CREATE TABLE table_name_91 ( date VARCHAR, winner VARCHAR )
Ram Vaswani was a winner on what date?
SELECT date FROM table_name_91 WHERE winner = "ram vaswani"
sql_create_context
CREATE TABLE table_name_75 ( score VARCHAR, tie_no VARCHAR, home_team VARCHAR )
What is Score, when Tie No is Replay, and when Home Team is Sunderland?
SELECT score FROM table_name_75 WHERE tie_no = "replay" AND home_team = "sunderland"
sql_create_context
CREATE TABLE table_11922 ( "Tallangatta DFL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real )
What is the total number of byes that has 13 losses and wins less than 5?
SELECT COUNT("Byes") FROM table_11922 WHERE "Losses" = '13' AND "Wins" < '5'
wikisql
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_id varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, ...
As of right now , what 's my GPA ?
SELECT DISTINCT total_gpa FROM student WHERE student_id = 1
advising
CREATE TABLE table_22418 ( "Frequency" text, "Call sign" text, "Branding" text, "Format" text, "Owner" text, "Language/Rebroadcast" text )
When vista radio is the owner what is the frequency?
SELECT "Frequency" FROM table_22418 WHERE "Owner" = 'Vista Radio'
wikisql
CREATE TABLE table_56141 ( "Episode" text, "1st edition" text, "2nd edition" text, "3rd edition" text, "4th edition" text )
What is the 1st Edition for the Episode 4?
SELECT "1st edition" FROM table_56141 WHERE "Episode" = '4'
wikisql
CREATE TABLE table_name_92 ( points INTEGER, team VARCHAR, played VARCHAR )
What is the highest number of points team vit ria, which had more than 38 played, had?
SELECT MAX(points) FROM table_name_92 WHERE team = "vitória" AND played > 38
sql_create_context
CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE swimme...
A bar chart shows the distribution of meter_500 and ID , and I want to rank y axis from low to high order.
SELECT meter_500, ID FROM swimmer ORDER BY ID
nvbench
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text...
Get Question's Tag Data related Python.
SELECT questions.PyPostId AS Python_Questions FROM (SELECT p_tags.PostId AS PyPostId FROM Tags AS tag INNER JOIN PostTags AS p_tags ON tag.Id = p_tags.TagId INNER JOIN Posts AS posts ON Posts.Id = p_tags.PostId WHERE TagName = 'python') AS questions INNER JOIN Posts AS post ON questions.PyPostId = post.Id WHERE Creatio...
sede
CREATE TABLE table_name_41 ( engine VARCHAR, chassis VARCHAR )
Which engine has a Lotus 49c chassis?
SELECT engine FROM table_name_41 WHERE chassis = "lotus 49c"
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( ...
when patient 003-33922 was prescribed for the first time 2 ml : fentanyl citrate 0.05 mg/ml ij soln in 10/2102?
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '003-33922')) AND medication.drugname = '2 ml : fentanyl citrat...
eicu
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDat...
tridion thread volume, page views, unique OPs by month.
SELECT COUNT(*) AS Volume, SUM(ViewCount) AS PageViews, COUNT(DISTINCT OwnerUserId) AS UniqueOPs, TIME_TO_STR(P.CreationDate, '%Y') AS "year", TIME_TO_STR(P.CreationDate, '%m') AS Month FROM Posts AS P WHERE Tags LIKE '%<tridion%' AND PostTypeId = 1 AND CommunityOwnedDate IS NULL AND ClosedDate IS NULL GROUP BY TIME_TO...
sede
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...
what is the number of patients born before 2109 who are still living?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.dob_year < "2109"
mimicsql_data
CREATE TABLE table_43582 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
What method of resolution was the fight that took place at hardcore championship fighting: destiny?
SELECT "Method" FROM table_43582 WHERE "Event" = 'hardcore championship fighting: destiny'
wikisql
CREATE TABLE table_name_32 ( player VARCHAR, to_par VARCHAR, score VARCHAR )
Who had a to par of e and scored 71-69=140?
SELECT player FROM table_name_32 WHERE to_par = "e" AND score = 71 - 69 = 140
sql_create_context
CREATE TABLE table_name_14 ( label VARCHAR, region VARCHAR )
What was the label in Japan?
SELECT label FROM table_name_14 WHERE region = "japan"
sql_create_context
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...
方刚洁患者出院诊断疾病名称不包含牙隐裂在医院0788925的医疗就诊记录编码是多少呢?
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '方刚洁' AND t_kc21.MED_SER_ORG_NO = '0788925' AND NOT t_kc21.OUT_DIAG_DIS_NM LIKE '%牙隐裂%'
css
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, ...
Calculate the maximum age of patients who had pneumonia, human immunodeficiency virus (rule out tuberculosis) as their primary disease and remained admitted for 5 days.
SELECT MAX(demographic.age) FROM demographic WHERE demographic.diagnosis = "PNEUMONIA;HUMAN IMMUNODEFIENCY VIRUS;RULE OUT TUBERCULOSIS" AND demographic.days_stay = "5"
mimicsql_data
CREATE TABLE table_test_22 ( "id" int, "ejection_fraction_ef" int, "pregnancy_or_lactation" bool, "child_pugh_class" string, "hbv" bool, "systolic_blood_pressure_sbp" int, "active_infection" bool, "leukocyte_count" int, "hiv_infection" bool, "left_ventricular_dysfunction" bool, ...
with hepatic failure ( child _ pugh class b or c )
SELECT * FROM table_test_22 WHERE hepatic_disease = 1 OR child_pugh_class = 'b' OR child_pugh_class = 'c'
criteria2sql
CREATE TABLE table_19132 ( "Character Name" text, "Voice Actor (Japanese)" text, "Voice Actor (English 1997 / Saban)" text, "Voice Actor (English 1998 / Pioneer)" text, "Voice Actor (English 2006 / FUNimation)" text )
what's the character name with voice actor (englbeingh 1998 / pioneer) being paul dobson
SELECT "Character Name" FROM table_19132 WHERE "Voice Actor (English 1998 / Pioneer)" = 'Paul Dobson'
wikisql
CREATE TABLE volume ( Volume_ID int, Volume_Issue text, Issue_Date text, Weeks_on_Top real, Song text, Artist_ID int ) CREATE TABLE music_festival ( ID int, Music_Festival text, Date_of_ceremony text, Category text, Volume int, Result text ) CREATE TABLE artist ( Ar...
What is the distibution of results for each music festival? Could you show me the result with a bar chart, list from high to low by the x axis.
SELECT Result, COUNT(Result) FROM music_festival GROUP BY Result ORDER BY Result DESC
nvbench
CREATE TABLE table_1864 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real )
When joan tewkesbury is the director what is the number in seasons?
SELECT "No. in season" FROM table_1864 WHERE "Directed by" = 'Joan Tewkesbury'
wikisql
CREATE TABLE table_name_70 ( class VARCHAR, type VARCHAR, quantity VARCHAR )
Which class has less than 3 in quantity with a type of 4-6-0?
SELECT class FROM table_name_70 WHERE type = "4-6-0" AND quantity < 3
sql_create_context
CREATE TABLE table_26408 ( "Season" text, "Name" text, "Teams" real, "Relegated to league" text, "Promoted to league" text, "Promoted from league" text, "Relegated from league" text )
Who was relegated to league if Barking Birmingham & Solihull Stourbridge were relegated from league?
SELECT "Relegated to league" FROM table_26408 WHERE "Relegated from league" = 'Barking Birmingham & Solihull Stourbridge'
wikisql
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
Find All_Neutral and All_Games_Percent , and visualize them by a bar chart, and order y axis from high to low order.
SELECT All_Neutral, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent DESC
nvbench
CREATE TABLE table_7854 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text )
WHAT IS THE PLAYER WITH A SCORE OF 66?
SELECT "Player" FROM table_7854 WHERE "Score" = '66'
wikisql
CREATE TABLE table_name_71 ( to_par VARCHAR, player VARCHAR, place VARCHAR, country VARCHAR )
what was steve flesch's to par when he was placed at t3 in the united states?
SELECT to_par FROM table_name_71 WHERE place = "t3" AND country = "united states" AND player = "steve flesch"
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...
how many days has passed since the last time patient 006-105495 on the current intensive care unit visit took a 1/2ns + add intake?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', intakeoutput.intakeoutputtime)) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid =...
eicu
CREATE TABLE table_name_18 ( title VARCHAR, format VARCHAR, label VARCHAR )
What is the Title of the Pye Label mono LP release?
SELECT title FROM table_name_18 WHERE format = "mono lp" AND label = "pye"
sql_create_context
CREATE TABLE table_name_89 ( counting_method VARCHAR, basis VARCHAR )
What is the counting method for a network-centric basis?
SELECT counting_method FROM table_name_89 WHERE basis = "network-centric"
sql_create_context
CREATE TABLE table_name_63 ( crowd VARCHAR, away_team VARCHAR )
How many people watched the away team of Geelong?
SELECT crowd FROM table_name_63 WHERE away_team = "geelong"
sql_create_context
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...
根据6867593号医院的入院诊断患有的疾病名称不同的患者的平均年龄是多少?
SELECT gwyjzb.IN_DIAG_DIS_NM, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '6867593' GROUP BY gwyjzb.IN_DIAG_DIS_NM UNION SELECT fgwyjzb.IN_DIAG_DIS_NM, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '6867593' GROUP BY fgwyjzb.IN_DIAG_DIS_NM
css
CREATE TABLE table_69944 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real )
What chassis had fewer than 0 points in a year before 1954?
SELECT "Chassis" FROM table_69944 WHERE "Year" < '1954' AND "Points" = '0'
wikisql
CREATE TABLE table_106367_2 ( general_election VARCHAR, result VARCHAR, _percentage_of_popular_vote VARCHAR )
Which general election had a pq majority and a 44.75% of the popular vote?
SELECT general_election FROM table_106367_2 WHERE result = "PQ majority" AND _percentage_of_popular_vote = "44.75%"
sql_create_context
CREATE TABLE table_10937 ( "Round" text, "Pick" text, "Player" text, "Nationality" text, "School" text )
Which nationality's pick was 415?
SELECT "Nationality" FROM table_10937 WHERE "Pick" = '415'
wikisql
CREATE TABLE table_40963 ( "Average population (x 1000)" real, "Live births" real, "Deaths" real, "Natural change" real, "Crude birth rate (per 1000)" real, "Crude death rate (per 1000)" real, "Natural change (per 1000)" real )
What is the average Natural Change (Per 1000), when Crude Death Rate (Per 1000) is greater than 13.2, when Deaths is 4,142, and when Natural Change is less than 752?
SELECT AVG("Natural change (per 1000)") FROM table_40963 WHERE "Crude death rate (per 1000)" > '13.2' AND "Deaths" = '4,142' AND "Natural change" < '752'
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, ...
give me the number of patients whose admission year is less than 2165 and item id is 50990?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2165" AND lab.itemid = "50990"
mimicsql_data
CREATE TABLE table_28746 ( "Year" real, "Races" real, "Wins" real, "Poles" real, "Top 5" real, "Top 10" real, "DNF" real, "Finish" text, "Start" text, "Winnings" text, "Season Rank" text, "Team(s)" text )
What teams started at 39.1?
SELECT "Team(s)" FROM table_28746 WHERE "Start" = '39.1'
wikisql
CREATE TABLE table_22961 ( "Year" text, "Location" text, "Class 1" text, "Best UK team" text, "Class 1-200" text, "Class 3" text, "Class 1a" text )
Name the class 3 for silverstone rmit university
SELECT "Class 3" FROM table_22961 WHERE "Location" = 'Silverstone' AND "Class 1" = 'RMIT University'
wikisql
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...
从二00二年四月二十五日到二0二0年十二月二十一日这段时间,患者沈宾鸿检测超敏肌钙蛋白T找的哪些医务人员做的,这些医务人员的工号和姓名报一下
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb 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 = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH =...
css
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE diagn...
what's the number of days that have passed since patient 87232 last stayed in careunit micu on the current hospital visit?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 87232 AND admissions.dischtime IS NULL) AND transfers.careunit = 'micu' ORDER BY transfers.intime DESC LIMIT 1
mimic_iii
CREATE TABLE table_name_12 ( date VARCHAR, opponent VARCHAR, week VARCHAR, game_site VARCHAR )
Week smaller than 4, and a Game Site of rca dome, and a Opponent of new england patriots involves what date?
SELECT date FROM table_name_12 WHERE week < 4 AND game_site = "rca dome" AND opponent = "new england patriots"
sql_create_context
CREATE TABLE journal ( Journal_ID int, Date text, Theme text, Sales int ) CREATE TABLE editor ( Editor_ID int, Name text, Age real ) CREATE TABLE journal_committee ( Editor_ID int, Journal_ID int, Work_Type text )
Show the name of each editor and the number of journal committees they are on using a bar chart, and sort the total number in descending order please.
SELECT Name, COUNT(*) FROM editor AS T1 JOIN journal_committee AS T2 ON T1.Editor_ID = T2.Editor_ID GROUP BY T1.Editor_ID ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_name_52 ( competition VARCHAR, club VARCHAR )
What is the 1st leg of the UEFA Champions League Compeition in the Skonto Riga Club?
SELECT 1 AS st_leg FROM table_name_52 WHERE competition = "uefa champions league" AND club = "skonto riga"
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, ...
count the number of patients that have had a intraaortic balloon pump removal procedure two or more times since 2103.
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, COUNT(*) AS c1 FROM patient WHERE patient.patientunitstayid = (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'intraaortic balloon pump removal' AND STRFTIME('%y', treatment.treatmenttime) >= '2103') GROUP BY patient....
eicu
CREATE TABLE table_name_57 ( country VARCHAR, label VARCHAR )
What country has the label Control?
SELECT country FROM table_name_57 WHERE label = "control"
sql_create_context
CREATE TABLE table_name_46 ( attendance INTEGER, record VARCHAR )
What attendance does 1-6 record have?
SELECT SUM(attendance) FROM table_name_46 WHERE record = "1-6"
sql_create_context
CREATE TABLE table_55807 ( "Position" real, "Club" text, "Played" real, "Points" text, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real )
What is the goal difference sum that has goals against smaller than 33, draws larger than 13?
SELECT SUM("Goal Difference") FROM table_55807 WHERE "Goals against" < '33' AND "Draws" > '13'
wikisql
CREATE TABLE table_30488 ( "No." real, "#" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (million)" text )
Who wrote the episode with the code xle05012?
SELECT "Written by" FROM table_30488 WHERE "Production code" = 'XLE05012'
wikisql
CREATE TABLE table_66113 ( "Japanese Title" text, "Romaji Title" text, "TV Station" text, "Episodes" real, "Average Ratings" text )
What is the episode on NHK with average ratings of 9.2%?
SELECT COUNT("Episodes") FROM table_66113 WHERE "TV Station" = 'nhk' AND "Average Ratings" = '9.2%'
wikisql
CREATE TABLE table_30532 ( "No." real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (million)" text )
How many writers wrote the episode 'Woke Up Dead'?
SELECT COUNT("Written by") FROM table_30532 WHERE "Title" = 'Woke Up Dead'
wikisql
CREATE TABLE table_23224961_2 ( season VARCHAR, mittelfranken_süd VARCHAR )
When asv n rnberg-s d is the mittelfranken s d what is the season?
SELECT season FROM table_23224961_2 WHERE mittelfranken_süd = "ASV Nürnberg-Süd"
sql_create_context
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE airport_service ( city_code varchar, ...
thank you for that information now i would like to book a flight from PHILADELPHIA to BOSTON on the night of 4 16 around 9 o'clock
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (((flight.departure_time BETWEEN 2130 AND 2030) AND date_day.day_number = 16 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_...
atis
CREATE TABLE table_28895 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text )
Name the candidates for felix walker
SELECT "Candidates" FROM table_28895 WHERE "Incumbent" = 'Felix Walker'
wikisql
CREATE TABLE table_23204 ( "Institution" text, "Location" text, "Nickname" text, "Founded" real, "Type" text, "Enrollment" real, "Joined" text )
Name the enrollment for 2007-08
SELECT "Enrollment" FROM table_23204 WHERE "Joined" = '2007-08'
wikisql
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, ...
please list all flights from SAN FRANCISCO to PITTSBURGH on sunday
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND date_day.day_number = 27 AND date_day.month_number = 8 AN...
atis
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 departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE...
For those employees who did not have any job in the past, give me the comparison about the amount of job_id over the job_id , and group by attribute job_id.
SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID
nvbench
CREATE TABLE Apartments ( apt_id INTEGER, building_id INTEGER, apt_type_code CHAR(15), apt_number CHAR(10), bathroom_count INTEGER, bedroom_count INTEGER, room_count CHAR(5) ) CREATE TABLE View_Unit_Status ( apt_id INTEGER, apt_booking_id INTEGER, status_date DATETIME, avail...
Show the number of apartment bookings for each year and bin booking start date by year interval in a bar chart, and could you display the number of booking start date from high to low order?
SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id ORDER BY COUNT(booking_start_date) DESC
nvbench
CREATE TABLE table_76302 ( "noun root (meaning)" text, "case suffix (case)" text, "postposition" text, "full word" text, "English meaning" text )
What is Postposition, when Noun Root (Meaning) is 'mshobl- (parent)'?
SELECT "postposition" FROM table_76302 WHERE "noun root (meaning)" = 'mshobl- (parent)'
wikisql
CREATE TABLE table_name_63 ( team_1 VARCHAR )
What shows for 2nd round when the team 1 was Rc Strasbourg (d1)?
SELECT 2 AS nd_round FROM table_name_63 WHERE team_1 = "rc strasbourg (d1)"
sql_create_context
CREATE TABLE table_62016 ( "Outcome" text, "Edition" real, "Round" text, "Opponent Team" text, "Surface" text, "Opponent" text, "Score" text )
What is Score, when Edition is 2011, and when Surface is Hard (i)?
SELECT "Score" FROM table_62016 WHERE "Edition" = '2011' AND "Surface" = 'hard (i)'
wikisql
CREATE TABLE table_203_683 ( id number, "season" text, "league" text, "gold" text, "silver" text, "bronze" text, "winning manager" text )
after rosenborg , which team has the most cup wins ?
SELECT "gold" FROM table_203_683 WHERE "gold" <> 'rosenborg' GROUP BY "gold" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE table_23881 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Bruins points" real, "Opponents" real, "Record" text )
What was the date for game 9?
SELECT "Date" FROM table_23881 WHERE "Game" = '9'
wikisql
CREATE TABLE table_38829 ( "States" text, "Fall 05" real, "Fall 06" real, "Fall 07" real, "Fall 08" real, "Fall 09" real )
What's the largest Fall 08 number when fall 09 is less than 82, fall 06 is 5, and fall 05 is less than 3?
SELECT MAX("Fall 08") FROM table_38829 WHERE "Fall 09" < '82' AND "Fall 06" = '5' AND "Fall 05" < '3'
wikisql
CREATE TABLE table_20174 ( "Club" text, "Position in 2013" text, "First season" real, "First season of current spell" real, "Number of seasons in Superettan" real, "Number of seasons in second tier" text )
What was the players position in 2013 who had 29 seasons in the second tier
SELECT "Position in 2013" FROM table_20174 WHERE "Number of seasons in second tier" = '29'
wikisql
CREATE TABLE table_51922 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Date" text )
Which home team an Away team score of 7.9 (51)?
SELECT "Home team" FROM table_51922 WHERE "Away team score" = '7.9 (51)'
wikisql
CREATE TABLE table_5997 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real )
What was the larger number of players that played in 4 events that 2 wins but were less than 6 in the top 10?
SELECT MAX("Top-25") FROM table_5997 WHERE "Events" > '4' AND "Wins" = '2' AND "Top-10" < '6'
wikisql
CREATE TABLE table_name_26 ( wind VARCHAR, athlete VARCHAR )
What kind of Wind has an Athlete of kerron stewart?
SELECT wind FROM table_name_26 WHERE athlete = "kerron stewart"
sql_create_context
CREATE TABLE table_30811 ( "Series #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real )
What is the production code for 'State of Grace'?
SELECT MAX("Production code") FROM table_30811 WHERE "Title" = 'State of Grace'
wikisql
CREATE TABLE table_name_37 ( to_par VARCHAR, total INTEGER )
What was the score to par for 156 strokes?
SELECT COUNT(to_par) FROM table_name_37 WHERE total > 156
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TA...
has patient 021-49082 been given any medication when they came to the hospital last time?
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-49082' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient....
eicu
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requi...
LATIN 514 has been a subject choice for how long ?
SELECT DISTINCT semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'LATIN' AND course.number = 514 AND semester.semester_id = course_offering.semester ORDER BY semester.year LIMIT 1
advising
CREATE TABLE table_22941 ( "School" text, "Year Founded" text, "Denomination" text, "Language" text, "Grades" text, "Gender" text, "Private/Public" text )
What's the gender of the students taught in the school founded in 1894?
SELECT "Gender" FROM table_22941 WHERE "Year Founded" = '1894'
wikisql
CREATE TABLE table_27756314_6 ( high_assists VARCHAR, date VARCHAR )
who had high assists on november 12?
SELECT high_assists FROM table_27756314_6 WHERE date = "November 12"
sql_create_context