context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_5 ( term_ended VARCHAR, branch VARCHAR )
When did the term end for the U.S. Marine Corps?
SELECT term_ended FROM table_name_5 WHERE branch = "u.s. marine corps"
sql_create_context
CREATE TABLE table_65720 ( "School" text, "Location" text, "Mascot" text, "Enrollment" real, "IHSAA Class" text, "# / County" text )
What school in 72 Scott county has an enrollment more than 473 with an AAA IHSAA Class?
SELECT "School" FROM table_65720 WHERE "Enrollment" > '473' AND "IHSAA Class" = 'aaa' AND "# / County" = '72 scott'
wikisql
CREATE TABLE table_203_734 ( id number, "year" number, "competition" text, "venue" text, "position" text, "event" text, "notes" text )
in what year was lorenzo 's latest competition ?
SELECT MAX("year") FROM table_203_734
squall
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, ...
Of the classes that fill the PreMajor requirement , which one is the easiest ?
SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%PreMajor%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM progra...
advising
CREATE TABLE table_60223 ( "Crude oil name \\Rightarrow Location \\Rightarrow" text, "Barrow Island Australia" real, "Mutineer-Exeter Australia" real, "CPC Blend Kazakhstan" real, "Draugen North Sea" real )
What is the lowest Barrow Island Australia when the Crude oil name \Rightarrow Location \Rightarrow of initial boiling point, c, and a draugen north sea is larger than 150?
SELECT MIN("Barrow Island Australia") FROM table_60223 WHERE "Crude oil name \\Rightarrow Location \\Rightarrow" = 'initial boiling point, °c' AND "Draugen North Sea" > '150'
wikisql
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
For those records from the products and each product's manufacturer, find name and code , and group by attribute headquarter, and visualize them by a bar chart, sort from high to low by the Y-axis.
SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Code DESC
nvbench
CREATE TABLE table_29535057_4 ( location VARCHAR, big_ten_team VARCHAR )
Where did the games that had Wisconsin as big ten team take place?
SELECT location FROM table_29535057_4 WHERE big_ten_team = "Wisconsin"
sql_create_context
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE PostNoticeTypes ( Id number, ClassId ...
All answers by a specific user (including question title).
SELECT a.Id AS "post_link", q.Title, a.Score, q.ViewCount, q.AnswerCount FROM Posts AS a INNER JOIN Posts AS q ON q.Id = a.ParentId WHERE (a.OwnerUserId = '##userid##') ORDER BY a.Id
sede
CREATE TABLE table_name_23 ( points INTEGER, tyres VARCHAR, chassis VARCHAR )
Tell me the average points with tyres of b and chassis of tf109
SELECT AVG(points) FROM table_name_23 WHERE tyres = "b" AND chassis = "tf109"
sql_create_context
CREATE TABLE assignedto ( project VARCHAR, scientist VARCHAR ) CREATE TABLE scientists ( name VARCHAR, SSN VARCHAR ) CREATE TABLE projects ( code VARCHAR, hours INTEGER )
Find the names of scientists who are not working on the project with the highest hours.
SELECT name FROM scientists EXCEPT SELECT T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.hours = (SELECT MAX(hours) FROM projects)
sql_create_context
CREATE TABLE table_19486 ( "Pick #" real, "NFL Team" text, "Player" text, "Position" text, "College" text )
What position does Robert Brooks play?
SELECT COUNT("Position") FROM table_19486 WHERE "Player" = 'Robert Brooks'
wikisql
CREATE TABLE table_76469 ( "Date" text, "H/A/N" text, "Opponent" text, "Score" text, "Record" text )
On what Date was the Score 105-118 and the H/A/N A?
SELECT "Date" FROM table_76469 WHERE "H/A/N" = 'a' AND "Score" = '105-118'
wikisql
CREATE TABLE table_name_17 ( episodes VARCHAR, average_ratings VARCHAR, tv_station VARCHAR )
What Episode on TV Asahi Station has Rating of 12.0%?
SELECT episodes FROM table_name_17 WHERE average_ratings = "12.0%" AND tv_station = "tv asahi"
sql_create_context
CREATE TABLE table_30095 ( "Series #" real, "Season #" real, "Title" text, "Written by" text, "Original air date" text, "U.S. Viewers (millions)" text )
What is the title of the Series 40 Season 5 show?
SELECT "Title" FROM table_30095 WHERE "Season #" = '5'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
what is the admission location and procedure icd9 code for patient id 1121?
SELECT demographic.admission_location, procedures.icd9_code FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "1121"
mimicsql_data
CREATE TABLE jybgb_jyjgzbb ( JYZBLSH number, YLJGDM text, jyjgzbb_id number ) 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,...
医院0230965曾经在2019年5月30日到2020年9月10日这一年多的时间内开出的检验报告单里,按照不同检测指标名称和不一样的检测指标结果定量单位规定,检测指标结果定量的平均值的数值是多些,并且按平均值大小进行降序排列?
SELECT jyjgzbb.JCZBMC, jyjgzbb.JCZBJGDW, AVG(jyjgzbb.JCZBJGDL) FROM jyjgzbb JOIN jybgb_jyjgzbb JOIN jybgb ON jybgb_jyjgzbb.JYZBLSH = jyjgzbb.JYZBLSH AND jybgb_jyjgzbb.jyjgzbb_id = jyjgzbb.jyjgzbb_id AND jybgb_jyjgzbb.YLJGDM = jybgb.YLJGDM WHERE jybgb.YLJGDM = '0230965' AND jyjgzbb.BGRQ BETWEEN '2019-05-30' AND '2020-09...
css
CREATE TABLE table_14903881_1 ( womens_doubles VARCHAR, mens_doubles VARCHAR )
Name the womens doubles when mens doubles is theodoros velkos giorgos patis
SELECT womens_doubles FROM table_14903881_1 WHERE mens_doubles = "Theodoros Velkos Giorgos Patis"
sql_create_context
CREATE TABLE table_name_11 ( long INTEGER, gain VARCHAR, avg_g VARCHAR )
How many longs have a gain less than 379, and 0.8 as an avg/g?
SELECT SUM(long) FROM table_name_11 WHERE gain < 379 AND avg_g = 0.8
sql_create_context
CREATE TABLE table_name_31 ( byes VARCHAR, losses VARCHAR, against VARCHAR )
What is the total number of byes with more than 0 losses and 1526 against?
SELECT COUNT(byes) FROM table_name_31 WHERE losses > 0 AND against = 1526
sql_create_context
CREATE TABLE table_11356 ( "Year" real, "Organization" text, "Award" text, "Work" text, "Result" text )
Where Result is nominated and Organization is 54th the television academy drama awards, what is the award?
SELECT "Award" FROM table_11356 WHERE "Result" = 'nominated' AND "Organization" = '54th the television academy drama awards'
wikisql
CREATE TABLE table_256286_13 ( no_votes INTEGER )
What is the lowest overall amount of no votes?
SELECT MIN(no_votes) FROM table_256286_13
sql_create_context
CREATE TABLE table_204_840 ( id number, "no. in\nseries" number, "no. in\nseason" number, "title" text, "directed by" text, "written by" text, "original air date" text, "prod. code" text )
which episode was written by steve young and directed by jeff mccracken ?
SELECT "title" FROM table_204_840 WHERE "written by" = 'steve young' AND "directed by" = 'jeff mccracken'
squall
CREATE TABLE table_19948664_1 ( countries_sampled VARCHAR, ranking_la__2_ VARCHAR, world_ranking__1_ VARCHAR )
How many countries were sampled for the index in 2nd place in the LA ranking and 23rd in the world ranking?
SELECT countries_sampled FROM table_19948664_1 WHERE ranking_la__2_ = "2nd" AND world_ranking__1_ = "23rd"
sql_create_context
CREATE TABLE table_name_54 ( city VARCHAR, school VARCHAR )
Which City has a School of indianapolis brebeuf?
SELECT city FROM table_name_54 WHERE school = "indianapolis brebeuf"
sql_create_context
CREATE TABLE table_name_19 ( attendance INTEGER, date VARCHAR )
How many attended on march 1?
SELECT AVG(attendance) FROM table_name_19 WHERE date = "march 1"
sql_create_context
CREATE TABLE table_name_38 ( away_team VARCHAR, venue VARCHAR )
Which away team is from junction oval?
SELECT away_team FROM table_name_38 WHERE venue = "junction oval"
sql_create_context
CREATE TABLE table_name_7 ( covered_song VARCHAR, album VARCHAR )
What is the name of the Covered Song when the Album shows cover version iii?
SELECT covered_song FROM table_name_7 WHERE album = "cover version iii"
sql_create_context
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, cha...
when patient 5828 had the first measurement of arterial bp mean on the current icu visit?
SELECT chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5828) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHE...
mimic_iii
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...
患者08045413检验的脸部的各项指标结果怎么样?
SELECT * FROM hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i...
css
CREATE TABLE table_name_8 ( score VARCHAR, time VARCHAR )
What was the score for the team with a time of 2:44?
SELECT score FROM table_name_8 WHERE time = "2:44"
sql_create_context
CREATE TABLE table_name_24 ( pre__season VARCHAR, mar_3 VARCHAR, poll VARCHAR )
Which pre-season has a Mar. 3 of nr, and a Poll of usa today/espn coaches' poll (top 25)?
SELECT pre__season FROM table_name_24 WHERE mar_3 = "nr" AND poll = "usa today/espn coaches' poll (top 25)"
sql_create_context
CREATE TABLE table_name_52 ( points VARCHAR, score VARCHAR, record VARCHAR )
What is the points when the score was 3 1, and record was 25 19 11?
SELECT points FROM table_name_52 WHERE score = "3–1" AND record = "25–19–11"
sql_create_context
CREATE TABLE table_name_21 ( consider VARCHAR, candidate VARCHAR, poll_source VARCHAR, oppose VARCHAR )
What percentage of people said they would consider Rudy Giuliani as a candidate according to the Newsweek poll that showed 32% opposed him?
SELECT consider FROM table_name_21 WHERE poll_source = "newsweek poll" AND oppose = "32%" AND candidate = "rudy giuliani"
sql_create_context
CREATE TABLE table_name_11 ( position VARCHAR, season VARCHAR )
What position has 2008 as the season?
SELECT position FROM table_name_11 WHERE season = "2008"
sql_create_context
CREATE TABLE table_1342359_4 ( result VARCHAR, district VARCHAR )
What was the result of the election in the Arkansas 2 district?
SELECT result FROM table_1342359_4 WHERE district = "Arkansas 2"
sql_create_context
CREATE TABLE table_name_11 ( kinka_13 VARCHAR, kinka_developer VARCHAR, version VARCHAR )
What is the KINKA 1.3 when the developer is yes and the support version is support mo 230?
SELECT kinka_13 FROM table_name_11 WHERE kinka_developer = "yes" AND version = "support mo 230"
sql_create_context
CREATE TABLE table_66232 ( "Year" real, "Stage" real, "Start" text, "Finish" text, "Leader at the summit" text )
Who was the leader at the summit earlier than 1956, when Carcassonne shows for finish?
SELECT "Leader at the summit" FROM table_66232 WHERE "Year" < '1956' AND "Finish" = 'carcassonne'
wikisql
CREATE TABLE table_203_375 ( id number, "name" text, "year built" text, "country" text, "town" text, "height" text, "remarks" text )
which pylon is the least tall ?
SELECT "name" FROM table_203_375 ORDER BY "height" LIMIT 1
squall
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
give me the number of patients whose age is less than 62 and days of hospital stay is greater than 7?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "62" AND demographic.days_stay > "7"
mimicsql_data
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,...
从2004年9月1日到2015年6月4日,患者41517594看病时被开出药品3992-4的次数总共有多少
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 = '41517594' AND t_kc22.STA_DATE BETWEEN '2004-09-01' AND '2015-06-04' AND t_kc22.SOC_SRT_DIRE_CD = '3992-4'
css
CREATE TABLE table_name_43 ( standalone VARCHAR, console VARCHAR )
What is the Standalone in the year when Space Invaders is the Console?
SELECT standalone FROM table_name_43 WHERE console = "space invaders"
sql_create_context
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age te...
count the number of times that patient 006-80884 has received a anion gap laboratory test since 2105.
SELECT COUNT(*) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-80884')) AND lab.labname = 'anion gap' AND STRFTIME('%y', lab.labresulttime) >= '2105'
eicu
CREATE TABLE table_23316034_16 ( matches INTEGER, runs VARCHAR )
If the runs is 5028, what is the matches maximum?
SELECT MAX(matches) FROM table_23316034_16 WHERE runs = 5028
sql_create_context
CREATE TABLE table_65925 ( "Year" real, "Venue" text, "Competition" text, "Kilkenny score" text, "Waterford score" text )
What is the lowest year that has all-ireland hurling final as the competition, and 6-08 (24) as the waterford score?
SELECT MIN("Year") FROM table_65925 WHERE "Competition" = 'all-ireland hurling final' AND "Waterford score" = '6-08 (24)'
wikisql
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 zyjzjlb ( YLJGDM text, JZLSH ...
检验技师在检验报告单26318854266中的工号是什么?姓名是什么呢?
SELECT JYJSGH, JYJSQM FROM jybgb WHERE BGDH = '26318854266'
css
CREATE TABLE phone ( Name VARCHAR, Phone_ID VARCHAR ) CREATE TABLE phone_market ( Phone_ID VARCHAR, Num_of_stock INTEGER )
Show the names of phones that have total number of stocks bigger than 2000, in descending order of the total number of stocks.
SELECT T2.Name FROM phone_market AS T1 JOIN phone AS T2 ON T1.Phone_ID = T2.Phone_ID GROUP BY T2.Name HAVING SUM(T1.Num_of_stock) >= 2000 ORDER BY SUM(T1.Num_of_stock) DESC
sql_create_context
CREATE TABLE table_60280 ( "Year" real, "Date (Opening)" text, "Date (Closing)" text, "Opening Film" text, "Number of Screening" text )
What is Date (Opening), when Opening Film is 'Another Myanmar, Mae Sot'?
SELECT "Date (Opening)" FROM table_60280 WHERE "Opening Film" = 'another myanmar, mae sot'
wikisql
CREATE TABLE table_71114 ( "Year" text, "Start" text, "Qual" text, "Rank" text, "Finish" text, "Laps" real )
What is the lowest laps with a 142.744 qual?
SELECT MIN("Laps") FROM table_71114 WHERE "Qual" = '142.744'
wikisql
CREATE TABLE table_23459 ( "Year(s)" real, "Television commentator" text, "Dual Television commentator" text, "Radio commentator" text, "Spokesperson" text )
Who is the television commentator when the radio commentator is Galyna Babiy?
SELECT "Television commentator" FROM table_23459 WHERE "Radio commentator" = 'Galyna Babiy'
wikisql
CREATE TABLE table_24817 ( "Condition" text, "Prothrombin time" text, "Partial thromboplastin time" text, "Bleeding time" text, "Platelet count" text )
How many time does the platelet count occur when prothrombin time and bleeding time are prolonged?
SELECT COUNT("Platelet count") FROM table_24817 WHERE "Prothrombin time" = 'Prolonged' AND "Bleeding time" = 'Prolonged'
wikisql
CREATE TABLE table_17663 ( "Strongs #" text, "Hebrew word" text, "Strongs Transliteration" text, "Strongs Words Compounded" text, "English Spelling" text )
What is the strongs # for the hebrew word ?
SELECT "Strongs #" FROM table_17663 WHERE "Hebrew word" = 'יִרְמְיָה'
wikisql
CREATE TABLE table_261913_1 ( enrollment INTEGER, institution VARCHAR )
What is the enrollment for Augsburg college?
SELECT MIN(enrollment) FROM table_261913_1 WHERE institution = "Augsburg College"
sql_create_context
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...
how many female patients are with procedure icd9 code 8968?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "F" AND procedures.icd9_code = "8968"
mimicsql_data
CREATE TABLE table_name_8 ( gold INTEGER, nation VARCHAR )
what is the highest gold when the nation is total and the total is less than 24?
SELECT MAX(gold) FROM table_name_8 WHERE nation = "total" AND "total" < 24
sql_create_context
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM ...
名叫沈清涵的病患的检验报告单的报告日期在10年11月18日之后的是在哪些住院就诊的?列出流水号
SELECT zyjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '沈清涵' AND NOT zyjzjlb.JZLSH IN (SELECT zyjybgb.JZLSH FROM zyjybgb WHERE zyjybgb.BGRQ <= '2010-11-18' UNI...
css
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 Plays_Games ( StuID INTEGER, GameID INTEGER, Hours_Played INTEGER ) CREATE TABLE SportsInfo ( Stu...
Show all sport name and the number of students in a bar chart, display from low to high by the bar.
SELECT SportName, COUNT(*) FROM SportsInfo GROUP BY SportName ORDER BY SportName
nvbench
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE VoteTypes ( Id number, Name text ) C...
android tag usage by user.
SELECT t.TagName, p.OwnerUserId, p.CreationDate FROM Posts AS p INNER JOIN PostTags AS pt ON p.Id = pt.PostId INNER JOIN Tags AS t ON pt.TagId = t.Id AND t.TagName LIKE '%android%' WHERE DATEDIFF(d, GETDATE(), CreationDate) >= -30
sede
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
把医院8257985全部诊疗记录中个人需要自费的部分与总的医疗花费的比值最小值依科室的不同和出院诊断编码的差别列出来,把结果按从小到大来显示
SELECT t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_CD, MIN(t_kc24.PER_EXP / t_kc24.MED_AMOUT) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '8257985' GROUP BY t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_CD ORDER BY MIN(t_kc24.PER_EXP / t_kc24.MED_AMOUT)
css
CREATE TABLE table_3430 ( "Series #" real, "Season #" real, "Title" text, "Director" text, "Writer(s)" text, "Airdate" text )
How many directors were there for series # 431?
SELECT COUNT("Director") FROM table_3430 WHERE "Series #" = '431'
wikisql
CREATE TABLE table_29295463_9 ( champion VARCHAR, runner_up VARCHAR )
Who became the champion for the 1984 Grand Prix where Marty Davis was the runner-up?
SELECT champion FROM table_29295463_9 WHERE runner_up = "Marty Davis"
sql_create_context
CREATE TABLE party_events ( Event_ID int, Event_Name text, Party_ID int, Member_in_charge_ID int ) CREATE TABLE region ( Region_ID int, Region_name text, Date text, Label text, Format text, Catalogue text ) CREATE TABLE member ( Member_ID int, Member_Name text, Part...
Give me a histogram for how many members are in each party?, and could you list by the y-axis from high to low?
SELECT Party_name, COUNT(*) FROM member AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_name_58 ( bronze INTEGER, nation VARCHAR, gold VARCHAR )
What is the smallest bronze with a Nation of west germany, and a Gold larger than 0?
SELECT MIN(bronze) FROM table_name_58 WHERE nation = "west germany" AND gold > 0
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 PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId numb...
Where do users dominate comments?.
SELECT c.UserId AS "user_link", COUNT(DISTINCT p.Id) AS postsCount FROM Posts AS p INNER JOIN Comments AS c ON p.Id = c.PostId WHERE p.CommentCount >= @commentcount AND CAST((SELECT COUNT(Id) FROM Comments WHERE PostId = p.Id AND UserId = c.UserId) AS FLOAT) >= @percentage * CAST(p.CommentCount AS FLOAT) GROUP BY c.Use...
sede
CREATE TABLE table_name_57 ( top_10 INTEGER, cuts_made INTEGER )
Which Top-10 has a Cuts made larger than 42?
SELECT MIN(top_10) FROM table_name_57 WHERE cuts_made > 42
sql_create_context
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 )
Visualize the title and and the average star rating of the movie using a bar chart, display from low to high by the y-axis.
SELECT title, AVG(stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY title ORDER BY AVG(stars)
nvbench
CREATE TABLE table_63311 ( "School" text, "Location" text, "Mascot" text, "Enrollment" real, "IHSAA Class" text, "# / County" text )
What school that has a IHSAA Class of AA, in Butler?
SELECT "School" FROM table_63311 WHERE "IHSAA Class" = 'aa' AND "Location" = 'butler'
wikisql
CREATE TABLE game ( stadium_id int, id int, Season int, Date text, Home_team text, Away_team text, Score text, Competition text ) CREATE TABLE injury_accident ( game_id int, id int, Player text, Injury text, Number_of_matches text, Source text ) CREATE TABLE sta...
Show the number of games in each season and group by away team in a group line chart The x-axis is season, and could you display by the Season in ascending?
SELECT Season, COUNT(Season) FROM game GROUP BY Away_team ORDER BY Season
nvbench
CREATE TABLE table_name_91 ( icao VARCHAR, city VARCHAR )
What is the IcAO of Frankfurt?
SELECT icao FROM table_name_91 WHERE city = "frankfurt"
sql_create_context
CREATE TABLE table_204_175 ( id number, "pos" text, "no." number, "driver" text, "team" text, "laps" number, "time/retired" text, "grid" number, "laps led" number, "points" number )
who is after will power
SELECT "driver" FROM table_204_175 WHERE "pos" = (SELECT "pos" FROM table_204_175 WHERE "driver" = 'will power') + 1
squall
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, ...
show me the number of asian patients whose drug type is main.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "ASIAN" AND prescriptions.drug_type = "MAIN"
mimicsql_data
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
calculate the maximum days for which patients who died before 2155 stayed in hospital.
SELECT MAX(demographic.days_stay) FROM demographic WHERE demographic.dod_year < "2155.0"
mimicsql_data
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH te...
门诊给08451089这个病人诊断为高血压病,看看编号为516626的这个检测指标的结果定量及其单位
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jybgb_jyjgzbb.Y...
css
CREATE TABLE table_29911 ( "No in series" real, "No in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real )
How many people directed 'the one with rachel's dream'?
SELECT COUNT("Directed by") FROM table_29911 WHERE "Title" = 'The One with Rachel''s Dream'
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, ...
how many paitents aged below 24 years had a id drug route.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "24" AND prescriptions.route = "ID"
mimicsql_data
CREATE TABLE table_name_83 ( name VARCHAR, position VARCHAR, weight VARCHAR )
What is the name of the player who is a wr and has a weight of 197?
SELECT name FROM table_name_83 WHERE position = "wr" AND weight = 197
sql_create_context
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code tex...
what's the first prescription time for insulin lispro (humalog) injection 0-20 units for patient 018-41654 in 10/last year?
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 = '018-41654')) AND medication.drugname = 'insulin lispro (humalo...
eicu
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttim...
calculate the number of people who have had procedure-one vessel since 6 years ago.
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'procedure-one vessel') AND DATETIME(procedures_icd.c...
mimic_iii
CREATE TABLE table_53076 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What location was the game played at when Richmond was the away team?
SELECT "Venue" FROM table_53076 WHERE "Away team" = 'richmond'
wikisql
CREATE TABLE table_17978 ( "Member countries" text, "Population" real, "Area (km\u00b2)" real, "GDP (billion US$)" text, "GDP per capita (US$)" real )
Name the gdp where gdp per capita 20200
SELECT "GDP (billion US$)" FROM table_17978 WHERE "GDP per capita (US$)" = '20200'
wikisql
CREATE TABLE table_43294 ( "Date" text, "Time" text, "Channel" text, "Running Time" text, "Notes" text )
Which channel was on 28 December 2008?
SELECT "Channel" FROM table_43294 WHERE "Date" = '28 december 2008'
wikisql
CREATE TABLE table_name_39 ( division VARCHAR, open_cup VARCHAR )
Which division was the Rampage in when they were in the 2nd round in the Open Cup?
SELECT division FROM table_name_39 WHERE open_cup = "2nd round"
sql_create_context
CREATE TABLE table_name_10 ( time_retired VARCHAR, laps VARCHAR, driver VARCHAR )
When the driver is innes ireland and they drove under 53 laps, what was the Time/Retired?
SELECT time_retired FROM table_name_10 WHERE laps < 53 AND driver = "innes ireland"
sql_create_context
CREATE TABLE table_67029 ( "Title" text, "Year" text, "Developer" text, "Publisher" text, "Platform" text )
Who was the developer for Vigilance?
SELECT "Developer" FROM table_67029 WHERE "Title" = 'vigilance'
wikisql
CREATE TABLE table_31476 ( "Round" real, "Circuit" text, "Date" text, "Length" text, "Pole Position" text, "GT3 Winner" text, "GT4 Winner" text )
When david ashburn richard westbrook is the gt3 winner and 1 is the round what is the length?
SELECT "Length" FROM table_31476 WHERE "Round" = '1' AND "GT3 Winner" = 'David Ashburn Richard Westbrook'
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...
A bar chart shows the distribution of All_Home and the average of School_ID , and group by attribute All_Home, and list in descending by the bars.
SELECT All_Home, AVG(School_ID) FROM basketball_match GROUP BY All_Home ORDER BY All_Home DESC
nvbench
CREATE TABLE table_name_66 ( opponent_in_the_final VARCHAR, outcome VARCHAR )
What is the Opponent in the final when the outcome was runner-up?
SELECT opponent_in_the_final FROM table_name_66 WHERE outcome = "runner-up"
sql_create_context
CREATE TABLE table_73699 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text )
When us open (2) is the championship what is the surface?
SELECT "Surface" FROM table_73699 WHERE "Championship" = 'US Open (2)'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime t...
tell me the first procedure patient 025-39356 had the previous 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 = '025-39356')) AND DATETIME(treatment.treatmenttime, 'start of year...
eicu
CREATE TABLE table_10613 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Who was the home team at the game with a crowd larger than 32,576?
SELECT "Home team score" FROM table_10613 WHERE "Crowd" > '32,576'
wikisql
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE treatment ( treat...
what is the last ward id patient 006-254182 got.
SELECT patient.wardid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-254182') ORDER BY patient.unitadmittime DESC LIMIT 1
eicu
CREATE TABLE table_name_84 ( winning_driver VARCHAR, winning_car VARCHAR, winning_team VARCHAR )
Who was the winning driver driving the winning car March - Honda 86j, with the winning team Team Nova?
SELECT winning_driver FROM table_name_84 WHERE winning_car = "march - honda 86j" AND winning_team = "team nova"
sql_create_context
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE gsi ( c...
For the Fall and Winter , what upper-level electives are offered ?
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.course_id WHERE (semester.semester = ...
advising
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...
在09年1月7日到14年9月23日期间病号陶寒香都有什么检查方法记录在检验结果指标记录中?
SELECT jyjgzbb.JCFF 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 jybgb....
css
CREATE TABLE table_name_2 ( extra VARCHAR, tournament VARCHAR, result VARCHAR )
What extra has world championships as the tournament, and 1st as the result?
SELECT extra FROM table_name_2 WHERE tournament = "world championships" AND result = "1st"
sql_create_context
CREATE TABLE table_name_46 ( record VARCHAR, decision VARCHAR, november VARCHAR )
What is the record when the decision was valiquette on November 23?
SELECT record FROM table_name_46 WHERE decision = "valiquette" AND november = 23
sql_create_context
CREATE TABLE table_186468_1 ( property VARCHAR, q_band VARCHAR )
When 8.3 is the q-band what is the property?
SELECT property FROM table_186468_1 WHERE q_band = "8.3"
sql_create_context
CREATE TABLE table_name_97 ( week INTEGER, result VARCHAR, partner VARCHAR )
In what Week resulting in the bottom 3 was Endre Jansen Partner?
SELECT MAX(week) FROM table_name_97 WHERE result = "bottom 3" AND partner = "endre jansen"
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
how many greek orthodox religious background patients have lab test item id 51419?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.religion = "GREEK ORTHODOX" AND lab.itemid = "51419"
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 Comments ( Id number, PostId number, Score numb...
How many posts are there on the website?.
SELECT * FROM Posts
sede
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime ti...
how many days did it elapse since patient 52898 was first diagnosed with cardiac dysrhythmias nec in their current hospital encounter?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnoses_icd.charttime)) FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'cardiac dysrhythmias nec') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM adm...
mimic_iii