context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
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 gender is m and year of birth is less than 2101?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.dob_year < "2101"
mimicsql_data
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE procedures_icd ( row_id number, subject_id...
what was the name of the drug that was prescribed to patient 6940 in the same hospital encounter after they had been diagnosed with acute kidney failure nos in 11/last year?
SELECT t2.drug FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 6940 AND diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.sh...
mimic_iii
CREATE TABLE table_27397 ( "Season" text, "Games" real, "Won" real, "Lost" real, "Tied" real, "Points" real, "Goals for" real, "Goals against" real, "Standing" text )
Name the total number of games for lost being 41
SELECT COUNT("Games") FROM table_27397 WHERE "Lost" = '41'
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...
How many patients admitted before the year 2144 had tonsil and adenoid biopsy?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2144" AND procedures.short_title = "Tonsil&adenoid biopsy"
mimicsql_data
CREATE TABLE table_50803 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Attendance" text )
What is the attendance for No. 15 tie?
SELECT "Attendance" FROM table_50803 WHERE "Tie no" = '15'
wikisql
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABL...
had viral warts nos been diagnosed with patient 87733 until 2 years ago?
SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'viral warts nos') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 87733) AND DATETIME(diagnoses_icd.cha...
mimic_iii
CREATE TABLE table_name_55 ( score VARCHAR, set_3 VARCHAR )
What was the overall score when the score for set 3 is 21 25?
SELECT score FROM table_name_55 WHERE set_3 = "21–25"
sql_create_context
CREATE TABLE table_1769428_2 ( season INTEGER, winning_driver VARCHAR )
In what season did Rusty Wallace win?
SELECT MAX(season) FROM table_1769428_2 WHERE winning_driver = "Rusty Wallace"
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, ...
被门诊诊断出疾病B99.606的这些病号的他们促甲状腺激素数值的平均值以及最值各是多少呢?
SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDBM = 'B99.606' AND jyjgzbb.JCZBMC =...
css
CREATE TABLE table_name_51 ( event VARCHAR, total VARCHAR )
Which event had a total of 28?
SELECT event FROM table_name_51 WHERE total = "28"
sql_create_context
CREATE TABLE table_204_546 ( id number, "year" number, "film" text, "song" text, "language" text )
how many songs did ishaan dev provide for movies made between 2007 and 2009 ?
SELECT COUNT("song") FROM table_204_546 WHERE "year" >= 2007 AND "year" <= 2009
squall
CREATE TABLE table_54067 ( "Round" real, "Pick" text, "Player" text, "Position" text, "School/Club Team" text )
What is the average round of the number 16 pick?
SELECT AVG("Round") FROM table_54067 WHERE "Pick" = '16'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TA...
when did patient 018-81471 first get discharged from the hospital?
SELECT patient.hospitaldischargetime FROM patient WHERE patient.uniquepid = '018-81471' ORDER BY patient.hospitaldischargetime LIMIT 1
eicu
CREATE TABLE table_11562149_1 ( no_in_series VARCHAR, featured_character_s_ VARCHAR )
What are the episode numbers of episodes featuring Hurley?
SELECT no_in_series FROM table_11562149_1 WHERE featured_character_s_ = "Hurley"
sql_create_context
CREATE TABLE field ( fieldid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid ...
What did Luke S Zettlemoyer published in 2009 ?
SELECT DISTINCT paper.paperid FROM author, paper, writes WHERE author.authorname = 'Luke S Zettlemoyer' AND paper.year = 2009 AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
scholar
CREATE TABLE Events ( Event_ID INTEGER, Service_ID INTEGER, Event_Details VARCHAR(255) ) CREATE TABLE Services ( Service_ID INTEGER, Service_Type_Code CHAR(15) ) CREATE TABLE Participants ( Participant_ID INTEGER, Participant_Type_Code CHAR(15), Participant_Details VARCHAR(255) ) CREA...
What are the ids and details of events that have more than one participants Visualize by bar chart, and I want to show by the y-axis from high to low.
SELECT T1.Event_Details, T1.Event_ID FROM Events AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID = T2.Event_ID GROUP BY T1.Event_Details ORDER BY T1.Event_ID DESC
nvbench
CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, ...
Show me about the distribution of meter_500 and ID in a bar chart, could you order y axis in descending order please?
SELECT meter_500, ID FROM swimmer ORDER BY ID DESC
nvbench
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, lan...
had patient 1114 ever had chest tube #1 output on this month/23?
SELECT COUNT(*) > 0 FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1114)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'chest tube #1' ...
mimic_iii
CREATE TABLE table_25800134_17 ( writer_s_ VARCHAR, airdate VARCHAR )
Who was the writer who wrote the episode that was aired on September 11, 1972?
SELECT writer_s_ FROM table_25800134_17 WHERE airdate = "September 11, 1972"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
what is the number of patients whose admission type is elective and procedure long title is fiber-optic bronchoscopy?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.long_title = "Fiber-optic bronchoscopy"
mimicsql_data
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, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescription...
how many patients whose diagnoses short title is constipation nos and drug route is ed?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Constipation NOS" AND prescriptions.route = "ED"
mimicsql_data
CREATE TABLE table_69930 ( "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
what tournament had sam querrey as the opponent?
SELECT "Tournament" FROM table_69930 WHERE "Opponent" = 'sam querrey'
wikisql
CREATE TABLE table_4872 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the smallest crowd when collingwood is home team?
SELECT MIN("Crowd") FROM table_4872 WHERE "Home team" = 'collingwood'
wikisql
CREATE TABLE Departments ( department_id INTEGER, dept_store_id INTEGER, department_name VARCHAR(80) ) CREATE TABLE Addresses ( address_id INTEGER, address_details VARCHAR(255) ) CREATE TABLE Supplier_Addresses ( supplier_id INTEGER, address_id INTEGER, date_from DATETIME, date_to ...
Show the average of price supplied by supplier id 3 for different product type code in a bar chart, rank y axis in desc order.
SELECT product_type_code, AVG(product_price) FROM Product_Suppliers AS T1 JOIN Products AS T2 ON T1.product_id = T2.product_id WHERE T1.supplier_id = 3 GROUP BY product_type_code ORDER BY AVG(product_price) DESC
nvbench
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic (...
how many patients below the age of 56 were given voriconazole?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "56" AND prescriptions.drug = "Voriconazole"
mimicsql_data
CREATE TABLE table_48013 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
Who did Thomaz Bellucci play against when he became runner-up on a clay surface?
SELECT "Opponent" FROM table_48013 WHERE "Outcome" = 'runner-up' AND "Surface" = 'clay'
wikisql
CREATE TABLE table_name_16 ( authors VARCHAR, unit VARCHAR, name VARCHAR )
Who are the authors for the malasaurus of the vyazniki assemblage?
SELECT authors FROM table_name_16 WHERE unit = "vyazniki assemblage" AND name = "malasaurus"
sql_create_context
CREATE TABLE table_name_98 ( sunlight_hours INTEGER, city_town VARCHAR, days_with_frost VARCHAR )
What is the lowest number of sunlight hours, and number of days with frost, more than 30, for the city of Ourense?
SELECT MIN(sunlight_hours) FROM table_name_98 WHERE city_town = "ourense" AND days_with_frost > 30
sql_create_context
CREATE TABLE table_35845 ( "Event Circuit" text, "City / State" text, "Date" text, "Format" text, "Winner" text, "Team" text )
What city is the hidden valley raceway in?
SELECT "City / State" FROM table_35845 WHERE "Event Circuit" = 'hidden valley raceway'
wikisql
CREATE TABLE table_name_56 ( gold VARCHAR, year VARCHAR )
What Gold has the Year of 2006?
SELECT gold FROM table_name_56 WHERE year = 2006
sql_create_context
CREATE TABLE table_1982739_2 ( english_name VARCHAR, traditional_chinese VARCHAR )
What is the number of English names that have a Traditional Chinese name of ?
SELECT COUNT(english_name) FROM table_1982739_2 WHERE traditional_chinese = "全椒縣"
sql_create_context
CREATE TABLE table_name_33 ( station VARCHAR, programming VARCHAR )
Which station has programming of Me-TV?
SELECT station FROM table_name_33 WHERE programming = "me-tv"
sql_create_context
CREATE TABLE table_36372 ( "Call sign" text, "Frequency MHz" real, "City of license" text, "ERP W" text, "Class" text, "FCC info" text )
WHich FCC info has 3,000 ERP W?
SELECT "FCC info" FROM table_36372 WHERE "ERP W" = '3,000'
wikisql
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID...
For those employees who was hired before 2002-06-21, what is the relationship between commission_pct and manager_id ?
SELECT COMMISSION_PCT, MANAGER_ID FROM employees WHERE HIRE_DATE < '2002-06-21'
nvbench
CREATE TABLE building ( building_id text, Name text, Street_address text, Years_as_tallest text, Height_feet int, Floors int ) CREATE TABLE protein ( common_name text, protein_name text, divergence_from_human_lineage real, accession_number text, sequence_length real, seq...
Please give me a bar chart showing institution types, along with the number of institutions for each type.
SELECT Type, COUNT(*) FROM Institution GROUP BY Type
nvbench
CREATE TABLE table_24649082_1 ( _number INTEGER, written_by VARCHAR )
What is the most recent episode number written by Matthew Pitts?
SELECT MAX(_number) FROM table_24649082_1 WHERE written_by = "Matthew Pitts"
sql_create_context
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
Top Stackoveflow Programmers in India.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE (LOWER(Location) LIKE '%stuttgart%' OR Location LIKE '%Stuttgart%') AND Reputation >= 1000 ORDER BY Reputation DESC
sede
CREATE TABLE table_32444 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the date of the game when the home team score is 11.11 (77)?
SELECT "Date" FROM table_32444 WHERE "Home team score" = '11.11 (77)'
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...
how many patients are diagnosed for the primary disease bowel obstruction and died in or before 2168?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "BOWEL OBSTRUCTION" AND demographic.dod_year <= "2168.0"
mimicsql_data
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
How many Russian patients stayed in the hospital for more than 69 days?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND demographic.days_stay > "69"
mimicsql_data
CREATE TABLE table_train_113 ( "id" int, "mini_mental_state_examination_mmse" int, "systolic_blood_pressure_sbp" int, "body_weight" float, "diastolic_blood_pressure_dbp" int, "body_mass_index_bmi" float, "triglyceride_tg" float, "NOUSE" float )
uncontrolled high blood pressure ( >= 140 / 90 mmhg )
SELECT * FROM table_train_113 WHERE systolic_blood_pressure_sbp >= 140 OR diastolic_blood_pressure_dbp >= 90
criteria2sql
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time...
how many hours has elapsed since the first time patient 006-80884 had a tube feeding amount intake on the current intensive care unit visit?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', intakeoutput.intakeoutputtime)) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid ...
eicu
CREATE TABLE event ( name VARCHAR, YEAR VARCHAR )
List all the event names by year from the most recent to the oldest.
SELECT name FROM event ORDER BY YEAR DESC
sql_create_context
CREATE TABLE table_7667 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text )
What is the Format for the alca-487 catalog?
SELECT "Format" FROM table_7667 WHERE "Catalog" = 'alca-487'
wikisql
CREATE TABLE table_name_3 ( category VARCHAR, president VARCHAR, year VARCHAR )
What was the category of Richard Nixon as President in a year prior to 2009?
SELECT category FROM table_name_3 WHERE president = "richard nixon" AND year < 2009
sql_create_context
CREATE TABLE Reviewer ( rID int, name text ) CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) CREATE TABLE Movie ( mID int, title text, year int, director text )
For each director who directed more than one movie, for each movie title, bin their dates of release into Year interval and count the total number in each bucket using a line chart, and display by the x-axis from high to low please.
SELECT year, COUNT(year) FROM Movie AS T1 JOIN Movie AS T2 ON T1.director = T2.director WHERE T1.title <> T2.title GROUP BY title ORDER BY year DESC
nvbench
CREATE TABLE college ( cname text, state text, enr number ) CREATE TABLE tryout ( pid number, cname text, ppos text, decision text ) CREATE TABLE player ( pid number, pname text, ycard text, hs number )
What is the total enrollment number of all colleges?
SELECT SUM(enr) FROM college
spider
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...
在03年11月25到10年12月20期间,在9714739医疗机构的住院时长超过17天病人有多少
SELECT COUNT(*) FROM zyjzjlb WHERE zyjzjlb.YLJGDM = '9714739' AND zyjzjlb.RYDJSJ BETWEEN '2003-11-25' AND '2010-12-20' AND DATEDIFF(zyjzjlb.CYSJ, zyjzjlb.RYSJ) > 17
css
CREATE TABLE table_name_43 ( minister VARCHAR, party VARCHAR, end_date VARCHAR )
Who was the minister for the CSV party with a present day end date?
SELECT minister FROM table_name_43 WHERE party = "csv" AND end_date = "present day"
sql_create_context
CREATE TABLE table_name_66 ( attendance INTEGER, loss VARCHAR )
What was the average attendance for games with a loss of papelbon (0 1)?
SELECT AVG(attendance) FROM table_name_66 WHERE loss = "papelbon (0–1)"
sql_create_context
CREATE TABLE table_13988 ( "Rank" real, "Athlete" text, "Country" text, "Time" text, "Notes" text )
What is the Time of the Player with a Rank of 2?
SELECT "Time" FROM table_13988 WHERE "Rank" = '2'
wikisql
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, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ...
what is the number of patients with a personal history of antineoplastic chemotherapy diagnoses who have been admitted to the hospital on an emergency basis?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.long_title = "Personal history of antineoplastic chemotherapy"
mimicsql_data
CREATE TABLE table_23248869_6 ( high_rebounds VARCHAR, high_points VARCHAR )
Who did the high rebounds in the game where Larry Hughes (21) did the high ponts?
SELECT high_rebounds FROM table_23248869_6 WHERE high_points = "Larry Hughes (21)"
sql_create_context
CREATE TABLE table_59438 ( "Nat." text, "Name" text, "Moving to" text, "Type" text, "Transfer window" text )
What is the transfer window when moving to alianza atl tico by the name of v. zapata?
SELECT "Transfer window" FROM table_59438 WHERE "Moving to" = 'alianza atlético' AND "Name" = 'v. zapata'
wikisql
CREATE TABLE table_name_83 ( outgoing_manager VARCHAR, position_in_table VARCHAR )
Which outgoing manager has tabled 16th position?
SELECT outgoing_manager FROM table_name_83 WHERE position_in_table = "16th"
sql_create_context
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE T...
Most popular StackOverflow tags in Q1 2015.
SELECT num.TagName AS Tag, ROW_NUMBER() OVER (ORDER BY rate.Rate DESC) AS MayRank, ROW_NUMBER() OVER (ORDER BY num.Num DESC) AS TotalRank, rate.Rate AS QuestionsInMay, num.Num AS QuestionsTotal FROM (SELECT COUNT(PostId) AS Rate, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId AN...
sede
CREATE TABLE domain_journal ( did int, jid int ) CREATE TABLE journal ( homepage varchar, jid int, name varchar ) CREATE TABLE domain_keyword ( did int, kid int ) CREATE TABLE domain ( did int, name varchar ) CREATE TABLE keyword ( keyword varchar, kid int ) CREATE TABLE...
return me the paper in PVLDB with the most citations .
SELECT publication.title FROM journal, publication WHERE journal.name = 'PVLDB' AND publication.jid = journal.jid ORDER BY publication.citation_num DESC LIMIT 1
academic
CREATE TABLE table_1341738_6 ( party VARCHAR, incumbent VARCHAR )
What party does incumbent edwin reinecke represent?
SELECT party FROM table_1341738_6 WHERE incumbent = "Edwin Reinecke"
sql_create_context
CREATE TABLE table_34162 ( "Tournament" text, "1990" text, "1991" text, "1992" text, "1993" text, "1994" text, "1995" text, "1996" text, "1997" text, "1998" text, "1999" text, "2000" text )
What 1995 has 1r as the 1999, and a 1998 of 4r?
SELECT "1995" FROM table_34162 WHERE "1999" = '1r' AND "1998" = '4r'
wikisql
CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE airport_servic...
show me flights leaving from BALTIMORE to DALLAS
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALL...
atis
CREATE TABLE table_23286112_6 ( location_attendance VARCHAR, high_points VARCHAR )
Where was the game in which Kevin Durant (25) did the most high points played?
SELECT location_attendance FROM table_23286112_6 WHERE high_points = "Kevin Durant (25)"
sql_create_context
CREATE TABLE table_17848578_1 ( result VARCHAR, game_site VARCHAR )
How many results are there when the game was at the Atlanta-Fulton county stadium?
SELECT COUNT(result) FROM table_17848578_1 WHERE game_site = "Atlanta-Fulton County Stadium"
sql_create_context
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...
名为鲁宾鸿的患者有什么疾病啊在以往?
SELECT IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_NM = '鲁宾鸿'
css
CREATE TABLE table_2649597_1 ( season_rank VARCHAR, winnings VARCHAR )
Where did they finish in the season when when they won $491,977?
SELECT season_rank FROM table_2649597_1 WHERE winnings = "$491,977"
sql_create_context
CREATE TABLE bdmzjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH number, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZD...
病人在医疗机构6930782就诊,住院天数超过23天的有多少人
SELECT COUNT(hz_info.RYBH) FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE wdmzjzjlb.YLJGDM = '6930782' AND DATEDIFF(wdmzjzjlb.CYSJ, wdmzjzjlb.RYSJ) > 23 UNION SELECT COUNT(hz_info.RYBH) FROM hz_info JOIN bdmzjzjlb ON hz_info.YLJGDM = ...
css
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuo...
what's the name of the procedure that patient 90369 was given two or more times until 54 months ago?
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 = 903...
mimic_iii
CREATE TABLE table_name_40 ( run_3 VARCHAR, run_1 VARCHAR )
What was the run 3 for the team with a run 1 of 1:17.6?
SELECT run_3 FROM table_name_40 WHERE run_1 = "1:17.6"
sql_create_context
CREATE TABLE table_19677 ( "Year" real, "Mens singles" text, "Womens singles" text, "Mens doubles" text, "Womens doubles" text, "Mixed doubles" text )
Who won womens doubles the year magn s ingi helgason tinna helgad ttir won mixed doubles and ragna ing lfsd ttir won womens singles in 2010
SELECT "Womens doubles" FROM table_19677 WHERE "Mixed doubles" = 'Magnús Ingi Helgason Tinna Helgadóttir' AND "Womens singles" = 'Ragna Ingólfsdóttir' AND "Year" = '2010'
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...
what is procedure short title of subject id 76446?
SELECT procedures.short_title FROM procedures WHERE procedures.subject_id = "76446"
mimicsql_data
CREATE TABLE train_station ( Train_ID int, Station_ID int ) CREATE TABLE train ( Train_ID int, Name text, Time text, Service text ) CREATE TABLE station ( Station_ID int, Name text, Annual_entry_exit real, Annual_interchanges real, Total_Passengers real, Location text, ...
How many locations? Draw a bar chart, and list by the X-axis in ascending.
SELECT Location, COUNT(Location) FROM station GROUP BY Location ORDER BY Location
nvbench
CREATE TABLE table_2182562_2 ( position VARCHAR, avg_finish VARCHAR )
What was the position of the team with an average finish of 21.5?
SELECT position FROM table_2182562_2 WHERE avg_finish = "21.5"
sql_create_context
CREATE TABLE member_attendance ( member_id number, performance_id number, num_of_pieces number ) CREATE TABLE performance ( performance_id number, date text, host text, location text, attendance number ) CREATE TABLE member ( member_id text, name text, nationality text, ...
List the hosts of performances in ascending order of attendance.
SELECT host FROM performance ORDER BY attendance
spider
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE job_history ( EMPLOYEE...
Bar graph to show how many country name from different country name, and could you order in descending by the y-axis please?
SELECT COUNTRY_NAME, COUNT(COUNTRY_NAME) FROM countries GROUP BY COUNTRY_NAME ORDER BY COUNT(COUNTRY_NAME) DESC
nvbench
CREATE TABLE table_58435 ( "Rd #" real, "Pick #" real, "Player" text, "Team (League)" text, "Reg GP" real, "Pl GP" real )
What is the PI GP of Rob Flockhart, who has a pick # less than 122 and a round # less than 3?
SELECT SUM("Pl GP") FROM table_58435 WHERE "Pick #" < '122' AND "Player" = 'rob flockhart' AND "Rd #" < '3'
wikisql
CREATE TABLE available_policies ( customer_phone VARCHAR, policy_type_code VARCHAR )
What are the customer phone numbers under the policy 'Life Insurance'?
SELECT customer_phone FROM available_policies WHERE policy_type_code = "Life Insurance"
sql_create_context
CREATE TABLE table_76613 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text )
What club has a played number of 19, and the lost of 14?
SELECT "Club" FROM table_76613 WHERE "Played" = '19' AND "Lost" = '14'
wikisql
CREATE TABLE table_39105 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Event" text )
What is the lowest year that had foil team as the event at Melbourne?
SELECT MIN("Year") FROM table_39105 WHERE "Event" = 'foil team' AND "Venue" = 'melbourne'
wikisql
CREATE TABLE appellations ( No INTEGER, Appelation TEXT, County TEXT, State TEXT, Area TEXT, isAVA TEXT ) CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases IN...
Show the number of year of the maximum price and score of wines in a bar chart, and bin the year into the weekday interval.
SELECT Year, COUNT(Year) FROM wine
nvbench
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, ...
在05年8月5日到20年8月30日期间的患者37414336全部检验结果指标记录的检测人是82292587的检验指标流水号各是多少?
SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON 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.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.B...
css
CREATE TABLE table_2668416_18 ( candidates VARCHAR, district VARCHAR )
If the district is Virginia 17, who are the candidates?
SELECT candidates FROM table_2668416_18 WHERE district = "Virginia 17"
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, ...
在2004年1月21日到2017年9月23日之间患者孔幼怡就诊过的医生统共有多少个?
SELECT COUNT(mzjzjlb.ZZYSGH) 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.person_info_XM = '孔幼怡' AND mzjzjlb.JZKSRQ BETWEEN '2004-01-21' AND '2017-09-23'
css
CREATE TABLE table_75844 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
What competition has June 19, 2004 as the date?
SELECT "Competition" FROM table_75844 WHERE "Date" = 'june 19, 2004'
wikisql
CREATE TABLE table_17613 ( "Country" text, "Player name" text, "Period" text, "Position" text, "Matches" text, "Goals" text )
What is the name of the player who played in 2009 only?
SELECT "Player name" FROM table_17613 WHERE "Period" = '2009'
wikisql
CREATE TABLE table_9600 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Location" text )
Which event has a method of TKO (punches)?
SELECT "Event" FROM table_9600 WHERE "Method" = 'tko (punches)'
wikisql
CREATE TABLE table_17382360_9 ( date VARCHAR, score VARCHAR )
How many dates had a final score of w 118-112?
SELECT COUNT(date) FROM table_17382360_9 WHERE score = "W 118-112"
sql_create_context
CREATE TABLE table_3005 ( "Conference" text, "Regular Season Winner" text, "Conference Player of the Year" text, "Conference Tournament" text, "Tournament Venue (City)" text, "Tournament Winner" text )
When western michigan is the tournament winner how many conferences are there?
SELECT COUNT("Conference") FROM table_3005 WHERE "Tournament Winner" = 'Western Michigan'
wikisql
CREATE TABLE table_name_51 ( apps INTEGER, team VARCHAR, level VARCHAR )
What is the average Apps for the team Kairat with level larger than 1?
SELECT AVG(apps) FROM table_name_51 WHERE team = "kairat" AND level > 1
sql_create_context
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9cod...
when was the last time the respiration measured in patient 006-133605 on the current intensive care unit visit?
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-133605') AND patient.unitdischargetime IS NULL)...
eicu
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...
统共有多些次的医疗记录中给病号秦涵容开了价值不低于8721.69元的药物?就诊的编号是多少呢?
SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_NM = '秦涵容' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE AMOUNT >= 8721.69)
css
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, ...
count the number of patients whose admission type is urgent and ethnicity is black/haitian?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.ethnicity = "BLACK/HAITIAN"
mimicsql_data
CREATE TABLE table_18550 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
What candidate was re-elected and was first elected in 1942?
SELECT "Candidates" FROM table_18550 WHERE "Result" = 'Re-elected' AND "First elected" = '1942'
wikisql
CREATE TABLE table_52166 ( "Name" text, "League" real, "FA Cup" real, "League Cup" real, "Total" real )
What is the average FA Cup value with a total greater than 2, a League Cup of 1, a league less than 3, and Paul Ince scoring?
SELECT AVG("FA Cup") FROM table_52166 WHERE "Total" > '2' AND "League Cup" = '1' AND "Name" = 'paul ince' AND "League" < '3'
wikisql
CREATE TABLE management ( department_ID int, head_ID int, temporary_acting text ) CREATE TABLE head ( head_ID int, name text, born_state text, age real ) CREATE TABLE department ( Department_ID int, Name text, Creation text, Ranking int, Budget_in_Billions real, Num...
Can you draw the trend of sum budget in billions over the creation?, could you show by the x-axis in asc?
SELECT Creation, SUM(Budget_in_Billions) FROM department GROUP BY Creation ORDER BY Creation
nvbench
CREATE TABLE table_62816 ( "Game" real, "Date" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" real )
Which Result has a Game larger than 6, and an Attendance larger than 12,782, and a Date of 5 december 1987?
SELECT "Result" FROM table_62816 WHERE "Game" > '6' AND "Attendance" > '12,782' AND "Date" = '5 december 1987'
wikisql
CREATE TABLE table_17176509_4 ( driver___passenger VARCHAR, position VARCHAR )
Name the driver/passenger for 30
SELECT COUNT(driver___passenger) FROM table_17176509_4 WHERE position = 30
sql_create_context
CREATE TABLE table_58486 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Attendance" real, "Record" text )
Who was the leading scorer on November 2, 2007?
SELECT "Leading scorer" FROM table_58486 WHERE "Date" = 'november 2, 2007'
wikisql
CREATE TABLE gwyjzb ( 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, ...
自二零零零年九月十八日开始,截止到二零一三年十月十六日,患者章俊晤的主治医生是哪位
SELECT gwyjzb.OUT_DIAG_DOC_CD, gwyjzb.OUT_DIAG_DOC_NM FROM gwyjzb WHERE gwyjzb.PERSON_NM = '章俊晤' AND gwyjzb.IN_HOSP_DATE BETWEEN '2000-09-18' AND '2013-10-16' GROUP BY gwyjzb.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT fgwyjzb.OUT_DIAG_DOC_CD, fgwyjzb.OUT_DIAG_DOC_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_NM...
css
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, ...
how many patients died within the same month after having been diagnosed the last year with hypothyroidism?
SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hypothyroidism') AS t1 GROUP BY t1.uniquepid HAVING MIN(t1.diagn...
eicu
CREATE TABLE table_name_53 ( city___town VARCHAR, icao VARCHAR )
Which city has an ICAO of gvsf?
SELECT city___town FROM table_name_53 WHERE icao = "gvsf"
sql_create_context
CREATE TABLE hz_info_mzjzjlb ( JZLSH number, YLJGDM number, mzjzjlb_id number ) 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 t...
患有沙眼的患者在门诊诊断的甘油三酯数值的平均值以及最值各是多少?
SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND hz_info_mzjzjlb.JZLSH = mzjzjl...
css