context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_76982 ( "Poll source" text, "Dates administered" text, "Jim DeMint (R)" text, "Alvin Greene (D)" text, "Tom Clements (G)" text, "Other" text, "Undecided" text )
What was the vote for Alvin Green when other was 9%?
SELECT "Alvin Greene (D)" FROM table_76982 WHERE "Other" = '9%'
wikisql
CREATE TABLE table_2256 ( "Barangay" text, "Location" text, "Classification" text, "Population (May, 2000)" real, "Population (May, 2010)" real )
What was the Barangay when the population was 1267 in May of 2000?
SELECT "Barangay" FROM table_2256 WHERE "Population (May, 2000)" = '1267'
wikisql
CREATE TABLE table_name_82 ( receptions VARCHAR, avg_g VARCHAR )
How many times is avg/g 2?
SELECT COUNT(receptions) FROM table_name_82 WHERE avg_g = 2
sql_create_context
CREATE TABLE book ( book_id number, title text, issues number, writer text ) CREATE TABLE publication ( publication_id number, book_id number, publisher text, publication_date text, price number )
Show the title and publication dates of books.
SELECT T1.title, T2.publication_date FROM book AS T1 JOIN publication AS T2 ON T1.book_id = T2.book_id
spider
CREATE TABLE table_58202 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
On what Date is Carlton the Away Team?
SELECT "Date" FROM table_58202 WHERE "Away team" = 'carlton'
wikisql
CREATE TABLE table_16144 ( "No." real, "#" real, "Title" text, "Director" text, "Writer" text, "US air date" text, "Storyteller" text, "Villains" text )
When did the episode written by Jim Morris air?
SELECT "US air date" FROM table_16144 WHERE "Writer" = 'Jim Morris'
wikisql
CREATE TABLE table_name_5 ( grid VARCHAR, driver VARCHAR, laps VARCHAR, time_retired VARCHAR )
what is the grid when the laps is more than 0, the time/retired is engine and the driver is pedro de la rosa?
SELECT grid FROM table_name_5 WHERE laps > 0 AND time_retired = "engine" AND driver = "pedro de la rosa"
sql_create_context
CREATE TABLE table_204_979 ( id number, "place" number, "nation" text, "5 hoops" text, "3 balls,\n2 ribbons" text, "total" number )
name of the last placed nation ?
SELECT "nation" FROM table_204_979 ORDER BY "place" DESC LIMIT 1
squall
CREATE TABLE table_name_98 ( goals_for INTEGER, ties INTEGER )
What is the score of Goal For which has a Ties larger 0?
SELECT MIN(goals_for) FROM table_name_98 WHERE ties > 0
sql_create_context
CREATE TABLE table_name_76 ( location VARCHAR, round VARCHAR, opponent VARCHAR )
What is Location, when Round is '1', and when Opponent is 'Joe Slick'?
SELECT location FROM table_name_76 WHERE round = 1 AND opponent = "joe slick"
sql_create_context
CREATE TABLE table_21436373_11 ( result_games VARCHAR, type_of_record VARCHAR )
Name the result for total attendance-regular season
SELECT result_games FROM table_21436373_11 WHERE type_of_record = "Total attendance-Regular season"
sql_create_context
CREATE TABLE table_48784 ( "Date" text, "Opponents" text, "H / A" text, "Result F \u2013 A" text, "Attendance" real )
What is the H/A on 5 August 1990?
SELECT "H / A" FROM table_48784 WHERE "Date" = '5 august 1990'
wikisql
CREATE TABLE table_43485 ( "Venue" text, "Location" text, "Environment" text, "Closed" text, "Reason" text )
Which venue closed in 1996?
SELECT "Venue" FROM table_43485 WHERE "Closed" = '1996'
wikisql
CREATE TABLE table_7318 ( "Outcome" text, "Date" real, "Tournament" text, "Surface" text, "Partner" text, "Opponent in the final" text, "Score in the final" text )
What is the earliest Date David Adams played on a Clay Surface with Brett Steven as Partner?
SELECT MIN("Date") FROM table_7318 WHERE "Surface" = 'clay' AND "Partner" = 'brett steven'
wikisql
CREATE TABLE table_name_76 ( males VARCHAR, percentage___percentage_ VARCHAR )
Which Males have a percentage of 0.42?
SELECT males FROM table_name_76 WHERE percentage___percentage_ = "0.42"
sql_create_context
CREATE TABLE table_19717 ( "Rank" real, "Name" text, "Nationality" text, "Total points" text, "Oberstdorf (Rk)" text, "Ga-Pa (Rk)" text, "Bhofen#1 (Rk)" text, "Bhofen#2 (Rk)" text )
How many points in total were scored by the player whose Oberstdork score and rank were 252.6 (11)?
SELECT "Total points" FROM table_19717 WHERE "Oberstdorf (Rk)" = '252.6 (11)'
wikisql
CREATE TABLE fzzmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZD...
从06年7月29日至14年1月26日之间患者陈怡宁所有检验结果指标记录中的仪器名称都叫什么?编号都是什么?
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZ...
css
CREATE TABLE table_name_67 ( week VARCHAR, result VARCHAR )
What week's game had a result of bye?
SELECT week FROM table_name_67 WHERE result = "bye"
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...
what is minimum days of hospital stay of patients whose age is greater than or equal to 89?
SELECT MIN(demographic.days_stay) FROM demographic WHERE demographic.age >= "89"
mimicsql_data
CREATE TABLE table_24039597_26 ( dismissals VARCHAR, matches VARCHAR )
How many matches were 44?
SELECT COUNT(dismissals) FROM table_24039597_26 WHERE matches = 44
sql_create_context
CREATE TABLE table_name_95 ( date VARCHAR, record VARCHAR )
On what date was the Record 41 32 6?
SELECT date FROM table_name_95 WHERE record = "41–32–6"
sql_create_context
CREATE TABLE zyb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
患者97780121被开出过金额在196.98元以下的医疗记录有哪几次?把医疗就诊编号列出来即可
SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_ID = '97780121' AND NOT qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 196.98) UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_ID = '97780121' AND NOT gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_k...
css
CREATE TABLE table_71043 ( "Category" text, "Film" text, "Director(s)" text, "Country" text, "Nominating Festival" text )
Name the country which has prix uip venezia
SELECT "Country" FROM table_71043 WHERE "Nominating Festival" = 'prix uip venezia'
wikisql
CREATE TABLE table_27816332_2 ( games_played INTEGER, total_points VARCHAR )
Name the least games played for 6 points
SELECT MIN(games_played) FROM table_27816332_2 WHERE total_points = 6
sql_create_context
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 instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE cour...
Which courses did Dr. Rosa Angulo-barroso teach before ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor WHERE course_offering.semester < (SELECT SEMESTERalias0.semester_id FROM semester AS SEMESTERalias0 WHERE SEMESTERalias0.semester = 'WN' AND SEMESTERalias0.year = 2016) AND course.course_id = cour...
advising
CREATE TABLE table_name_40 ( club VARCHAR, venue VARCHAR )
What club team plays at the champion window field?
SELECT club FROM table_name_40 WHERE venue = "champion window field"
sql_create_context
CREATE TABLE table_30432 ( "Club name" text, "Name of team song" text, "Basis for team song" text, "First used as team song" text, "Writer/composer" text )
How man teams have a writer named harry angus?
SELECT COUNT("Name of team song") FROM table_30432 WHERE "Writer/composer" = 'Harry Angus'
wikisql
CREATE TABLE table_57744 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Record" text )
Which score has a Home of grizzlies, and a Leading scorer of rudy gay (18)?
SELECT "Score" FROM table_57744 WHERE "Home" = 'grizzlies' AND "Leading scorer" = 'rudy gay (18)'
wikisql
CREATE TABLE table_name_9 ( round VARCHAR, home VARCHAR, result VARCHAR )
What round had a home of FC augsburg with the result of 3-0?
SELECT round FROM table_name_9 WHERE home = "fc augsburg" AND result = "3-0"
sql_create_context
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
在门诊被诊断为疾病J42.599的病人的检测指标805062数值的平均值以及最值数据是多少
SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDBM = 'J42.599' AND jyjgzbb.JCZBDM = '805062'
css
CREATE TABLE table_name_18 ( goals_for INTEGER, ties INTEGER )
What is the largest Goals For by a team that has more than 0 ties?
SELECT MAX(goals_for) FROM table_name_18 WHERE ties > 0
sql_create_context
CREATE TABLE table_name_37 ( date VARCHAR, home_team VARCHAR )
On what day is geelong the home team?
SELECT date FROM table_name_37 WHERE home_team = "geelong"
sql_create_context
CREATE TABLE table_204_636 ( id number, "season" text, "tier" number, "division" text, "pos." text, "notes" text )
which division comes after divisi n de honor ?
SELECT "division" FROM table_204_636 WHERE id = (SELECT MAX(id) FROM table_204_636 WHERE "division" = 'division de honor') + 1
squall
CREATE TABLE bdmzjzjlb ( 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...
门诊就诊88875856341的结束治疗的最后一天是那一天?
SELECT wdmzjzjlb.JZJSSJ FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '88875856341' UNION SELECT bdmzjzjlb.JZJSSJ FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '88875856341'
css
CREATE TABLE table_17140608_11 ( team VARCHAR, date VARCHAR )
What team(s) did they play on april 23?
SELECT team FROM table_17140608_11 WHERE date = "April 23"
sql_create_context
CREATE TABLE table_name_12 ( tries_for INTEGER, tries_against VARCHAR, points_against VARCHAR, points_for VARCHAR )
Which Tries for has Points against smaller than 124, and Points for smaller than 241, and Tries against smaller than 11?
SELECT MAX(tries_for) FROM table_name_12 WHERE points_against < 124 AND points_for < 241 AND tries_against < 11
sql_create_context
CREATE TABLE table_name_64 ( game_site VARCHAR, opponent VARCHAR )
Where does CF Pachuca play?
SELECT game_site FROM table_name_64 WHERE opponent = "cf pachuca"
sql_create_context
CREATE TABLE table_name_27 ( longitude VARCHAR, latitude VARCHAR )
What is the Longitude of the 61.0s Latitude?
SELECT longitude FROM table_name_27 WHERE latitude = "61.0s"
sql_create_context
CREATE TABLE table_name_25 ( home VARCHAR, record VARCHAR, time VARCHAR, location_attendance VARCHAR )
What is the home in mellon arena at 7:30 pm with a record o 2-5-2?
SELECT home FROM table_name_25 WHERE time = "7:30 pm" AND location_attendance = "mellon arena" AND record = "2-5-2"
sql_create_context
CREATE TABLE table_70378 ( "Year" real, "Division" text, "League" text, "Regular Season" text, "Playoffs" text, "U.S. Open Cup" text, "Avg. Attendance" text )
What year did the team make conference semifinals?
SELECT COUNT("Year") FROM table_70378 WHERE "Playoffs" = 'conference semifinals'
wikisql
CREATE TABLE table_name_15 ( goals_against INTEGER, club VARCHAR, points VARCHAR )
Which Goals against have a Club of cd castell n, and Points smaller than 24?
SELECT AVG(goals_against) FROM table_name_15 WHERE club = "cd castellón" AND points < 24
sql_create_context
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text )...
what is the name of the treatment which has been given to patient 11579 two times in 06/this year?
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 115...
mimic_iii
CREATE TABLE table_57593 ( "Race" text, "Circuit" text, "Date" text, "Pole position" text, "Fastest lap" text, "Winning driver" text, "Constructor" text, "Tyre" text, "Report" text )
What was the fastest lap time at the British Grand Prix with Mercedes as the constructor?
SELECT "Fastest lap" FROM table_57593 WHERE "Constructor" = 'mercedes' AND "Race" = 'british grand prix'
wikisql
CREATE TABLE table_name_12 ( laps INTEGER, rider VARCHAR, grid VARCHAR )
What is the highest number of laps that max biaggi rode on a grid larger than 2?
SELECT MAX(laps) FROM table_name_12 WHERE rider = "max biaggi" AND grid > 2
sql_create_context
CREATE TABLE Dorm_amenity ( amenid INTEGER, amenity_name VARCHAR(25) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Dorm ( dormid INTEGER, dor...
Create a bar chart showing sum student capacity across gender, and order by the bar in asc please.
SELECT gender, SUM(student_capacity) FROM Dorm GROUP BY gender ORDER BY gender
nvbench
CREATE TABLE table_name_85 ( to_par VARCHAR, year_won VARCHAR )
What was the To Par of Tiger Woods who won in 1988?
SELECT to_par FROM table_name_85 WHERE year_won = 1988
sql_create_context
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( i...
what procedure did patient 010-32698 receive the first time this year.
SELECT treatment.treatmentname FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-32698')) AND DATETIME(treatment.treatmenttime, 'start of year...
eicu
CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments ...
Which courses has Prof. Eduardo Matos-martin been assigned to teach for the coming year ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Eduardo Matos-martin%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instruc...
advising
CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text, ZYLBDM text, ZYMC text ) CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGD...
查一下从04年7月29到09年6月20这一段时间里,医疗机构8907786处理的新生儿门诊就诊数是多少
SELECT COUNT(*) FROM mzjzjlb WHERE YLJGDM = '8907786' AND JZKSRQ BETWEEN '2004-07-29' AND '2009-06-20' AND ZSEBZ > 0
css
CREATE TABLE table_203_630 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
south korea has how many more medals that north korea ?
SELECT (SELECT "total" FROM table_203_630 WHERE "nation" = 'south korea') - (SELECT "total" FROM table_203_630 WHERE "nation" = 'north korea')
squall
CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
Can you tell me what Core classes are offered next Winter ?
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id WHERE program_cour...
advising
CREATE TABLE table_39759 ( "Office" text, "Democratic ticket" text, "Republican ticket" text, "Law Preservation ticket" text, "Socialist ticket" text, "Socialist Labor ticket" text )
Who's the Socialist ticket with a Law Preservation ticket of (none), and a Socialist Labor ticket of belle j. rosen?
SELECT "Socialist ticket" FROM table_39759 WHERE "Law Preservation ticket" = '(none)' AND "Socialist Labor ticket" = 'belle j. rosen'
wikisql
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 diagnoses long title is other specified procedures as the cause of abnormal reaction of patient, or of later complication, without mention of misadventure at time of procedure and drug route is ivpca?
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.long_title = "Other specified procedures as the cause of abnormal reaction of patient, or of later compli...
mimicsql_data
CREATE TABLE table_66627 ( "City of license" text, "Identifier" text, "Frequency" text, "Power" text, "Class" text, "RECNet" text )
What Frequency has the Identifier of CBFX-FM-6?
SELECT "Frequency" FROM table_66627 WHERE "Identifier" = 'cbfx-fm-6'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
how many patients whose year of death is less than or equal to 2111 and lab test name is lactate dehydrogenase (ld)?
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.label = "Lactate Dehydrogenase (LD)"
mimicsql_data
CREATE TABLE table_70515 ( "School" text, "Team" text, "Division Record" text, "Overall Record" text, "Season Outcome" text )
Name the overall record for indian river
SELECT "Overall Record" FROM table_70515 WHERE "School" = 'indian river'
wikisql
CREATE TABLE problem_status_codes ( problem_status_code text, problem_status_description text ) CREATE TABLE problems ( problem_id number, product_id number, closure_authorised_by_staff_id number, reported_by_staff_id number, date_problem_reported time, date_problem_closed time, pro...
What are the log id and entry description of each problem?
SELECT problem_log_id, log_entry_description FROM problem_log
spider
CREATE TABLE table_39936 ( "singular" text, "singular gender" text, "plural" text, "plural gender" text, "meaning" text )
What is the plural for the Meaning of night?
SELECT "plural" FROM table_39936 WHERE "meaning" = 'night'
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_DIRE_CD text, MED_DIRE_NM text,...
这名患者78591362过去做了某些检查吗?
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_ID = '78591362' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE table_39925 ( "School" text, "Nickname" text, "Colors" text, "League" text, "Class" text, "Division" text )
What are the colors for the division 2 team with the nickname, the seahawks?
SELECT "Colors" FROM table_39925 WHERE "Division" = 'division 2' AND "Nickname" = 'seahawks'
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...
从2004-08-29到2020-01-27,统计0855489医院的骨外科科室的医疗费总额
SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.MED_SER_ORG_NO = '0855489' AND qtb.MED_ORG_DEPT_NM = '骨科' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.MED_SER_ORG_NO = '0855489' AND gyb.MED_ORG_DEPT_NM = '骨科' UNION SELECT zyb.MED_CLINIC_ID FROM zy...
css
CREATE TABLE table_name_82 ( record VARCHAR, result VARCHAR )
What is the Record of the game with a Result of l 14 16?
SELECT record FROM table_name_82 WHERE result = "l 14–16"
sql_create_context
CREATE TABLE table_70671 ( "Rank" text, "Nation" text, "Gold" text, "Silver" text, "Bronze" text, "Total" text )
Which silver has a Bronze of 1, a Total of 4, and a Nation of slovakia?
SELECT "Silver" FROM table_70671 WHERE "Bronze" = '1' AND "Total" = '4' AND "Nation" = 'slovakia'
wikisql
CREATE TABLE table_name_56 ( status VARCHAR )
What status has a role?
SELECT status FROM table_name_56 WHERE "role" = "role"
sql_create_context
CREATE TABLE table_name_35 ( draws INTEGER, club VARCHAR, played VARCHAR )
How many draws has a Club of real valladolid that was played less than 38?
SELECT MAX(draws) FROM table_name_35 WHERE club = "real valladolid" AND played < 38
sql_create_context
CREATE TABLE table_72399 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text )
Who were the candidates in the Kentucky 4 voting district?
SELECT "Candidates" FROM table_72399 WHERE "District" = 'Kentucky 4'
wikisql
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGui...
which posts where ever featured on meta.
SELECT UserId AS "user_link", COUNT(PostId) AS "number_of_posts" FROM PostHistory WHERE PostHistoryTypeId IN (3, 6) AND Text LIKE '%<featured>%' GROUP BY UserId ORDER BY COUNT(PostId) DESC
sede
CREATE TABLE table_name_25 ( week INTEGER, record VARCHAR )
Record of 0 8 had what lowest week?
SELECT MIN(week) FROM table_name_25 WHERE record = "0–8"
sql_create_context
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate tim...
Users with the most controversial posts.
SELECT p.OwnerUserId AS "user_link", COUNT(*) AS ContACnt FROM (SELECT PostId, up = SUM(CASE WHEN VoteTypeId = 2 THEN 1 ELSE 0 END), down = SUM(CASE WHEN VoteTypeId = 3 THEN 1 ELSE 0 END) FROM Votes AS v JOIN Posts AS p ON p.Id = v.PostId WHERE VoteTypeId IN (2, 3) AND PostTypeId = 2 GROUP BY PostId) AS ContA JOIN Post...
sede
CREATE TABLE CloseReasonTypes ( 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...
Check for profanity in usernames.
SELECT Id AS "user_link", DisplayName FROM Users WHERE LOWER(DisplayName) LIKE '%##Keyword##%'
sede
CREATE TABLE table_44428 ( "Year" real, "Imports (tonnes)" real, "Exports (tonnes)" real, "Total trade (tonnes)" real, "Vessels entering port" real )
What is the highest Total trade (tonnes) after 2001 when the Imports are 144,368 tonnes, the Exports are more than 4,024,311 tonnes, and there are more than 91 vessels entering port?
SELECT MAX("Total trade (tonnes)") FROM table_44428 WHERE "Year" > '2001' AND "Vessels entering port" > '91' AND "Imports (tonnes)" = '144,368' AND "Exports (tonnes)" > '4,024,311'
wikisql
CREATE TABLE table_name_97 ( score VARCHAR, venue VARCHAR )
What score has amblecote as the venue?
SELECT score FROM table_name_97 WHERE venue = "amblecote"
sql_create_context
CREATE TABLE table_13419 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Attendance" text )
Who is the Opponent in the game with a Record of 1 3 0?
SELECT "Opponent" FROM table_13419 WHERE "Record" = '1–3–0'
wikisql
CREATE TABLE table_49654 ( "Year" real, "Domestic passengers" real, "International passengers" real, "Total passengers" real, "Change" text )
What year did the Turku Airport have a total of 116,631 domestic passengers and a total of 308,782 passengers?
SELECT MAX("Year") FROM table_49654 WHERE "Domestic passengers" > '116,631' AND "Total passengers" = '308,782'
wikisql
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_gradu...
In the Winter , when does 890 meet ?
SELECT DISTINCT course_offering.end_time, course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.start_time, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM semester INNER JOIN course_offering ON semester.semester_id = course_o...
advising
CREATE TABLE table_12451 ( "Player" text, "Pos." text, "Nationality" text, "Previous team" text, "Years of NBA experience [a ]" real )
What is the nationality of the player with 2 years of NBA experience for the previously played for the Los Angeles Lakers?
SELECT "Nationality" FROM table_12451 WHERE "Years of NBA experience [a ]" = '2' AND "Previous team" = 'los angeles lakers'
wikisql
CREATE TABLE table_66644 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Attendance" text )
What was the attendance for the game that had the king's lynn as the home team?
SELECT "Attendance" FROM table_66644 WHERE "Home team" = 'king''s lynn'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
Give me the number of patients with lab test item id 51218 who had an abnormal lab test status.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "51218" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
from total number of patients who had spinal tap, how many of them were discharge-transfer to psych hosp
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "DISCH-TRAN TO PSYCH HOSP" AND procedures.short_title = "Spinal tap"
mimicsql_data
CREATE TABLE table_name_81 ( player VARCHAR, position VARCHAR, pick VARCHAR, round VARCHAR )
Who is the player in tight end position in a round below 12 that has a pick greater than 17?
SELECT player FROM table_name_81 WHERE pick > 17 AND round < 12 AND position = "tight end"
sql_create_context
CREATE TABLE table_204_208 ( id number, "year" text, "title" text, "role" text, "episodes" text )
what is the name of the first title ?
SELECT "title" FROM table_204_208 WHERE id = 1
squall
CREATE TABLE table_34679 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Game Site" text, "Attendance" real )
What is the largest attendance at Memorial Stadium on December 12, 1965?
SELECT MAX("Attendance") FROM table_34679 WHERE "Game Site" = 'memorial stadium' AND "Date" = 'december 12, 1965'
wikisql
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
First & Last Date for Posts Bumped N Times by Community User.
SELECT P.Id, B.BumpCount, B.FirstBump, B.LastBump, P.Title FROM Posts AS P JOIN (SELECT PostId, COUNT(*) AS BumpCount, MIN(CreationDate) AS FirstBump, MAX(CreationDate) AS LastBump FROM PostHistory WHERE PostHistoryTypeId = 50 GROUP BY PostId HAVING COUNT(*) > 2) AS B ON P.Id = B.PostId ORDER BY B.BumpCount, P.Id
sede
CREATE TABLE table_14342367_11 ( extra_points VARCHAR, player VARCHAR )
How many extra points did Paul Jones score?
SELECT COUNT(extra_points) FROM table_14342367_11 WHERE player = "Paul Jones"
sql_create_context
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
门诊就诊45476480212的就诊科室编码是什么?名称是什么?
SELECT wdmzjzjlb.JZKSBM, wdmzjzjlb.JZKSMC FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '45476480212' UNION SELECT bdmzjzjlb.JZKSBM, bdmzjzjlb.JZKSMC FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '45476480212'
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
what is drug code of drug name pneumococcal vac polyvalent?
SELECT prescriptions.formulary_drug_cd FROM prescriptions WHERE prescriptions.drug = "Pneumococcal Vac Polyvalent"
mimicsql_data
CREATE TABLE table_name_96 ( date INTEGER, opponent VARCHAR, attendance VARCHAR )
Which Date has an Opponent of milton keynes lightning, and an Attendance smaller than 1,771?
SELECT AVG(date) FROM table_name_96 WHERE opponent = "milton keynes lightning" AND attendance < 1 OFFSET 771
sql_create_context
CREATE TABLE table_name_49 ( tournament VARCHAR )
Which 2013 has a 2007 of A, and a Tournament of french open?
SELECT 2013 FROM table_name_49 WHERE 2007 = "a" AND tournament = "french open"
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 prescriptions...
how many patients admitted before the year 2170 had liver transplant as the primary disease?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "LIVER TRANSPLANT" AND demographic.admityear < "2170"
mimicsql_data
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
how much is the cost for diagnosis of valve replacement < 7days?
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'diagnosis' AND cost.eventid IN (SELECT diagnosis.diagnosisid FROM diagnosis WHERE diagnosis.diagnosisname = 'valve replacement < 7days')
eicu
CREATE TABLE table_51869 ( "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text )
tell me the director of the production code ad1d02.
SELECT "Directed by" FROM table_51869 WHERE "Production code" = 'ad1d02'
wikisql
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, ...
Number of posts by user from France or India per age and location.
SELECT a2."age" AS "Age", a2.Location AS "Location", COUNT(*) AS "count_posts" FROM "Posts " AS a1 LEFT OUTER JOIN Users AS a2 ON (a2.Id = a1."LastEditorUserId ") WHERE (a2.Location IN ('France', 'India')) GROUP BY a2."age", a2.Location ORDER BY 'Age' DESC, 'Location' DESC
sede
CREATE TABLE table_9215 ( "Tournament" text, "Surface" text, "Week" text, "Winner and score" text, "Finalist" text, "Semifinalists" text )
what is the semifinalists when the surface is hard (i)?
SELECT "Semifinalists" FROM table_9215 WHERE "Surface" = 'hard (i)'
wikisql
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE employees ( EMPLOYE...
For those employees who was hired before 2002-06-21, show me about the distribution of hire_date and the average of salary bin hire_date by time in a bar chart, and order total number from low to high order.
SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY AVG(SALARY)
nvbench
CREATE TABLE table_75927 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Opponent" text, "Score" text )
What is the outcome of the 4 6, 6 4, 6 3, 7 6 (7 2) score?
SELECT "Outcome" FROM table_75927 WHERE "Score" = '4–6, 6–4, 6–3, 7–6 (7–2)'
wikisql
CREATE TABLE table_57102 ( "Rd #" real, "Pick #" real, "Player" text, "Team (League)" text, "Reg GP" real, "Pl GP" real )
What is the total reg gp of Ilya Krikunov, who has a round of 7 and a pick number larger than 223?
SELECT COUNT("Reg GP") FROM table_57102 WHERE "Rd #" = '7' AND "Player" = 'ilya krikunov' AND "Pick #" > '223'
wikisql
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 text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
在11-02-09到20-05-11期间,60366088的患者被开出多少次药品3367-2
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_ID = '60366088' AND t_kc22.STA_DATE BETWEEN '2011-02-09' AND '2020-05-11' AND t_kc22.SOC_SRT_DIRE_CD = '3367-2'
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 procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, ...
hydralazine, 0.9% sodium chloride or insulin had been prescribed to patient 27242?
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27242) AND prescriptions.drug IN ('hydralazine', '0.9% sodium chloride', 'insulin')
mimic_iii
CREATE TABLE Stores ( Store_ID VARCHAR(100), Address_ID INTEGER, Marketing_Region_Code CHAR(15), Store_Name VARCHAR(255), Store_Phone VARCHAR(255), Store_Email_Address VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Services ( Service_ID INTEGER, Service_Type_Code CHAR(15), ...
Show all payment method codes and the number of orders for each code. Show bar chart.
SELECT payment_method_code, COUNT(*) FROM Invoices GROUP BY payment_method_code
nvbench
CREATE TABLE table_name_31 ( game VARCHAR, score VARCHAR )
What is the game number with a score of 116 138?
SELECT COUNT(game) FROM table_name_31 WHERE score = "116–138"
sql_create_context