context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
按照科室的不同名字和入院诊断的不同编码算算看医院5532316所有记载里患者的平均年纪
SELECT gwyjzb.MED_ORG_DEPT_NM, gwyjzb.IN_DIAG_DIS_CD, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '5532316' GROUP BY gwyjzb.MED_ORG_DEPT_NM, gwyjzb.IN_DIAG_DIS_CD UNION SELECT fgwyjzb.MED_ORG_DEPT_NM, fgwyjzb.IN_DIAG_DIS_CD, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '55323...
css
CREATE TABLE table_52110 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Date" text )
What was the venue when the home team was Fitzroy?
SELECT "Venue" FROM table_52110 WHERE "Home team" = 'fitzroy'
wikisql
CREATE TABLE table_24053 ( "Episode" text, "Broadcast date" text, "Run time" text, "Viewers (in millions)" text, "Archive" text )
Name the episode for run time 25:05
SELECT "Episode" FROM table_24053 WHERE "Run time" = '25:05'
wikisql
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text te...
Top android cities in asutralia.
WITH USER_BY_TAG AS (SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS Rank, u.Location, COUNT(*) AS NumTags FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND VoteTypeId = 2 INNER JOIN Users AS u ON u.Id = p.OwnerU...
sede
CREATE TABLE table_60413 ( "Year" real, "Name of Tournament" text, "Champions" text, "Runners-up" text, "Score" text )
In What Tournament did Boris Becker have a Score of 7 6, 6 4?
SELECT "Name of Tournament" FROM table_60413 WHERE "Champions" = 'boris becker' AND "Score" = '7–6, 6–4'
wikisql
CREATE TABLE director ( did int, gender text, name text, nationality text, birth_city text, birth_year int ) CREATE TABLE tv_series ( sid int, title text, release_year int, num_of_seasons int, num_of_episodes int, title_aka text, budget text ) CREATE TABLE cast ( ...
What is the number of movies produced in 2013 ?
SELECT COUNT(DISTINCT (title)) FROM movie WHERE release_year = 2013
imdb
CREATE TABLE table_61993 ( "Source" text, "Date" text, "Kaine (D)" text, "Kilgore (R)" text, "Potts (I)" text )
On which date did Potts (I) poll at 9%?
SELECT "Date" FROM table_61993 WHERE "Potts (I)" = '9%'
wikisql
CREATE TABLE table_name_9 ( enrollment VARCHAR, mascot VARCHAR )
What is the enrollment for the school with the mascot of the Fighting '59ers?
SELECT enrollment FROM table_name_9 WHERE mascot = "fighting '59ers"
sql_create_context
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, ...
how many patients admitted urgently were transferred within the facilty?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.admission_location = "TRSF WITHIN THIS FACILITY"
mimicsql_data
CREATE TABLE table_name_87 ( place INTEGER, average VARCHAR, downhill VARCHAR )
Where was the place that the downhill was 71.6 and the average was less than 90.06?
SELECT SUM(place) FROM table_name_87 WHERE average < 90.06 AND downhill = 71.6
sql_create_context
CREATE TABLE table_48218 ( "Category" text, "Speed (km/h)" real, "Speed (mph)" real, "Vehicle" text, "Pilot" text, "Date" text )
In which category is Frank Scarabino a pilot?
SELECT "Category" FROM table_48218 WHERE "Pilot" = 'frank scarabino'
wikisql
CREATE TABLE table_26905 ( "Team" text, "Slogan" text, "Match1" real, "Match2" real, "Match3" real, "Match4" real, "Match5" real, "Total" real )
What is the score for match 1 for the team Eastern Tigers?
SELECT "Match1" FROM table_26905 WHERE "Team" = 'Eastern Tigers'
wikisql
CREATE TABLE table_2897457_4 ( position VARCHAR, nhl_team VARCHAR )
How many positions drafted for the Minnesota North Stars?
SELECT COUNT(position) FROM table_2897457_4 WHERE nhl_team = "Minnesota North Stars"
sql_create_context
CREATE TABLE table_58383 ( "Ship" text, "Pennant number" text, "Laid down" text, "Launched" text, "Completed" text )
When is the completed date of the destroyer with a pennant number h63?
SELECT "Completed" FROM table_58383 WHERE "Pennant number" = 'h63'
wikisql
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
在2004年9月6日到2020年10月17日期间,7510294医疗机构的有多少新生儿门诊的就诊记录
SELECT COUNT(*) FROM mzjzjlb JOIN hz_info_mzjzjlb JOIN hz_info ON hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.mzjzjlb_id = mzjzjlb.mzjzjlb_id AND hz_info_mzjzjlb.YLJGDM = hz_info.YLJGDM WHERE hz_info.YLJGDM = '75...
css
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...
在二零零一年五月二十八日到二零二一年九月二十一日的这二十年里,查一下医疗机构9694993新生儿门诊的就诊记录数量
SELECT COUNT(*) FROM mzjzjlb WHERE mzjzjlb.YLJGDM = '9694993' AND mzjzjlb.JZKSRQ BETWEEN '2001-05-28' AND '2021-09-21' AND mzjzjlb.ZSEBZ > 0
css
CREATE TABLE table_203_639 ( id number, "year" text, "number" text, "name" text )
how many years does the table cover in total ?
SELECT MAX("year") - MIN("year") FROM table_203_639
squall
CREATE TABLE table_name_56 ( thickness VARCHAR, diameter VARCHAR )
Which Thickness has a Diameter of 21.9mm?
SELECT thickness FROM table_name_56 WHERE diameter = "21.9mm"
sql_create_context
CREATE TABLE table_72498 ( "Outcome" text, "Year" text, "Location" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text )
How many locations hosted Claudia Kohde-Kilsch Eva Pfaff?
SELECT COUNT("Location") FROM table_72498 WHERE "Opponents" = 'Claudia Kohde-Kilsch Eva Pfaff'
wikisql
CREATE TABLE Customers ( customer_id INTEGER, customer_first_name VARCHAR(20), customer_last_name VARCHAR(20), customer_address VARCHAR(255), customer_phone VARCHAR(255), customer_email VARCHAR(255), other_customer_details VARCHAR(255) ) CREATE TABLE Financial_Transactions ( transaction...
Show the card type codes and the number of transactions. Visualize by bar chart.
SELECT card_type_code, COUNT(*) FROM Financial_Transactions AS T1 JOIN Customers_Cards AS T2 ON T1.card_id = T2.card_id GROUP BY T2.card_type_code
nvbench
CREATE TABLE table_name_13 ( total INTEGER, rank VARCHAR, county VARCHAR, tally VARCHAR )
Which Total has a County of kilkenny, and a Tally of 1 4, and a Rank larger than 10?
SELECT AVG(total) FROM table_name_13 WHERE county = "kilkenny" AND tally = "1–4" AND rank > 10
sql_create_context
CREATE TABLE Documents_to_be_Destroyed ( Document_ID INTEGER, Destruction_Authorised_by_Employee_ID INTEGER, Destroyed_by_Employee_ID INTEGER, Planned_Destruction_Date DATETIME, Actual_Destruction_Date DATETIME, Other_Details VARCHAR(255) ) CREATE TABLE Ref_Locations ( Location_Code CHAR(15...
Show the number of documents in different ending date and group by ending date with a line chart, and sort in ascending by the x-axis.
SELECT Date_in_Locaton_To, COUNT(Date_in_Locaton_To) FROM Document_Locations GROUP BY Date_in_Locaton_To ORDER BY Date_in_Locaton_To
nvbench
CREATE TABLE table_11751 ( "Town/City" text, "Population" real, "Operator" text, "First year" real, "Duration" text )
Which is the smallest First year when the population is 32,645?
SELECT MIN("First year") FROM table_11751 WHERE "Population" = '32,645'
wikisql
CREATE TABLE table_26906 ( "Codename (main article)" text, "Brand name (list)" text, "Cores" real, "L3 Cache" text, "Socket" text, "TDP" text, "I/O Bus" text )
How many sockets are listed that have a brand name of 'Core i3-2xx7m'?
SELECT COUNT("Socket") FROM table_26906 WHERE "Brand name (list)" = 'Core i3-2xx7M'
wikisql
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...
之前,患者彭璇玑的异常情况有什么?
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jy...
css
CREATE TABLE table_3266 ( "Episode Number" text, "Episode" text, "Original Airdate" text, "Rating" text, "Share" text, "Rating/Share (18\u201349)" text, "Viewers (millions)" text, "Weekly Rank" real )
What number episode was Week 4, Part 1?
SELECT "Episode Number" FROM table_3266 WHERE "Episode" = 'Week 4, Part 1'
wikisql
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 prescriptions...
provide the number of patients whose insurance is self pay and days of hospital stay is greater than 20?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Self Pay" AND demographic.days_stay > "20"
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...
which patients are covered under medicare health insurance?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Medicare"
mimicsql_data
CREATE TABLE table_77656 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Who was home at Princes Park?
SELECT "Home team score" FROM table_77656 WHERE "Venue" = 'princes park'
wikisql
CREATE TABLE table_71230 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real )
Which Country has a Place of t8 and byron nelson?
SELECT "Country" FROM table_71230 WHERE "Place" = 't8' AND "Player" = 'byron nelson'
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...
find the number of single patients whose drug route is iv bolus.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.marital_status = "SINGLE" AND prescriptions.route = "IV BOLUS"
mimicsql_data
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, ...
Of the two classes , which is easier , EECS 566 or EECS 792 ?
SELECT DISTINCT course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (course.number = 566 OR course.number = 792) AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 INNER JOIN course AS COURSEalias1 ON ...
advising
CREATE TABLE table_20022 ( "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 )
Name the most w when ends lost is 49
SELECT MAX("W") FROM table_20022 WHERE "Ends Lost" = '49'
wikisql
CREATE TABLE table_43399 ( "Season" text, "Games" real, "Lost" real, "Points" real, "Pct %" real, "Goals for" real, "Goals against" real, "Playoffs" text )
What is the average Lost, when Games is less than 82, when Points is less than 95, and when Pct % is less than 0.506?
SELECT AVG("Lost") FROM table_43399 WHERE "Games" < '82' AND "Points" < '95' AND "Pct %" < '0.506'
wikisql
CREATE TABLE table_name_54 ( borough VARCHAR, location VARCHAR, listed VARCHAR )
What is the Borough for the Seward listing on 1977-11-23?
SELECT borough FROM table_name_54 WHERE location = "seward" AND listed = "1977-11-23"
sql_create_context
CREATE TABLE table_62813 ( "Club" text, "Winners" real, "Last final won" text, "Runners-up" real, "Last final lost" text )
what is the last final won when runners-up is 1 and club is rijeka?
SELECT "Last final won" FROM table_62813 WHERE "Runners-up" = '1' AND "Club" = 'rijeka'
wikisql
CREATE TABLE table_62491 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What player is from France?
SELECT "Player" FROM table_62491 WHERE "Country" = 'france'
wikisql
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 jybgb ( BBCJBW text, BBDM tex...
在门诊诊断患者为抽动秽语综合征的籍贯代码是多少?籍贯名称叫啥?相应人数分别是多少?
SELECT person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) FROM person_info JOIN hz_info JOIN mzjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND ...
css
CREATE TABLE table_name_19 ( to_par INTEGER, place VARCHAR, player VARCHAR )
What is the highest to par of player mark brooks, who has a t2 place?
SELECT MAX(to_par) FROM table_name_19 WHERE place = "t2" AND player = "mark brooks"
sql_create_context
CREATE TABLE table_name_77 ( home_team VARCHAR, away_team VARCHAR )
What is the home side's score when geelong is the away team?
SELECT home_team AS score FROM table_name_77 WHERE away_team = "geelong"
sql_create_context
CREATE TABLE table_204_91 ( id number, "year" number, "original title" text, "english title" text, "role" text, "notes" text )
what are the number of films starring henrik malberg that have translated english titles ?
SELECT COUNT("english title") FROM table_204_91
squall
CREATE TABLE table_29261823_10 ( aggregate_score VARCHAR, contest_and_round VARCHAR )
what is the aggregate score for the europa league play off round contest and round
SELECT aggregate_score FROM table_29261823_10 WHERE contest_and_round = "Europa League Play Off Round"
sql_create_context
CREATE TABLE advisor ( s_ID varchar(5), i_ID varchar(5) ) CREATE TABLE section ( course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0), building varchar(15), room_number varchar(7), time_slot_id varchar(4) ) CREATE TABLE classroom ( building varchar(15...
Find the number of courses offered by Psychology department in each year with a line chart, rank by the X-axis from low to high.
SELECT year, COUNT(year) FROM course AS T1 JOIN section AS T2 ON T1.course_id = T2.course_id WHERE T1.dept_name = 'Psychology' ORDER BY year
nvbench
CREATE TABLE table_68488 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
Which date has a competition type of friendly and a score of 2-1?
SELECT "Date" FROM table_68488 WHERE "Competition" = 'friendly' AND "Score" = '2-1'
wikisql
CREATE TABLE table_name_37 ( nationality VARCHAR, lane VARCHAR, rank VARCHAR )
What is the Nationality of the Swimmer in Lane 4 or larger with a Rank of 5 or more?
SELECT nationality FROM table_name_37 WHERE lane > 4 AND rank > 5
sql_create_context
CREATE TABLE table_name_49 ( date VARCHAR, visiting_team VARCHAR, result VARCHAR )
When was the game that had the St. Louis Rams as visiting team and resulted in a score of 26-0?
SELECT date FROM table_name_49 WHERE visiting_team = "st. louis rams" AND result = "26-0"
sql_create_context
CREATE TABLE table_2522473_1 ( home_ground VARCHAR, seasons VARCHAR, home_city VARCHAR )
What is the home ground for the team whose home city is Trondheim with 27 seasons?
SELECT home_ground FROM table_2522473_1 WHERE seasons = 27 AND home_city = "Trondheim"
sql_create_context
CREATE TABLE table_17275810_7 ( outgoing_manager VARCHAR, team VARCHAR )
Name the outgoing manager for mantova
SELECT outgoing_manager FROM table_17275810_7 WHERE team = "Mantova"
sql_create_context
CREATE TABLE table_17118657_8 ( high_assists VARCHAR, score VARCHAR )
How many high assists are listed for the game with a score of 68-60?
SELECT COUNT(high_assists) FROM table_17118657_8 WHERE score = "68-60"
sql_create_context
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidan...
List of users with the given username.
SELECT Id AS "user_link", Reputation, CreationDate AS LastAccessDate FROM Users WHERE (DisplayName = '##name?Andrew##') AND (Reputation >= '##min?1##') ORDER BY Reputation DESC LIMIT 100
sede
CREATE TABLE table_69884 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Time" text, "Att." real, "Record" text )
What date has 2:48 as the time?
SELECT "Date" FROM table_69884 WHERE "Time" = '2:48'
wikisql
CREATE TABLE artist ( country VARCHAR, artist_name VARCHAR ) CREATE TABLE song ( artist_name VARCHAR )
Find the country of origin for the artist who made the least number of songs?
SELECT T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name GROUP BY T2.artist_name ORDER BY COUNT(*) LIMIT 1
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
mention the death status and procedure short title of patient with patient id 26285.
SELECT demographic.expire_flag, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "26285"
mimicsql_data
CREATE TABLE table_17120964_5 ( result VARCHAR, man_of_the_match VARCHAR, venue VARCHAR )
Name the result for lukas smital and home
SELECT result FROM table_17120964_5 WHERE man_of_the_match = "Lukas Smital" AND venue = "Home"
sql_create_context
CREATE TABLE table_name_1 ( event VARCHAR, gold VARCHAR )
what is the event when gold is darren kenny great britain (gbr)?
SELECT event FROM table_name_1 WHERE gold = "darren kenny great britain (gbr)"
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...
what is the maximum age of patients who posses self pay insurance and diagnosed with primary disease gangrene?
SELECT MAX(demographic.age) FROM demographic WHERE demographic.insurance = "Self Pay" AND demographic.diagnosis = "GANGRENE"
mimicsql_data
CREATE TABLE Activity ( actid INTEGER, activity_name varchar(25) ) CREATE TABLE Faculty_Participates_in ( FacID INTEGER, actid INTEGER ) CREATE TABLE Faculty ( FacID INTEGER, Lname VARCHAR(15), Fname VARCHAR(15), Rank VARCHAR(15), Sex VARCHAR(1), Phone INTEGER, Room VARCHAR...
How many faculty members do we have for each faculty rank Show bar chart, display in asc by the bars.
SELECT Rank, COUNT(*) FROM Faculty GROUP BY Rank ORDER BY Rank
nvbench
CREATE TABLE table_name_50 ( position INTEGER, drawn VARCHAR, against VARCHAR, team VARCHAR )
Which Position has an Against larger than 17, and a Team of juventus, and a Drawn smaller than 4?
SELECT MIN(position) FROM table_name_50 WHERE against > 17 AND team = "juventus" AND drawn < 4
sql_create_context
CREATE TABLE mzjybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH number, 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, ...
列出在05年2月7日到2015年9月7日内03628207患者被开出的所有检验报告单的检验报告单号是多少?
SELECT zyjybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN zyjybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '03628207' AND zyjybgb.BGRQ BETWEEN '2005-02-07' AND '2015-09...
css
CREATE TABLE table_38309 ( "Nation" text, "Height" text, "Athlete" text, "Venue" text, "Date" text )
What was the date that Elvir Krehmic made a high jump record?
SELECT "Date" FROM table_38309 WHERE "Athlete" = 'elvir krehmic'
wikisql
CREATE TABLE table_27654988_1 ( scorers VARCHAR, result VARCHAR )
Who were the scorers in the game with final score 0 4 7 1 0 3?
SELECT scorers FROM table_27654988_1 WHERE result = "0–4 7–1 0–3"
sql_create_context
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
病人奚子平的检验结果指标中哪些单号的检验报告单全部正常?
SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb 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_MZJZJLB WHERE person_info.XM = '奚...
css
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 jybgb ( BBCJBW text, BBDM tex...
那个做上臂的各项指标检验的患者81668961结果怎么样?
SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN 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 = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.RYBH = '...
css
CREATE TABLE table_38053 ( "Week" text, "Date" text, "Kickoff" text, "Opponent" text, "Result" text, "Record" text, "Game Site" text, "NFL Recap" text )
Which NFL Recap had a Kickoff of 7:00pm edt?
SELECT "NFL Recap" FROM table_38053 WHERE "Kickoff" = '7:00pm edt'
wikisql
CREATE TABLE table_name_86 ( round INTEGER, college VARCHAR )
What is the earliest round Clark was in?
SELECT MIN(round) FROM table_name_86 WHERE college = "clark"
sql_create_context
CREATE TABLE table_name_28 ( source VARCHAR, date VARCHAR )
Which source has a date of June 2008?
SELECT source FROM table_name_28 WHERE date = "june 2008"
sql_create_context
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PostsWit...
List Questions and Accepted Answer.
SELECT q.Id, q.Title, q.Tags, q.ViewCount, q.Body AS "question", a.Body AS "accepted_answer", a.Score, q.AcceptedAnswerId FROM Posts AS q JOIN Posts AS a ON q.AcceptedAnswerId = a.Id WHERE q.ViewCount > 100 AND q.PostTypeId = 1 AND q.AcceptedAnswerId > 0 AND a.PostTypeId = 2 ORDER BY a.Score DESC, q.ViewCount DESC
sede
CREATE TABLE table_name_73 ( percentage___percentage_ VARCHAR, language VARCHAR )
What is the percentage who speak Russian?
SELECT percentage___percentage_ FROM table_name_73 WHERE language = "russian"
sql_create_context
CREATE TABLE table_9359 ( "Name" text, "Pinnacle height planned" text, "Year completion expected" real, "Structure type" text, "Country" text, "Town" text )
What is the name of the buildings for China?
SELECT "Name" FROM table_9359 WHERE "Country" = 'china'
wikisql
CREATE TABLE table_name_84 ( date VARCHAR, tournament VARCHAR )
When was the Lagos tournament?
SELECT date FROM table_name_84 WHERE tournament = "lagos"
sql_create_context
CREATE TABLE mzb ( 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...
编码为1407398的医院非科室675在07年8月14日到11年7月31日期间负责的所有医疗就诊记录有哪些个呢?
SELECT * FROM qtb WHERE qtb.MED_SER_ORG_NO = '1407398' AND qtb.IN_HOSP_DATE BETWEEN '2007-08-14' AND '2011-07-31' UNION SELECT * FROM gyb WHERE gyb.MED_SER_ORG_NO = '1407398' AND gyb.IN_HOSP_DATE BETWEEN '2007-08-14' AND '2011-07-31' UNION SELECT * FROM zyb WHERE zyb.MED_SER_ORG_NO = '1407398' AND zyb.IN_HOSP_DATE BETW...
css
CREATE TABLE representative ( Representative_ID int, Name text, State text, Party text, Lifespan text ) CREATE TABLE election ( Election_ID int, Representative_ID int, Date text, Votes real, Vote_Percent real, Seats real, Place real )
Give me a pie to show vote_percent from different date.
SELECT Date, Vote_Percent FROM election
nvbench
CREATE TABLE table_26173063_2 ( ramtha VARCHAR, jeel VARCHAR, hussein VARCHAR )
What is ramtha when jeel is 1-0 and hussein is 1-0?
SELECT ramtha FROM table_26173063_2 WHERE jeel = "1-0" AND hussein = "1-0"
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, ...
what were the three most frequent diagnoses that patients were diagnosed with within 2 months after the diagnosis of adv eff sedat/hypnot nos?
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions...
mimic_iii
CREATE TABLE table_name_41 ( goals_against INTEGER, goals_for VARCHAR, losses VARCHAR )
How many goals against total did the team with more than 52 goals and fewer than 10 losses have?
SELECT SUM(goals_against) FROM table_name_41 WHERE goals_for > 52 AND losses < 10
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...
what is the number of hispanic/latino-puerto rican patients who have been diagnosed with orthostatic hypotension?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND diagnoses.long_title = "Orthostatic hypotension"
mimicsql_data
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) ...
Comments contain word by date.
SELECT Id AS "comment_link", Score, CreationDate AS Date FROM Comments WHERE Text LIKE '%##Word##%' COLLATE SQL_Latin1_General_CP1_CI_AS AND CreationDate > '##StartDate:string##' ORDER BY CreationDate DESC
sede
CREATE TABLE table_17895 ( "No" real, "Player" text, "Height" text, "Position" text, "Year born" real, "Current Club" text )
what's the height with current club being dkv joventut
SELECT "Height" FROM table_17895 WHERE "Current Club" = 'DKV Joventut'
wikisql
CREATE TABLE table_name_53 ( league VARCHAR, goals VARCHAR )
What is the league listed that has goals of 10?
SELECT league FROM table_name_53 WHERE goals = "10"
sql_create_context
CREATE TABLE table_14140 ( "Pick" real, "Team" text, "Player" text, "Position" text, "College" text )
who is the player from arizona state?
SELECT "Player" FROM table_14140 WHERE "College" = 'arizona state'
wikisql
CREATE TABLE table_19251 ( "Year" real, "Boys singles" text, "Girls singles" text, "Boys doubles" text, "Girls doubles" text, "Mixed doubles" text )
When girls doubles is anneke feinya agustin wenny setiawati what is the mixed doubles?
SELECT "Mixed doubles" FROM table_19251 WHERE "Girls doubles" = 'Anneke Feinya Agustin Wenny Setiawati'
wikisql
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...
患者尤永年被门诊诊断为疾病I64.781,他的检测指标661673的结果定量及单位是怎么样的
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZ...
css
CREATE TABLE table_2226817_8 ( production_code VARCHAR, written_by VARCHAR )
What are all the production codes of episodes written by Michael G. Moye?
SELECT production_code FROM table_2226817_8 WHERE written_by = "Michael G. Moye"
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 patients discharged to inpatient hospital had an incision of vessel abdominal arteries procedure?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "DISC-TRAN CANCER/CHLDRN H" AND procedures.long_title = "Incision of vessel, abdominal arteries"
mimicsql_data
CREATE TABLE table_18626383_2 ( height__cm_ VARCHAR, country VARCHAR )
When bahamas is the country what is the height in centimeters?
SELECT height__cm_ FROM table_18626383_2 WHERE country = "Bahamas"
sql_create_context
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, ...
Posts which contains the [b+-tree] tag..
SELECT * FROM Tags WHERE TagName LIKE '%+^+%' AND NOT TagName LIKE '%++%'
sede
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code tex...
what was the name of the procedure that in 09/last year patient 86404 has received two or more times?
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 = 864...
mimic_iii
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayNa...
Question/post ratio by post sequence.
WITH sample_posts AS (SELECT RANK() OVER (PARTITION BY OwnerUserId ORDER BY CreationDate) AS sequence, PostTypeId FROM Posts WHERE PostTypeId IN (1, 2)) SELECT sequence, SUM(CASE WHEN PostTypeId = 1 THEN 1.0 END) / COUNT(*) AS q_ratio FROM sample_posts WHERE sequence <= 100 GROUP BY sequence ORDER BY sequence
sede
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id nu...
Users in or near Austin, Texas, by Reputation.
SELECT Id, DisplayName, Reputation, WebsiteUrl FROM Users WHERE Location LIKE '%Austin%' OR Location LIKE '%Texas%' ORDER BY Reputation DESC
sede
CREATE TABLE table_31305 ( "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 is the least w?
SELECT MIN("W") FROM table_31305
wikisql
CREATE TABLE table_69695 ( "Year" real, "Winners" text, "2nd place" text, "3rd place" text, "4th place" text )
Name the 3rd place for 4th place of boston barracudas and 2nd place of oxford cheetahs
SELECT "3rd place" FROM table_69695 WHERE "4th place" = 'boston barracudas' AND "2nd place" = 'oxford cheetahs'
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 admission type is emergency and procedure long title is laryngoscopy and other tracheoscopy?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.long_title = "Laryngoscopy and other tracheoscopy"
mimicsql_data
CREATE TABLE table_name_99 ( Id VARCHAR )
What 1978 has a 1976 of 62%?
SELECT 1978 FROM table_name_99 WHERE 1976 = "62%"
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, ...
门诊诊断为疾病W44.704的病患的游离前列腺特异性抗原数值的平均值是多少最值是多少?
SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE zzmzjzjlb.JZZDBM = 'W44.704' AND jyjgzbb.JCZBMC = '...
css
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...
2007年10月4日到2010年2月18日,查一下563科室的门诊就诊数量的详细情况
SELECT COUNT(*) FROM mzjzjlb WHERE mzjzjlb.JZKSBM = '563' AND mzjzjlb.JZKSRQ BETWEEN '2007-10-04' AND '2010-02-18'
css
CREATE TABLE table_63699 ( "Draw" real, "Language" text, "Artist" text, "Song" text, "English translation" text, "Place" real, "Points" real )
What is the highest draw number when 23 points are scored?
SELECT MAX("Draw") FROM table_63699 WHERE "Points" = '23'
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
find out the number of patients on methyprednisolone sodium succ drug prescription who are younger than 45 years.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "45" AND prescriptions.drug = "MethylPREDNISolone Sodium Succ"
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_CLINIC_ID text, MED_DIRE_CD tex...
在2000年12月3日到2020年11月15日这段时间,患者03719303一共检查了几次?
SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '03719303' AND t_kc22.STA_DATE BETWEEN '2000-12-03' AND '2020-11-15' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE table_name_94 ( home VARCHAR, visitor VARCHAR )
What was the home who had California visiting?
SELECT home FROM table_name_94 WHERE visitor = "california"
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescription...
let me know the gender and lab test abnormal status of patient with patient id 2560.
SELECT demographic.gender, lab.flag FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.subject_id = "2560"
mimicsql_data