context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_1685 ( "Episode" text, "First broadcast" text, "Graemes guest" text, "Jeremys guest" text, "Votes (%)" text )
what is the name of the jeremy guest for the episode 1x01
SELECT "Jeremys guest" FROM table_1685 WHERE "Episode" = '1x01'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodici...
what is the name of the diagnosis patient 028-70851 last was received until 4 years ago?
SELECT diagnosis.diagnosisname FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-70851')) AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CU...
eicu
CREATE TABLE table_203_564 ( id number, "hand" text, "1 credit" number, "2 credits" number, "3 credits" number, "4 credits" number, "5 credits" number )
each four aces win is a multiple of what number ?
SELECT "1 credit" FROM table_203_564 WHERE "hand" = 'four aces'
squall
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 Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Has_amenity ( dormid...
Find the average age of male students (with sex M) from each city, and rank Y from low to high order.
SELECT city_code, AVG(Age) FROM Student WHERE Sex = 'M' GROUP BY city_code ORDER BY AVG(Age)
nvbench
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
My answers to questions with no accepted answer.
SELECT a.Score, a.Id AS "post_link", q.AnswerCount AS Answers, q.OwnerUserId AS "user_link", a.CreationDate AS "answered_on", a.PostTypeId FROM Posts AS a INNER JOIN Posts AS q ON q.Id = a.ParentId WHERE q.AcceptedAnswerId IS NULL AND a.OwnerUserId = '##MyID##' ORDER BY a.CreationDate DESC
sede
CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, basePrice INTEGER, decor TEXT ) CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adul...
How many rooms cost more than 120, for each different decor Plot them as bar chart, and list by the Y from low to high.
SELECT decor, COUNT(*) FROM Rooms WHERE basePrice > 120 GROUP BY decor ORDER BY COUNT(*)
nvbench
CREATE TABLE table_40980 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
What is the result of the game on October 17, 1965?
SELECT "Result" FROM table_40980 WHERE "Date" = 'october 17, 1965'
wikisql
CREATE TABLE table_11803648_17 ( position VARCHAR, player VARCHAR )
WHAT POSITION DOES PATRICK WIERCIOCH PLAY?
SELECT position FROM table_11803648_17 WHERE player = "Patrick Wiercioch"
sql_create_context
CREATE TABLE table_name_1 ( value VARCHAR, first_issued VARCHAR, reverse VARCHAR )
How much was a Reverse of guitar of agust n p o barrios before 1998?
SELECT value FROM table_name_1 WHERE first_issued < 1998 AND reverse = "guitar of agustín pío barrios"
sql_create_context
CREATE TABLE table_76584 ( "2006/ 07" text, "2008/ 09" text, "2010/ 11" text, "2011/ 12" text, "2012/ 13" text )
What is 2006/07, when 2008/09 is LQ, and when 2010/11 is Not Held?
SELECT "2006/ 07" FROM table_76584 WHERE "2008/ 09" = 'lq' AND "2010/ 11" = 'not held'
wikisql
CREATE TABLE table_20861261_4 ( position VARCHAR, player VARCHAR )
What's Curtis Painter's position?
SELECT position FROM table_20861261_4 WHERE player = "Curtis Painter"
sql_create_context
CREATE TABLE table_29933 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Name the number of date for stephen curry , dorell wright (27)
SELECT COUNT("Date") FROM table_29933 WHERE "High points" = 'Stephen Curry , Dorell Wright (27)'
wikisql
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 procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime t...
tell me the top four most common diagnoses of patients with an age of 60 or above during the last year?
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age >= 60) ...
mimic_iii
CREATE TABLE table_name_8 ( position VARCHAR, pick VARCHAR, team VARCHAR )
what is the position when the pick is higher than 32 and the team is atlanta braves?
SELECT position FROM table_name_8 WHERE pick > 32 AND team = "atlanta braves"
sql_create_context
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
医院7149327就诊的所有的记录里依科室不同的编码和入院诊断的不同编码算一算大病支付的支出和总的医疗花费相比,比值的最小值
SELECT t_kc24.t_kc21_MED_ORG_DEPT_CD, t_kc24.t_kc21_IN_DIAG_DIS_CD, MIN(t_kc24.ILL_PAY) FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '7149327' GROUP BY t_kc24.t_kc21_MED_ORG_DEPT_CD, t_kc24.t_kc21_IN_DIAG_DIS_CD
css
CREATE TABLE table_name_16 ( muzzle_energy VARCHAR, source VARCHAR )
What is Muzzle energy, when Source is hornady?
SELECT muzzle_energy FROM table_name_16 WHERE source = "hornady"
sql_create_context
CREATE TABLE table_1376890_2 ( chroma_format VARCHAR, scalable_modes VARCHAR, intra_dc_precision VARCHAR )
what's the chroma format with scalable modes being snr- or spatial-scalable and intra dc precbeingion being 8, 9, 10
SELECT chroma_format FROM table_1376890_2 WHERE scalable_modes = "SNR- or spatial-scalable" AND intra_dc_precision = "8, 9, 10"
sql_create_context
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
把团伙成员56692747最常去医治的几位医生查看一下
SELECT gwyjzb.OUT_DIAG_DOC_CD, gwyjzb.OUT_DIAG_DOC_NM FROM gwyjzb WHERE gwyjzb.PERSON_ID = '56692747' GROUP BY gwyjzb.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC UNION SELECT fgwyjzb.OUT_DIAG_DOC_CD, fgwyjzb.OUT_DIAG_DOC_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '56692747' GROUP BY fgwyjzb.OUT_DIAG_DOC_CD ORDER BY COUNT(*) ...
css
CREATE TABLE table_59460 ( "Club" text, "Coach" text, "City" text, "Stadium" text, "2007-2008 season" text )
Who coached for al farwaniyah?
SELECT "Coach" FROM table_59460 WHERE "City" = 'al farwaniyah'
wikisql
CREATE TABLE table_28946 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
How many times were the candidates leven powell (f) 63.8% roger west (dr) 36.4%?
SELECT COUNT("First elected") FROM table_28946 WHERE "Candidates" = 'Leven Powell (F) 63.8% Roger West (DR) 36.4%'
wikisql
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, ...
那个孙清涵的病人在2017年11月21日到2019年11月23日内所有检验结果指标记录中的仪器编号以及名称能不能给我详细列举出来?
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybg...
css
CREATE TABLE participates_in ( stuid number, actid number ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE faculty_participates_in ( facid number, actid number ) CREATE TABL...
Find the name of the activity that has the largest number of student participants.
SELECT T1.activity_name FROM activity AS T1 JOIN participates_in AS T2 ON T1.actid = T2.actid GROUP BY T1.actid ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_203_67 ( id number, "place" number, "team" text, "played" number, "won" number, "draw" number, "lost" number, "goals\nscored" number, "goals\nconceded" number, "+/-" number, "points" number )
how many games were played ?
SELECT SUM("played") FROM table_203_67
squall
CREATE TABLE table_66254 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
How many silver medals did Estonia, which won more than 1 gold and less than 97 medals total, win?
SELECT "Silver" FROM table_66254 WHERE "Gold" > '1' AND "Total" < '97' AND "Nation" = 'estonia'
wikisql
CREATE TABLE table_41298 ( "Outcome" text, "Date" text, "Surface" text, "Opponent" text, "Score" text )
What is the score where the opponent was Mardy Fish?
SELECT "Score" FROM table_41298 WHERE "Opponent" = 'mardy fish'
wikisql
CREATE TABLE table_20804 ( "Institution" text, "Location" text, "Nickname" text, "Enrollment" real, "Established" real )
Location of the school with the nickname Mountaineers
SELECT "Location" FROM table_20804 WHERE "Nickname" = 'Mountaineers'
wikisql
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, ...
Find tag wikis with an image inside them..
SELECT * FROM Posts WHERE Posts.PostTypeId = 5 AND 'Tag Name' LIKE '%sql%'
sede
CREATE TABLE table_80391 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
What was the loss of the Brewers game when the record was 46-48?
SELECT "Loss" FROM table_80391 WHERE "Record" = '46-48'
wikisql
CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number, ZZBZ number, WDBZ number, JZKSBM text, JZKSMC text, JZKSRQ time, ...
从2005年12月14日至2010年2月5日这期间里,编码为98519847的患者曾在医院就诊多少次?
SELECT (SELECT COUNT(*) FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '98519847' AND mzjzjlb.JZKSRQ BETWEEN '2005-12-14' AND '2010-02-05') + (SELECT COUNT(*) FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_...
css
CREATE TABLE table_name_83 ( country VARCHAR, date VARCHAR, birth_date VARCHAR )
What country was the woman from who was born 1976-07-23 and became a grandmaster in 1991?
SELECT country FROM table_name_83 WHERE date = 1991 AND birth_date = "1976-07-23"
sql_create_context
CREATE TABLE table_39505 ( "Game" real, "February" real, "Opponent" text, "Score" text, "Record" text, "Points" real )
Which Game is the average one that has a February larger than 20, and a Record of 41 17 4, and Points smaller than 86?
SELECT AVG("Game") FROM table_39505 WHERE "February" > '20' AND "Record" = '41–17–4' AND "Points" < '86'
wikisql
CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE T...
how many FIRST class flights does UA have leaving from all cities today
SELECT COUNT(DISTINCT flight.flight_id) FROM airport_service, city, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis AS FARE_BASIS_0, fare_basis AS FARE_BASIS_1, flight, flight_fare WHERE ((DATE_DAY_0.day_number = 29 AND DATE_DAY_0.month_number = 4 AND DATE_DAY_0.year = 1...
atis
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
2 ml : furosemide 10 mg/ml ij soln what is the price?
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'medication' AND cost.eventid IN (SELECT medication.medicationid FROM medication WHERE medication.drugname = '2 ml : furosemide 10 mg/ml ij soln')
eicu
CREATE TABLE table_65415 ( "Region" text, "Date" text, "Format" text, "Label" text, "Edition" text )
What format was released April 16, 2009?
SELECT "Format" FROM table_65415 WHERE "Date" = 'april 16, 2009'
wikisql
CREATE TABLE table_50541 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What is High Rebounds, when Date is 'March 13'?
SELECT "High rebounds" FROM table_50541 WHERE "Date" = 'march 13'
wikisql
CREATE TABLE table_78603 ( "Date" text, "Venue" text, "Winner" text, "Runner-up" text, "Score" text )
Who was the winner in the match that had John Higgins as runner-up?
SELECT "Winner" FROM table_78603 WHERE "Runner-up" = 'john higgins'
wikisql
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
患者36091672号从02年2月9日到05年3月12日这段时间去过多少次医院就诊?
SELECT (SELECT COUNT(*) FROM hz_info JOIN mzjzjlb JOIN person_info_hz_info JOIN person_info ON 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 person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM AND p...
css
CREATE TABLE stadium ( id int, name text, Home_Games int, Average_Attendance real, Total_Attendance real, Capacity_Percentage real ) CREATE TABLE game ( stadium_id int, id int, Season int, Date text, Home_team text, Away_team text, Score text, Competition text ) ...
Stacked bar chart of how many away team for with each Home_team in each away team
SELECT Away_team, COUNT(Away_team) FROM game GROUP BY Home_team, Away_team
nvbench
CREATE TABLE table_51716 ( "Player" text, "Height" text, "School" text, "Hometown" text, "College" text, "NBA Draft" text )
For the Player playing for the College of Kentucky and a Height of 6-7 what was their corresponding School?
SELECT "School" FROM table_51716 WHERE "College" = 'kentucky' AND "Height" = '6-7'
wikisql
CREATE TABLE table_68891 ( "Team 1" text, "Agg." text, "Team 2" text, "1st leg" text, "2nd leg" text )
What is the second leg that Valencia was on?
SELECT "2nd leg" FROM table_68891 WHERE "Team 2" = 'valencia'
wikisql
CREATE TABLE table_name_21 ( opponent VARCHAR, week VARCHAR )
What is the Opponent of the game in Week 3?
SELECT opponent FROM table_name_21 WHERE week = 3
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 ) ...
give me the number of patients whose admission type is emergency and procedure short title is vaccination nec?
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.short_title = "Vaccination NEC"
mimicsql_data
CREATE TABLE table_name_24 ( game INTEGER, date VARCHAR )
What is the average Game with a Date that is june 14?
SELECT AVG(game) FROM table_name_24 WHERE date = "june 14"
sql_create_context
CREATE TABLE table_30972 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (millions)" text )
How many episodes are 122 in the series?
SELECT COUNT("No. in season") FROM table_30972 WHERE "No. in series" = '122'
wikisql
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
病患91823210在2008年5月3日以前做过的检验报告在哪些住院门诊?列出住院就诊流水编码
SELECT zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM AND pers...
css
CREATE TABLE table_53186 ( "Round" real, "Pick #" real, "Player" text, "Position" text, "College" text )
What is the Position of Pick #77?
SELECT "Position" FROM table_53186 WHERE "Pick #" = '77'
wikisql
CREATE TABLE table_39703 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
How many total medals for germany with under 56 bronzes?
SELECT SUM("Total") FROM table_39703 WHERE "Nation" = 'germany' AND "Bronze" < '56'
wikisql
CREATE TABLE table_1300525_1 ( density VARCHAR, english_name VARCHAR )
What is the density of yushan county?
SELECT COUNT(density) FROM table_1300525_1 WHERE english_name = "Yushan County"
sql_create_context
CREATE TABLE table_66601 ( "Frequency" text, "Call sign" text, "Branding" text, "Format" text, "Owner" text )
What frequency is First Nations Community?
SELECT "Frequency" FROM table_66601 WHERE "Format" = 'first nations community'
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, ...
查询入院诊断为J45.129的最低和最高医疗费总额,主要针对医院7271121的医疗记录
SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '7271121' AND t_kc21.IN_DIAG_DIS_CD = 'J45.129')
css
CREATE TABLE table_28885977_1 ( location VARCHAR, built_for VARCHAR )
In what location was a stadium built for the St Kilda Football Club?
SELECT location FROM table_28885977_1 WHERE built_for = "St Kilda Football Club"
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, ...
tell me the age and health insurance of patient with patient id 17595.
SELECT demographic.age, demographic.insurance FROM demographic WHERE demographic.subject_id = "17595"
mimicsql_data
CREATE TABLE table_63709 ( "Rank" real, "Lane" real, "Name" text, "Nationality" text, "Time" text )
What is the nationality with a lane larger than 1, and a rank larger than 5, for Hsu Chi-Chieh?
SELECT "Nationality" FROM table_63709 WHERE "Lane" > '1' AND "Rank" > '5' AND "Name" = 'hsu chi-chieh'
wikisql
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
根据不同的入院诊断疾病名称和科室名称,一一列出医疗就诊记录中医院5583587所有患者保留平均年龄小于五岁的记录的平均年龄都是什么年龄?
SELECT qtb.MED_ORG_DEPT_NM, qtb.IN_DIAG_DIS_NM, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '5583587' GROUP BY qtb.MED_ORG_DEPT_NM, qtb.IN_DIAG_DIS_NM HAVING AVG(qtb.PERSON_AGE) < 5 UNION SELECT gyb.MED_ORG_DEPT_NM, gyb.IN_DIAG_DIS_NM, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '5583587' GROUP ...
css
CREATE TABLE table_60569 ( "Measure" text, "Bombali" real, "Bonthe" real, "Kailahun" real, "Kambia" text, "Kenema" real, "Koinadugu" real, "Kono" real, "Moyamba" text, "Port Loko" text, "Pujehun" real, "Tonkolili" real )
What is the average pjehun measured by female enrollment?
SELECT AVG("Pujehun") FROM table_60569 WHERE "Measure" = 'female enrollment'
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...
provide the number of patients whose procedure short title is percutan liver aspirat?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.short_title = "Percutan liver aspirat"
mimicsql_data
CREATE TABLE table_name_13 ( founded INTEGER, suburb_town VARCHAR )
On average, when were vineyard schools founded?
SELECT AVG(founded) FROM table_name_13 WHERE suburb_town = "vineyard"
sql_create_context
CREATE TABLE table_name_95 ( lead VARCHAR, institute VARCHAR, social_democratic VARCHAR )
Name the lead for institute of election results and social democratic of 31.7% 8 seats
SELECT lead FROM table_name_95 WHERE institute = "election results" AND social_democratic = "31.7% 8 seats"
sql_create_context
CREATE TABLE table_57739 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text, "Arena" text, "Points" real )
How many points when under 17,197 attended against the wild?
SELECT AVG("Points") FROM table_57739 WHERE "Attendance" < '17,197' AND "Opponent" = 'wild'
wikisql
CREATE TABLE table_name_67 ( opponent VARCHAR, against VARCHAR )
who is the opponent when norway is against?
SELECT opponent FROM table_name_67 WHERE against = "norway"
sql_create_context
CREATE TABLE table_48684 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
What is the Outcome of the game with a Score of 6 4, 6 4?
SELECT "Outcome" FROM table_48684 WHERE "Score" = '6–4, 6–4'
wikisql
CREATE TABLE table_25711913_8 ( points INTEGER, position VARCHAR )
What is the most points recorded for a right halfback?
SELECT MAX(points) FROM table_25711913_8 WHERE position = "Right halfback"
sql_create_context
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ...
TOP 1000 users from Bhubaneswar & Cuttack, India. Lists the top 1000 users (ranked by reputation) that are located in Bangalore, Karnataka, India according to their profile information. Thanks to http://data.stackexchange.com/stackoverflow/query/60933/top-50-users-from-india Edited by GNKeshava
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id, DisplayName, Reputation, WebsiteUrl, Location FROM Users WHERE LOWER(Location) LIKE '%Bhubaneswar%' OR UPPER(Location) LIKE '%Bhubaneswar%' OR Location LIKE '%Bhubaneswar%' OR LOWER(Location) LIKE '%Bhubaneshwar%' OR UPPER(Location) LIKE '%Bhubaneshwar%' O...
sede
CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters ...
Whose course were students minoring in STRATEGY in when they got B- 's ?
SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN student_record ON student_record.offering_id = offering_instructor.offering_id INNER JOIN student ON student.student_id = student_record.student_id WHERE (student_rec...
advising
CREATE TABLE table_40121 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text )
What is the highest number of Played games with a Position smaller than 2 and Drawn games less than 4?
SELECT MAX("Played") FROM table_40121 WHERE "Position" < '2' AND "Drawn" < '4'
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 microlab ( microl...
what is the average total cost of a hospital which involves the cortisol since 2104?
SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'cortisol')) AND STRFTIME('%y', cost.chargetime) >= '2104' GROUP BY c...
eicu
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
give the primary disease and procedure icd9 code for subject id 18077.
SELECT demographic.diagnosis, procedures.icd9_code FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "18077"
mimicsql_data
CREATE TABLE table_8684 ( "Player" text, "Nationality" text, "Position" text, "Years for Grizzlies" text, "School/Club Team" text )
Which player played for the Grizzlies from 1997-1998?
SELECT "Player" FROM table_8684 WHERE "Years for Grizzlies" = '1997-1998'
wikisql
CREATE TABLE table_12526990_1 ( mundubbera INTEGER, biggenden VARCHAR )
What is the minimum mundubbera when biggenden is 1882
SELECT MIN(mundubbera) FROM table_12526990_1 WHERE biggenden = 1882
sql_create_context
CREATE TABLE table_name_88 ( ground VARCHAR, home_team VARCHAR )
What is the ground of the game where the home team was Adelaide?
SELECT ground FROM table_name_88 WHERE home_team = "adelaide"
sql_create_context
CREATE TABLE table_12573 ( "Central Murray" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real )
What is the total number of wins of the central murray of koondrook-barham, which has more than 0 draws?
SELECT COUNT("Wins") FROM table_12573 WHERE "Central Murray" = 'koondrook-barham' AND "Draws" > '0'
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
what is diagnoses long title of subject id 3343?
SELECT diagnoses.long_title FROM diagnoses WHERE diagnoses.subject_id = "3343"
mimicsql_data
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE cost ( costid number, uniquepi...
until 1 year ago, what are the three most frequently prescribed drugs?
SELECT t1.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication WHERE DATETIME(medication.drugstarttime) <= DATETIME(CURRENT_TIME(), '-1 year') GROUP BY medication.drugname) AS t1 WHERE t1.c1 <= 3
eicu
CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
84485404154这次住院就诊的住院中医诊断如何?编码又是什么
SELECT ZYZYZDZZBM, ZYZYZDZZMC FROM zyjzjlb WHERE JZLSH = '84485404154'
css
CREATE TABLE table_21568 ( "1391 Carelia" text, "1398 Donnera" text, "1405 Sibelius" text, "1406 Komppa" text, "1407 Lindel\u00f6f" text )
what is the 1406 komppa of asteroid which 1405 sibelius is 2737 kotka
SELECT "1406 Komppa" FROM table_21568 WHERE "1405 Sibelius" = '2737 Kotka'
wikisql
CREATE TABLE table_39836 ( "Rank" text, "s Wicket" text, "Player" text, "Matches" text, "Average" text )
What rank has andy bichel (qld) as the player?
SELECT "Rank" FROM table_39836 WHERE "Player" = 'andy bichel (qld)'
wikisql
CREATE TABLE table_name_23 ( result VARCHAR, nominee VARCHAR )
What was the result of Declan Donnellan's nomination?
SELECT result FROM table_name_23 WHERE nominee = "declan donnellan"
sql_create_context
CREATE TABLE table_name_2 ( award_ceremony VARCHAR, role VARCHAR, year VARCHAR )
Which Award Ceremony in 2009 has a Role of Glinda?
SELECT award_ceremony FROM table_name_2 WHERE role = "glinda" AND year = 2009
sql_create_context
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
盐酸氟西汀片在这个医疗就诊46298054925中的收费项目等级分为几个?
SELECT CHA_ITEM_LEV FROM t_kc22 WHERE MED_CLINIC_ID = '46298054925' AND SOC_SRT_DIRE_NM = '盐酸氟西汀片'
css
CREATE TABLE table_35136 ( "Hand" text, "1 credit" text, "2 credits" text, "3 credits" text, "4 credits" text, "5 credits" text )
What's the listed Hand has 3 credits of 6?
SELECT "Hand" FROM table_35136 WHERE "3 credits" = '6'
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 ...
病号21701297在2000年5月29日到2009年5月18日内期间所有检验结果指标记录中使用的仪器编号还有名称都叫什么
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb 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 AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = ...
css
CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate real ) CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight re...
Visualize a bar chart about the distribution of Name and Weight , and I want to sort in descending by the Y.
SELECT Name, Weight FROM people ORDER BY Weight DESC
nvbench
CREATE TABLE table_68691 ( "Episode #" real, "Title" text, "Part 1" text, "Part 2" text, "Part 3" text, "Part 4" text, "Part 5" text, "Part 6" text )
When is Part 6, when Part 4 is on March 2, 2008?
SELECT "Part 6" FROM table_68691 WHERE "Part 4" = 'march 2, 2008'
wikisql
CREATE TABLE table_60932 ( "Outcome" text, "Date" real, "Tournament" text, "Surface" text, "Partner" text, "Opponents in the final" text, "Score in the final" text )
How many days had a score of 4 6, 4 6?
SELECT COUNT("Date") FROM table_60932 WHERE "Score in the final" = '4–6, 4–6'
wikisql
CREATE TABLE table_17942 ( "Year" real, "Starts" real, "Wins (Majors)" text, "2nd" real, "3rd" real, "Earnings ($)" real, "Money list rank" text, "Scoring average" text )
What is the money list rank for 1966?
SELECT "Money list rank" FROM table_17942 WHERE "Year" = '1966'
wikisql
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name var...
what aircraft has the largest seating capacity
SELECT DISTINCT aircraft_code FROM aircraft WHERE capacity = (SELECT MAX(AIRCRAFTalias1.capacity) FROM aircraft AS AIRCRAFTalias1)
atis
CREATE TABLE song ( song_name text, artist_name text, country text, f_id number, genre_is text, rating number, languages text, releasedate time, resolution number ) CREATE TABLE files ( f_id number, artist_name text, file_size text, duration text, formats text ) ...
What are the names of the artists who released a song that has the word love in its title, and where are the artists from?
SELECT T1.artist_name, T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.song_name LIKE "%love%"
spider
CREATE TABLE table_name_9 ( cup_goals INTEGER, league_apps INTEGER )
How many cup goals for the season with more than 34 league apps?
SELECT AVG(cup_goals) FROM table_name_9 WHERE league_apps > 34
sql_create_context
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 procedures ( ...
for icd9 code 29690, specify the diagnosis short title.
SELECT diagnoses.short_title FROM diagnoses WHERE diagnoses.icd9_code = "29690"
mimicsql_data
CREATE TABLE table_27700375_10 ( high_points VARCHAR, date VARCHAR )
who had high points on march 14?
SELECT high_points FROM table_27700375_10 WHERE date = "March 14"
sql_create_context
CREATE TABLE table_204_358 ( id number, "species" text, "common name" text, "ncbi accession #" text, "ncbi name" text, "length" text, "sequence identity" text, "sequence similarity" text, "years since divergence from human (mya)" number )
name the species that has the longest years since divergence from human .
SELECT "species" FROM table_204_358 ORDER BY "years since divergence from human (mya)" DESC LIMIT 1
squall
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...
自2015.6.29日起,至2017.12.17日止,把患者93103311这段时间被开出的所有检验报告单中的标本采集部位给一一列出来
SELECT jybgb.BBCJBW FROM hz_info JOIN wdmzjzjlb JOIN jybgb ON 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.JZLSH_MZJZJLB WHERE hz_info.RYBH = '93103311' AND jybgb.BGRQ BETWEEN '2015-06-29' AND '201...
css
CREATE TABLE table_60874 ( "Opposing Teams" text, "Against" real, "Date" text, "Venue" text, "Status" text )
Can you tell me the average Against thaylt has the Date of 23/03/2002?
SELECT AVG("Against") FROM table_60874 WHERE "Date" = '23/03/2002'
wikisql
CREATE TABLE table_name_78 ( game INTEGER, team VARCHAR )
What is the average Game, when Team is 'Milwaukee'?
SELECT AVG(game) FROM table_name_78 WHERE team = "milwaukee"
sql_create_context
CREATE TABLE table_2665085_1 ( park VARCHAR, name VARCHAR )
How many parks is Zippin Pippin located in
SELECT COUNT(park) FROM table_2665085_1 WHERE name = "Zippin Pippin"
sql_create_context
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ...
Keywords for Qt posts Jan-March 2015.
SELECT TIME_TO_STR(p.CreationDate, '%YEAR') AS Year, TIME_TO_STR(p.CreationDate, '%-mONT%-H') AS Month, COUNT(*) AS Questions, SUM(p.AnswerCount) AS Answers, SUM(p.Score) AS QuestionUpvotes, SUM(p.ViewCount) AS "views", SUM(CASE WHEN p.Score > 1 THEN 1 ELSE 0 END) AS "upvotedquestions", SUM(CASE WHEN NOT p.AcceptedAnsw...
sede
CREATE TABLE table_name_92 ( attendance VARCHAR, record VARCHAR )
What was the attendance at the game with a record of 4-5?
SELECT attendance FROM table_name_92 WHERE record = "4-5"
sql_create_context
CREATE TABLE table_39723 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text )
What is Roy Hall's highest round?
SELECT MAX("Round") FROM table_39723 WHERE "Name" = 'roy hall'
wikisql
CREATE TABLE table_80168 ( "School" text, "Location" text, "Mascot" text, "County" text, "Joined" text, "Previous Conference" text, "Left" text, "Conference joined" text )
Which conference held at School of whiting?
SELECT "Previous Conference" FROM table_80168 WHERE "School" = 'whiting'
wikisql
CREATE TABLE table_204_392 ( id number, "#" number, "stadium" text, "capacity" number, "city" text, "country" text, "domed or retractable roof" text )
how many stadiums have a capacity of more than 70,000 ?
SELECT COUNT("stadium") FROM table_204_392 WHERE "capacity" > 70000
squall