context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_69942 ( "Date" text, "Visitor" text, "Result" text, "Score" text, "Home" text, "Record" text, "Attendance" real )
Name the home for 21-17
SELECT "Home" FROM table_69942 WHERE "Score" = '21-17'
wikisql
CREATE TABLE Courses ( course_id INTEGER, author_id INTEGER, subject_id INTEGER, course_name VARCHAR(120), course_description VARCHAR(255) ) CREATE TABLE Student_Course_Enrolment ( registration_id INTEGER, student_id INTEGER, course_id INTEGER, date_of_enrolment DATETIME, date_o...
How many completion students in each day? Return a line chart grouping by date of completion, rank by the x axis from low to high.
SELECT date_of_completion, COUNT(date_of_completion) FROM Student_Course_Enrolment GROUP BY date_of_completion ORDER BY date_of_completion
nvbench
CREATE TABLE table_name_96 ( permanent_account VARCHAR, updated_in_past_30_days VARCHAR )
What is Permanent Account, when Updated In Past 30 Days is 10324?
SELECT permanent_account FROM table_name_96 WHERE updated_in_past_30_days = "10324"
sql_create_context
CREATE TABLE table_name_43 ( country VARCHAR, place VARCHAR, player VARCHAR )
What country was the player, rod pampling, from who placed t10?
SELECT country FROM table_name_43 WHERE place = "t10" AND player = "rod pampling"
sql_create_context
CREATE TABLE table_3166 ( "Week" real, "Date" text, "Kickoff" text, "Opponent" text, "Final score" text, "Team record" text, "Game site" text, "Attendance" real )
How many weeks are teams playing agains the Barcelona dragons?
SELECT COUNT("Week") FROM table_3166 WHERE "Opponent" = 'Barcelona Dragons'
wikisql
CREATE TABLE table_8380 ( "Pick" real, "Player" text, "Pos." text, "Nationality" text, "Team" text, "Previous team" text, "NBA years [a ]" text, "Career with the franchise [b ]" text )
What is Career with the franchise [b ], when Player is 'Willie Anderson Category:Articles with hCards'?
SELECT "Career with the franchise [b ]" FROM table_8380 WHERE "Player" = 'willie anderson category:articles with hcards'
wikisql
CREATE TABLE table_name_51 ( points INTEGER, against INTEGER )
What is the Points with an Against smaller than 16?
SELECT AVG(points) FROM table_name_51 WHERE against < 16
sql_create_context
CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_20...
Show me about the distribution of meter_200 and the sum of meter_100 , and group by attribute meter_200 in a bar chart, and show by the x axis in desc.
SELECT meter_200, SUM(meter_100) FROM swimmer GROUP BY meter_200 ORDER BY meter_200 DESC
nvbench
CREATE TABLE table_204_330 ( id number, "finished" text, "horse" text, "jockey" text, "trainer" text, "owner" text, "time / behind" text )
who finished earlier , hindoocraft or spokane ?
SELECT "horse" FROM table_204_330 WHERE "horse" IN ('hindoocraft', 'spokane') ORDER BY "finished" LIMIT 1
squall
CREATE TABLE table_15510 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Series" text )
what was the score in the loss to tapani (0-1)?
SELECT "Score" FROM table_15510 WHERE "Loss" = 'tapani (0-1)'
wikisql
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostFeedback ( Id number, PostId numb...
Celebrities from Ukraine (top 500 users ordered by profile views to rep points).
SELECT ROW_NUMBER() OVER (ORDER BY 'views_to_rep' DESC) AS "#", * FROM (SELECT u.Id AS "user_link", u.Views, u.Reputation, 1. * u.Views / u.Reputation AS "views_to_rep" FROM Users AS u WHERE u.Location LIKE '%Ukraine%') AS q ORDER BY 'views_to_rep' DESC LIMIT 500
sede
CREATE TABLE table_name_6 ( pts VARCHAR, year VARCHAR, event VARCHAR )
What is the pts for 2004, and the ro event?
SELECT pts FROM table_name_6 WHERE year = "2004" AND event = "ro"
sql_create_context
CREATE TABLE table_203_116 ( id number, "no." number, "player" text, "birth date" text, "weight" number, "height" number, "position" text, "current club" text )
how much taller in oliver venno than rait rikberg ?
SELECT (SELECT "height" FROM table_203_116 WHERE "player" = 'oliver venno') - (SELECT "height" FROM table_203_116 WHERE "player" = 'rait rikberg')
squall
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 demographic (...
what is the number of patients whose age is less than 68 and drug type is base?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "68" AND prescriptions.drug_type = "BASE"
mimicsql_data
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedA...
Questions eligible for APL bounty by Adam.
SELECT Q.Id AS "post_link", Q.Score, Q.AnswerCount, Q.ClosedDate FROM Posts AS Q WHERE Q.PostTypeId = 1 AND Q.Body LIKE '%help.dyalog.com%' OR EXISTS(SELECT * FROM Posts AS A WHERE A.ParentId = Q.Id AND A.PostTypeId = 2 AND A.Body LIKE '%help.dyalog.com%') ORDER BY Q.ClosedDate, Q.AnswerCount, Q.Score DESC
sede
CREATE TABLE table_3397 ( "Player" text, "Touchdowns (5 points)" real, "Extra points 1 point" real, "Field goals (4 points)" real, "Safeties (2 points)" real, "Total Points" real )
How many extra points did Germany Schultz score?
SELECT "Extra points 1 point" FROM table_3397 WHERE "Player" = 'Germany Schultz'
wikisql
CREATE TABLE people ( people_id number, name text, age number, height number, hometown text ) CREATE TABLE gymnast ( gymnast_id number, floor_exercise_points number, pommel_horse_points number, rings_points number, vault_points number, parallel_bars_points number, horizo...
What are the hometowns that are shared by at least two gymnasts?
SELECT T2.hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.gymnast_id = T2.people_id GROUP BY T2.hometown HAVING COUNT(*) >= 2
spider
CREATE TABLE table_18904 ( "Rnd" real, "Circuit" text, "GTO Winning Team" text, "GTU Winning Team" text, "TO Winning Team" text, "TU Winning Team" text, "Results" text )
What is GTO Winning Team Mike Keyser's RND number?
SELECT "Rnd" FROM table_18904 WHERE "GTO Winning Team" = 'Mike Keyser'
wikisql
CREATE TABLE table_name_14 ( away_team VARCHAR, venue VARCHAR )
Who plays at Victoria Park?
SELECT away_team FROM table_name_14 WHERE venue = "victoria park"
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 jobs ( JOB_ID varchar(10), JOB_...
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the trend about department_id over hire_date .
SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE table_25800134_1 ( director VARCHAR, airdate VARCHAR )
Who directed the episodes that aired December 15, 1956?
SELECT director FROM table_25800134_1 WHERE airdate = "December 15, 1956"
sql_create_context
CREATE TABLE table_name_44 ( crowd VARCHAR, away_team VARCHAR )
How many people attended the game where Fitzroy was the away team?
SELECT COUNT(crowd) FROM table_name_44 WHERE away_team = "fitzroy"
sql_create_context
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, C...
看一下编号为16021187507的医疗就诊的出院日期
SELECT t_kc21.OUT_HOSP_DATE FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '16021187507'
css
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...
give me the number of patients whose admission type is urgent and lab test name is wbc, joint fluid?
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.label = "WBC, Joint Fluid"
mimicsql_data
CREATE TABLE producer ( pid int, gender text, name text, nationality text, birth_city text, birth_year int ) CREATE TABLE cast ( id int, msid int, aid int, role text ) CREATE TABLE writer ( wid int, gender text, name text, nationality text, birth_city text, ...
find all films in which ' Rowan Atkinson ' acted as ' Mr. Bean
SELECT movie.title FROM actor, cast, movie WHERE actor.name = 'Rowan Atkinson' AND cast.aid = actor.aid AND cast.role = 'Mr. Bean' AND movie.mid = cast.msid
imdb
CREATE TABLE table_name_89 ( Home INTEGER, institution VARCHAR, wins VARCHAR )
What is the sum of the home wins of the Boston College Eagles, which has more than 6 wins?
SELECT SUM(Home) AS wins FROM table_name_89 WHERE institution = "boston college eagles" AND wins > 6
sql_create_context
CREATE TABLE table_10236830_1 ( actors_name VARCHAR, director VARCHAR )
What was the actors name that vadim ilyenko directed?
SELECT actors_name FROM table_10236830_1 WHERE director = "Vadim Ilyenko"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
count the number of patients whose admission year is less than 2167 and procedure long title is percutaneous (endoscopic) jejunostomy [pej]?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2167" AND procedures.long_title = "Percutaneous (endoscopic) jejunostomy [PEJ]"
mimicsql_data
CREATE TABLE table_2570269_2 ( cast VARCHAR, episode_title VARCHAR )
If the episode title is Pressures, what are the names of the cast?
SELECT cast FROM table_2570269_2 WHERE episode_title = "Pressures"
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 event ( ID int, Name text, Stadium_ID int, Year text ) CREATE...
Return a bar chart about the distribution of Time and meter_100 , and show meter_100 from high to low order.
SELECT Time, meter_100 FROM swimmer ORDER BY meter_100 DESC
nvbench
CREATE TABLE table_name_23 ( median_family_income VARCHAR, per_capita_income VARCHAR )
What is the median family income when the per capita is $24,114?
SELECT median_family_income FROM table_name_23 WHERE per_capita_income = "$24,114"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
how many patients whose discharge location is rehab/distinct part hosp and procedure icd9 code is 3491?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "REHAB/DISTINCT PART HOSP" AND procedures.icd9_code = "3491"
mimicsql_data
CREATE TABLE table_17900317_5 ( matches INTEGER, runs VARCHAR )
Name the least matches for runs being 276
SELECT MIN(matches) FROM table_17900317_5 WHERE runs = 276
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
for how many patients born before the year 2121, the drug route is pr?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2121" AND prescriptions.route = "PR"
mimicsql_data
CREATE TABLE table_204_242 ( id number, "season" text, "record" text, "finish" text, "manager" text, "notes" text )
what season had the least amount of wins ?
SELECT "season" FROM table_204_242 ORDER BY "record" LIMIT 1
squall
CREATE TABLE table_name_45 ( round_4 VARCHAR, round_1 VARCHAR, round_2 VARCHAR )
Round 4 for larger than 19 Round 1 and a 27 Round 2?
SELECT round_4 FROM table_name_45 WHERE round_1 > 19 AND round_2 = "27"
sql_create_context
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConce...
When were the top 500 tags created?.
SELECT Tags.TagName, wiki.CreationDate AS "wiki_date", excerpt.CreationDate AS "excerpt_date", MIN(Posts.CreationDate) AS "first_post", COUNT(Tags.TagName) AS Uses FROM (((PostTags INNER JOIN Posts ON PostTags.PostId = Posts.Id) INNER JOIN Tags ON PostTags.TagId = Tags.Id) INNER JOIN Posts AS wiki ON Tags.WikiPostId = ...
sede
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, ...
what is the number of patients whose primary disease is squamous cell carcinoma oral tongue/sda and year of death is less than or equal to 2131?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "SQUAMOUS CELL CARCINOMA ORAL TONGUE/SDA" AND demographic.dod_year <= "2131.0"
mimicsql_data
CREATE TABLE table_24239 ( "Nr." real, "District" text, "Former Name" text, "Area ( ha )" real, "Population (2005)" real, "No. of villages" real, "Density persons / ha" text )
With the population in 2005 of 572, what is the former name?
SELECT "Former Name" FROM table_24239 WHERE "Population (2005)" = '572'
wikisql
CREATE TABLE geographic ( city_name varchar, county varchar, region varchar ) CREATE TABLE restaurant ( id int, name varchar, food_type varchar, city_name varchar, rating "decimal ) CREATE TABLE location ( restaurant_id int, house_number int, street_name varchar, city_n...
give me a good arabic restaurant on buchanan in san francisco ?
SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'san francisco' AND location.street_name = 'buchanan' AND restaurant.food_type = 'arabic' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5
restaurants
CREATE TABLE table_22756549_1 ( party VARCHAR, winner VARCHAR )
What party is the winner K. Anbazhagan from?
SELECT party AS a FROM table_22756549_1 WHERE winner = "K. Anbazhagan"
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...
根据科室编码与入院诊断疾病编码区别显示出医院7999719所有的就诊记载里,有民政补助的部分比上医疗总费用比值的最大值并且按降序来排列
SELECT qtb.MED_ORG_DEPT_CD, qtb.IN_DIAG_DIS_NM, MAX(t_kc24.CIVIL_SUBSIDY) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '7999719' GROUP BY qtb.MED_ORG_DEPT_CD, qtb.IN_DIAG_DIS_NM ORDER BY MAX(t_kc24.CIVIL_SUBSIDY / t_kc24.MED_AMOUT) DESC UNION SELECT gyb.MED_ORG_DEPT_CD, gy...
css
CREATE TABLE table_38747 ( "Round" real, "Player" text, "Position" text, "Nationality" text, "College/Junior/Club Team (League)" text )
What nationality is Daryn Fersovich?
SELECT "Nationality" FROM table_38747 WHERE "Player" = 'daryn fersovich'
wikisql
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, ...
In the next 6 semesters name the classes that are offered ?
SELECT DISTINCT course.name, course.number, semester.semester, semester.year FROM course, course_offering, semester WHERE ((semester.semester = 'FA' AND semester.year = 2016) OR (semester.semester = 'FA' AND semester.year = 2017) OR (semester.semester = 'FA' AND semester.year = 2018) OR (semester.semester = 'WN' AND se...
advising
CREATE TABLE table_name_91 ( doubles_w_l VARCHAR, player VARCHAR )
Tell me the doubles W-L for player of laurynas grigelis
SELECT doubles_w_l FROM table_name_91 WHERE player = "laurynas grigelis"
sql_create_context
CREATE TABLE table_75327 ( "NTFA Div 2" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real )
What is the lowest number of against of NTFA Div 2 Fingal Valley?
SELECT MIN("Against") FROM table_75327 WHERE "NTFA Div 2" = 'fingal valley'
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...
provide the number of patients whose year of death is less than or equal to 2180 and procedure icd9 code is 4105?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2180.0" AND procedures.icd9_code = "4105"
mimicsql_data
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE cost ( c...
how much do the -monos actually cost?
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'lab' AND cost.eventid IN (SELECT lab.labid FROM lab WHERE lab.labname = '-monos')
eicu
CREATE TABLE table_name_69 ( week INTEGER, game_site VARCHAR, result VARCHAR )
What is the highest week when the game site was Verizon Wireless Arena, and the result was w 59 42?
SELECT MAX(week) FROM table_name_69 WHERE game_site = "verizon wireless arena" AND result = "w 59–42"
sql_create_context
CREATE TABLE table_203_270 ( id number, "year" number, "competition" text, "venue" text, "position" text, "event" text, "notes" text )
number of races not finished
SELECT COUNT(*) FROM table_203_270 WHERE "position" IS NULL
squall
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, Rejectio...
Date first comment was posted at.
SELECT MIN(CreationDate) FROM Comments
sede
CREATE TABLE table_name_41 ( winner VARCHAR, pole_position VARCHAR, date VARCHAR )
What is Winner, when Pole Position is Ben Spies, and when Date is Elkhart Lake, Wisconsin?
SELECT winner FROM table_name_41 WHERE pole_position = "ben spies" AND date = "elkhart lake, wisconsin"
sql_create_context
CREATE TABLE table_name_76 ( gold VARCHAR, silver VARCHAR )
Who won gold in the games where Pan Cheng-Tsung won silver?
SELECT gold FROM table_name_76 WHERE silver = "pan cheng-tsung"
sql_create_context
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), ...
For those employees who do not work in departments with managers that have ids between 100 and 200, find hire_date and the sum of manager_id bin hire_date by weekday, and visualize them by a bar chart, and could you rank total number of manager id in desc order?
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SUM(MANAGER_ID) DESC
nvbench
CREATE TABLE table_42091 ( "Office" text, "Democratic ticket" text, "Republican ticket" text, "American Labor ticket" text, "Socialist ticket" text )
Which Democrtic candidate ran against the Socialist candidate Edna Mitchell Blue?
SELECT "Democratic ticket" FROM table_42091 WHERE "Socialist ticket" = 'edna mitchell blue'
wikisql
CREATE TABLE table_52220 ( "Year" text, "Builder" text, "Motors" text, "Trailers" text, "Control Trailers" text )
I want the trailers for motors of 145
SELECT "Trailers" FROM table_52220 WHERE "Motors" = '145'
wikisql
CREATE TABLE table_train_117 ( "id" int, "mini_mental_state_examination_mmse" int, "systolic_blood_pressure_sbp" int, "renal_disease" bool, "total_serum_protein" int, "diastolic_blood_pressure_dbp" int, "geriatric_depression_scale_gds" int, "serum_creatinine" float, "uncontrolled_blo...
uncontrolled blood pressure and / or blood pressure above 140 / 90
SELECT * FROM table_train_117 WHERE uncontrolled_blood_pressure = 1 OR systolic_blood_pressure_sbp >= 140 OR diastolic_blood_pressure_dbp >= 90
criteria2sql
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...
how many patients whose year of birth is less than 1846 and drug type is additive?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "1846" AND prescriptions.drug_type = "ADDITIVE"
mimicsql_data
CREATE TABLE table_11961582_4 ( high_rebounds VARCHAR, game VARCHAR )
Who did the most high rebounds in the game 24?
SELECT high_rebounds FROM table_11961582_4 WHERE game = 24
sql_create_context
CREATE TABLE table_name_87 ( gold INTEGER, bronze VARCHAR, total VARCHAR )
Can you tell me the highest Gold that has the Bronze smaller than 1, and the Total larger than 4?
SELECT MAX(gold) FROM table_name_87 WHERE bronze < 1 AND total > 4
sql_create_context
CREATE TABLE table_61386 ( "Draft" real, "Round" real, "Pick" real, "Player" text, "Nationality" text )
What is the total number of rounds of the player with a pick of 20?
SELECT COUNT("Round") FROM table_61386 WHERE "Pick" = '20'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
provide the number of patients whose diagnoses short title is late ef-hemplga side nos and lab test category is hematology?
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 = "Late ef-hemplga side NOS" AND lab."CATEGORY" = "Hematology"
mimicsql_data
CREATE TABLE table_name_68 ( location VARCHAR, year INTEGER )
Which location had a year over 2006?
SELECT location FROM table_name_68 WHERE year > 2006
sql_create_context
CREATE TABLE table_14133 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "TV Time" text, "Attendance" text )
Which Opponent had an Attendance of 78,883?
SELECT "Opponent" FROM table_14133 WHERE "Attendance" = '78,883'
wikisql
CREATE TABLE table_name_14 ( class VARCHAR, part_2 VARCHAR )
Which class has a part 2 of halp war ?
SELECT class FROM table_name_14 WHERE part_2 = "halp warþ"
sql_create_context
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...
检验项目在检验报告单59688367241上代码以及名称是什么?
SELECT zyjybgb.JYXMDM, zyjybgb.JYXMMC FROM zyjybgb WHERE zyjybgb.BGDH = '59688367241' UNION SELECT mzjybgb.JYXMDM, mzjybgb.JYXMMC FROM mzjybgb WHERE mzjybgb.BGDH = '59688367241'
css
CREATE TABLE table_25872 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
When chauncey billups (4) has the highest amount of assists who has the highest amount of points?
SELECT "High points" FROM table_25872 WHERE "High assists" = 'Chauncey Billups (4)'
wikisql
CREATE TABLE table_76955 ( "Date" text, "Opponent" text, "Site" text, "Result" text, "Attendance" text )
How many spectators attended the game on 11/09/1935?
SELECT "Attendance" FROM table_76955 WHERE "Date" = '11/09/1935'
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
what is the number of patients whose item id is 51466 and lab test abnormal status is abnormal?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "51466" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE table_35355 ( "Game" real, "April" real, "Opponent" text, "Score" text, "Record" text, "Points" real )
Which April has a Game of 84
SELECT MAX("April") FROM table_35355 WHERE "Game" = '84'
wikisql
CREATE TABLE table_name_73 ( note VARCHAR, catalog VARCHAR )
Name the note for catalog of 32xa-106
SELECT note FROM table_name_73 WHERE catalog = "32xa-106"
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...
Let me know the route of administration of the medication with drug code ISOS10.
SELECT prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "ISOS10"
mimicsql_data
CREATE TABLE table_22012 ( "Name" text, "Volume" text, "Engine" text, "Fuel" text, "Output" text, "Torque" text, "Engine ID code(s)" text, "0\u2013100km/h,s" text, "Top speed" text, "CO 2" text, "Years" text )
Name the volume for co 2 for 168 g/km
SELECT "Volume" FROM table_22012 WHERE "CO 2" = '168 g/km'
wikisql
CREATE TABLE table_name_19 ( year INTEGER, engine VARCHAR, points VARCHAR )
Name the average yeara for engine of renault v10 with points more than 4
SELECT AVG(year) FROM table_name_19 WHERE engine = "renault v10" AND points > 4
sql_create_context
CREATE TABLE table_62965 ( "Township" text, "County" text, "Pop. (2010)" real, "Land ( sqmi )" real, "Water (sqmi)" real, "Latitude" real, "Longitude" real, "GEO ID" real, "ANSI code" real )
What is the average ANSI code for the town of Sherman and the smaller of the water area in square miles than 0.005?
SELECT AVG("ANSI code") FROM table_62965 WHERE "Township" = 'sherman' AND "Water (sqmi)" < '0.005'
wikisql
CREATE TABLE table_name_21 ( qual_2 VARCHAR, qual_1 VARCHAR )
What is the time for the second qualification where the first qualification time was 1:21.523?
SELECT qual_2 FROM table_name_21 WHERE qual_1 = "1:21.523"
sql_create_context
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownV...
Top 250 Reputation Holder From India.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%Pakistan%' OR UPPER(Location) LIKE '%Pak' ORDER BY Reputation DESC LIMIT 250
sede
CREATE TABLE table_1117 ( "Locale" text, "Skip" text, "W" real, "L" real, "PF" real, "PA" real, "Ends Won" real, "Ends Lost" real, "Blank Ends" real, "Stolen Ends" real, "Shot Pct." real )
What locale has the skip Colleen Jones?
SELECT "Locale" FROM table_1117 WHERE "Skip" = 'Colleen Jones'
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, ...
what is average age of patients whose marital status is widowed and admission type is urgent?
SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "WIDOWED" AND demographic.admission_type = "URGENT"
mimicsql_data
CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE aircraft (...
what ground transportation is available from the PITTSBURGH airport to downtown and how much does it cost
SELECT DISTINCT ground_service.ground_fare, ground_service.transport_type FROM airport, airport_service, city AS CITY_0, city AS CITY_1, ground_service WHERE airport.airport_code = airport_service.airport_code AND CITY_0.city_code = airport_service.city_code AND CITY_0.city_name = 'PITTSBURGH' AND CITY_1.city_name = 'P...
atis
CREATE TABLE table_26460435_5 ( monarch VARCHAR, heir VARCHAR )
What is the number of monarchs that had Yan Maw la Mon as the heir?
SELECT COUNT(monarch) FROM table_26460435_5 WHERE heir = "Yan Maw La Mon"
sql_create_context
CREATE TABLE table_27183 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (millions)" text )
What is the episode title that had a US viewership of 8.16?
SELECT "Title" FROM table_27183 WHERE "U.S. viewers (millions)" = '8.16'
wikisql
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
病患凤香馨使用的药品均低于3461.35元一共有多少记载在次医疗记录上?编号当时都是多少?
SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '凤香馨' AND NOT t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 3461.35)
css
CREATE TABLE county ( County_Id int, County_name text, Population real, Zip_code text ) CREATE TABLE election ( Election_ID int, Counties_Represented text, District int, Delegate text, Party int, First_Elected real, Committee text ) CREATE TABLE party ( Party_ID int, ...
Show the number of delegates in each committee with a bar chart, and show by the bar from high to low please.
SELECT Committee, COUNT(Committee) FROM election GROUP BY Committee ORDER BY Committee DESC
nvbench
CREATE TABLE table_41852 ( "City" text, "Country" text, "IATA" text, "ICAO" text, "Airport" text )
What is the ICAO when the IATA is ist?
SELECT "ICAO" FROM table_41852 WHERE "IATA" = 'ist'
wikisql
CREATE TABLE table_name_70 ( original_name VARCHAR, language VARCHAR )
What is the original name of the song performed in Swedish?
SELECT original_name FROM table_name_70 WHERE language = "swedish"
sql_create_context
CREATE TABLE table_name_35 ( chassis VARCHAR, year VARCHAR, entrant VARCHAR )
Which chassis is from 1974 and was an entrant of Goldie Hexagon racing?
SELECT chassis FROM table_name_35 WHERE year = 1974 AND entrant = "goldie hexagon racing"
sql_create_context
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, ...
Comments on my questions containing the given phrase (case insensitive).
SELECT c.Id AS "comment_link", c.Text, c.UserId AS "user_link", c.CreationDate FROM Comments AS c INNER JOIN Posts AS p ON c.PostId = p.Id WHERE (p.OwnerUserId = '##UserId?8297##') AND (c.Text LIKE '%##Word?chat##%' COLLATE Latin1_General_CI_AI) AND (p.PostTypeId = '##type?1##')
sede
CREATE TABLE table_name_85 ( model VARCHAR, seats VARCHAR, built VARCHAR )
What is the Model of the Engine with 29 Seats Built in 1941 1942?
SELECT model FROM table_name_85 WHERE seats = 29 AND built = "1941–1942"
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
give me the number of patients whose gender is f and primary disease is syncope;telemetry?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.diagnosis = "SYNCOPE;TELEMETRY"
mimicsql_data
CREATE TABLE table_15013825_8 ( copa_libertadores_1992 VARCHAR, copa_conmebol_1992 VARCHAR, team VARCHAR )
Name the copa libertadores 1992 for round of 16 and team of fluminense
SELECT copa_libertadores_1992 FROM table_15013825_8 WHERE copa_conmebol_1992 = "Round of 16" AND team = "Fluminense"
sql_create_context
CREATE TABLE txmzjzjlb ( 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, MZZYZDZ...
病号范雅逸在09年9月22日到2016年7月15日内的所有检验结果指标记录的检测员为74379714的检测指标流水号是多少?
SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jyb...
css
CREATE TABLE table_7444 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text )
Which Against has a Position larger than 8, and Points larger than 9?
SELECT "Against" FROM table_7444 WHERE "Position" > '8' AND "Points" > '9'
wikisql
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
看看这位患者医疗就诊时的药品047472-s的使用频次和每次用量,编号是31414220389的医疗就诊
SELECT USE_FRE, EACH_DOSAGE FROM t_kc22 WHERE MED_CLINIC_ID = '31414220389' AND SOC_SRT_DIRE_CD = '047472-s'
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, ...
give me the number of patients whose diagnoses short title is ac posthemorrhag anemia and drug route is ng?
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 = "Ac posthemorrhag anemia" AND prescriptions.route = "NG"
mimicsql_data
CREATE TABLE table_14626 ( "Name" text, "Country" text, "Type" text, "Moving from" text, "Transfer window" text, "Ends" real, "Transfer fee" text, "Source" text )
What is the source of a move from Swindon Town?
SELECT "Source" FROM table_14626 WHERE "Moving from" = 'swindon town'
wikisql
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 ReviewTasks ( Id number, ReviewTaskTypeId number, Cr...
Questions by tag with score 1 or greater and answer score 4 or greater.
SELECT q.Id AS "post_link", q.Tags, q.Score, q.Title, q.ClosedDate, (SELECT SUM(Score) FROM Posts AS A WHERE q.Id = A.ParentId AND A.Score > 0) AS asco FROM Posts AS q WHERE q.PostTypeId = 1 AND q.Score > 0 AND q.Tags LIKE '%<' + @Tag + '>%' AND (SELECT SUM(Score) FROM Posts AS A WHERE q.Id = A.ParentId AND A.Score > 0...
sede
CREATE TABLE table_62672 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( \u00a3 )" real )
What is the total Money ( ) of Player of nick faldo?
SELECT SUM("Money ( \u00a3 )") FROM table_62672 WHERE "Player" = 'nick faldo'
wikisql
CREATE TABLE table_69636 ( "Call sign" text, "Frequency MHz" real, "City of license" text, "ERP W" real, "Class" text, "FCC info" text )
What city of license has a value of k293bg for its call sign?
SELECT "City of license" FROM table_69636 WHERE "Call sign" = 'k293bg'
wikisql
CREATE TABLE table_name_40 ( attendance INTEGER, date VARCHAR )
What was the average attendance on October 12?
SELECT AVG(attendance) FROM table_name_40 WHERE date = "october 12"
sql_create_context