context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_86 ( pos VARCHAR, name VARCHAR )
What is Alyona Klimenko's Pos.?
SELECT pos FROM table_name_86 WHERE name = "alyona klimenko"
sql_create_context
CREATE TABLE table_name_39 ( date VARCHAR, tournament VARCHAR )
What date was the tournament in Indian Wells?
SELECT date FROM table_name_39 WHERE tournament = "indian wells"
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
how many people are current patients aged 50s?
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.hospitaldischargetime IS NULL AND patient.age BETWEEN 50 AND 59
eicu
CREATE TABLE table_11964047_8 ( leading_scorer VARCHAR, date VARCHAR )
What is the leading scorer on february 1?
SELECT leading_scorer FROM table_11964047_8 WHERE date = "February 1"
sql_create_context
CREATE TABLE table_name_63 ( Id VARCHAR )
What is 1997, when 1996 is '1R', when 1990 is '2R', and when 1991 is 'F'?
SELECT 1997 FROM table_name_63 WHERE 1996 = "1r" AND 1990 = "2r" AND 1991 = "f"
sql_create_context
CREATE TABLE table_name_39 ( crowd INTEGER, venue VARCHAR )
What is the total number of people that attended the glenferrie oval venue?
SELECT SUM(crowd) FROM table_name_39 WHERE venue = "glenferrie oval"
sql_create_context
CREATE TABLE table_11570261_1 ( year INTEGER, winning_score VARCHAR )
what is the minimum year where winning score is 8 (71-63-69-69=272)
SELECT MIN(year) FROM table_11570261_1 WHERE winning_score = −8(71 - 63 - 69 - 69 = 272)
sql_create_context
CREATE TABLE Customers ( customer_id INTEGER, customer_details VARCHAR(255) ) CREATE TABLE Properties ( property_id INTEGER, property_type_code CHAR(15), property_address VARCHAR(255), other_details VARCHAR(255) ) CREATE TABLE Residents_Services ( resident_id INTEGER, service_id INTEGE...
Group and count the move in date in a bar chart, order in desc by the Y please.
SELECT date_moved_in, COUNT(date_moved_in) FROM Customer_Events GROUP BY date_moved_in ORDER BY COUNT(date_moved_in) DESC
nvbench
CREATE TABLE table_55387 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
Which result has a Score of 1 1?
SELECT "Result" FROM table_55387 WHERE "Score" = '1–1'
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...
provide the number of patients whose age is less than 71 and lab test category is hematology?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "71" AND lab."CATEGORY" = "Hematology"
mimicsql_data
CREATE TABLE table_35993 ( "Game" real, "January" real, "Opponent" text, "Score" text, "Record" text, "Points" real )
Which Game is the highest that has a January of 28?
SELECT MAX("Game") FROM table_35993 WHERE "January" = '28'
wikisql
CREATE TABLE table_3533 ( "English" text, "Japanese" text, "Kana spelling" text, "Revised Hepburn" text, "Kunrei-shiki" text, "Nihon-shiki" text )
how many number of english when kunrei-shiki is otya
SELECT COUNT("English") FROM table_3533 WHERE "Kunrei-shiki" = 'otya'
wikisql
CREATE TABLE table_11677691_8 ( college VARCHAR, player VARCHAR )
Where did robert nkemdiche go to college
SELECT college FROM table_11677691_8 WHERE player = "Robert Nkemdiche ‡"
sql_create_context
CREATE TABLE table_25401874_1 ( number VARCHAR, assists VARCHAR )
How many numbers belong to the player with 10 assists?
SELECT COUNT(number) FROM table_25401874_1 WHERE assists = 10
sql_create_context
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...
Let me know the gender and long title of diagnoses for the patient with patient id 2110.
SELECT demographic.gender, diagnoses.long_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "2110"
mimicsql_data
CREATE TABLE editor ( Name VARCHAR, Age INTEGER )
List the names of editors who are older than 25.
SELECT Name FROM editor WHERE Age > 25
sql_create_context
CREATE TABLE table_77048 ( "Team" text, "Manager" text, "Home city" text, "Stadium" text, "Capacity" real )
What team has a home city of Koprivnica?
SELECT "Team" FROM table_77048 WHERE "Home city" = 'koprivnica'
wikisql
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_DIRE_CD text, MED_DIRE_NM text,...
在医疗机构2027203里,有多少患者做了项目1591的检查
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.MED_SER_ORG_NO = '2027203' AND t_kc22.SOC_SRT_DIRE_CD = '1591'
css
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number...
what was the time patient 031-19622 was discharged from the hospital for the last time?
SELECT patient.hospitaldischargetime FROM patient WHERE patient.uniquepid = '031-19622' ORDER BY patient.hospitaldischargetime DESC LIMIT 1
eicu
CREATE TABLE table_203_656 ( id number, "date" text, "opponent" text, "venue" text, "result" text, "scorers" text, "report" text )
the total number of different teams listed as an opponent
SELECT COUNT(DISTINCT "opponent") FROM table_203_656
squall
CREATE TABLE table_24814477_2 ( week VARCHAR, opponent VARCHAR )
What week did the Galaxy play the Amsterdam Admirals?
SELECT week FROM table_24814477_2 WHERE opponent = "Amsterdam Admirals"
sql_create_context
CREATE TABLE Participants ( Participant_ID INTEGER, Participant_Type_Code CHAR(15), Participant_Details VARCHAR(255) ) CREATE TABLE Services ( Service_ID INTEGER, Service_Type_Code CHAR(15) ) CREATE TABLE Events ( Event_ID INTEGER, Service_ID INTEGER, Event_Details VARCHAR(255) ) CREA...
For events that have more than one participant, count the event details for a bar chart, and list by the the number of event details in ascending.
SELECT Event_Details, COUNT(Event_Details) FROM Events AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID = T2.Event_ID GROUP BY Event_Details ORDER BY COUNT(Event_Details)
nvbench
CREATE TABLE table_43338 ( "Week" real, "Date" text, "Opponent" text, "Game Site" text, "Final Score" text, "Record" text, "Attendance" text )
Which record has 64,053 as the attendance?
SELECT "Record" FROM table_43338 WHERE "Attendance" = '64,053'
wikisql
CREATE TABLE table_31843 ( "Week" text, "Date" text, "Opponent" text, "Time" text, "Game Site" text, "Result/Score" text, "Record" text )
Tell me the game site for week of 1
SELECT "Game Site" FROM table_31843 WHERE "Week" = '1'
wikisql
CREATE TABLE table_204_683 ( id number, "no." number, "constituency" text, "winner candidate" text, "party" text, "votes" number, "margin" number )
how many votes were there for the constituency of danta ?
SELECT "votes" FROM table_204_683 WHERE "constituency" = 'danta'
squall
CREATE TABLE Financial_Transactions ( transaction_id INTEGER, previous_transaction_id INTEGER, account_id INTEGER, card_id INTEGER, transaction_type VARCHAR(15), transaction_date DATETIME, transaction_amount DOUBLE, transaction_comment VARCHAR(255), other_transaction_details VARCHAR(...
Scatter chart. what are the different account ids that have made financial transactions, as well as how many transactions correspond to each?
SELECT account_id, COUNT(*) FROM Financial_Transactions GROUP BY account_id
nvbench
CREATE TABLE table_55052 ( "Season" text, "Team Name" text, "Games" real, "Losses" real, "Points" real )
What's the total number of losses with less than 19 points and more than 36 games?
SELECT COUNT("Losses") FROM table_55052 WHERE "Points" < '19' AND "Games" > '36'
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 allergy ( allergy...
when has patient 006-100609 first received a procedure a year before?
SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-100609')) AND DATETIME(treatment.treatmenttime, 'start of yea...
eicu
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...
在2013年12月16日到2014年11月24日内姓名为何修明的参保人单一药品最多购买次数是多少次?
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_NM = '何修明' AND t_kc22.STA_DATE BETWEEN '2013-12-16' AND '2014-11-24' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT ...
css
CREATE TABLE culture_company ( Company_name text, Type text, Incorporated_in text, Group_Equity_Shareholding real, book_club_id text, movie_id text ) CREATE TABLE book_club ( book_club_id int, Year int, Author_or_Editor text, Book_Title text, Publisher text, Category tex...
Which directors had a movie in either 1999 or 2000, and count them by a bar chart
SELECT Director, COUNT(Director) FROM movie WHERE Year = 1999 OR Year = 2000 GROUP BY Director
nvbench
CREATE TABLE table_37978 ( "Round" real, "Player" text, "Position" text, "Nationality" text, "College/Junior/Club Team (League)" text )
What position does the draft pick from Finland play?
SELECT "Position" FROM table_37978 WHERE "Nationality" = 'finland'
wikisql
CREATE TABLE table_name_23 ( money___ INTEGER, score VARCHAR )
How much was paid to the player whose score was 70-71-77-76=294?
SELECT SUM(money___) AS $__ FROM table_name_23 WHERE score = 70 - 71 - 77 - 76 = 294
sql_create_context
CREATE TABLE table_name_38 ( attendance VARCHAR, record VARCHAR )
How many people attended when the record was broken with 47 63?
SELECT attendance FROM table_name_38 WHERE record = "47–63"
sql_create_context
CREATE TABLE table_16918 ( "Institution" text, "Nickname" text, "Status" text, "Founded" real, "Color" text, "Location" text )
What was the number of location of nickname cbsua formerly known cssac?
SELECT COUNT("Location") FROM table_16918 WHERE "Nickname" = 'CBSUA formerly known CSSAC'
wikisql
CREATE TABLE table_74687 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the venue when the away team scored 14.9 (93)?
SELECT "Venue" FROM table_74687 WHERE "Away team score" = '14.9 (93)'
wikisql
CREATE TABLE table_2877 ( "#" real, "Title" text, "Director" text, "Writer(s)" text, "Original air date" text, "Production Code" text, "U.S. viewers (millions)" text )
What's the number of the episode directed by Whitney Ransick?
SELECT "#" FROM table_2877 WHERE "Director" = 'Whitney Ransick'
wikisql
CREATE TABLE table_name_34 ( pick__number VARCHAR, college VARCHAR )
How many picks were from Lamar College?
SELECT COUNT(pick__number) FROM table_name_34 WHERE college = "lamar"
sql_create_context
CREATE TABLE table_47649 ( "Year" real, "Publication" text, "Country" text, "Accolade" text, "Rank" real )
What's the average year with a rank less than 3?
SELECT AVG("Year") FROM table_47649 WHERE "Rank" < '3'
wikisql
CREATE TABLE table_50420 ( "Rank" real, "Title" text, "Studio" text, "Director" text, "Gross" text )
WHAT IS THE TITLE THAT HAS A RANK BIGGER THAN 10, FOR DIRECTOR WALTER HILL?
SELECT "Title" FROM table_50420 WHERE "Rank" > '10' AND "Director" = 'walter hill'
wikisql
CREATE TABLE table_name_50 ( game_site VARCHAR, result VARCHAR )
What game site has w 10-3 as the result?
SELECT game_site FROM table_name_50 WHERE result = "w 10-3"
sql_create_context
CREATE TABLE submission ( Submission_ID int, Scores real, Author text, College text ) CREATE TABLE Acceptance ( Submission_ID int, Workshop_ID int, Result text ) CREATE TABLE workshop ( Workshop_ID int, Date text, Venue text, Name text )
How many workshops did each author submit to? Return the author name and the number of workshops in a bar chart, could you order names in desc order?
SELECT Author, COUNT(DISTINCT T1.Workshop_ID) FROM Acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID ORDER BY Author DESC
nvbench
CREATE TABLE table_19901_1 ( trigger_pack VARCHAR, rear_sight_type VARCHAR, colt_model_no VARCHAR )
What is the trigger pack on the Colt 602 with the a1 rear sight type?
SELECT trigger_pack FROM table_19901_1 WHERE rear_sight_type = "A1" AND colt_model_no = "602"
sql_create_context
CREATE TABLE table_72484 ( "Club" text, "Played" text, "Won" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text )
what's the won with points against being 597
SELECT "Won" FROM table_72484 WHERE "Points against" = '597'
wikisql
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE procedures_icd ( ...
how many times patient 28910 has come to the hospital since 2104?
SELECT COUNT(DISTINCT admissions.hadm_id) FROM admissions WHERE admissions.subject_id = 28910 AND STRFTIME('%y', admissions.admittime) >= '2104'
mimic_iii
CREATE TABLE table_15200 ( "Tournament" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text )
Name the 2008 for 2012 being a and tournament of australian open
SELECT "2008" FROM table_15200 WHERE "2012" = 'a' AND "Tournament" = 'australian open'
wikisql
CREATE TABLE table_name_96 ( spacecraft VARCHAR, start_date_time VARCHAR )
The EVA that started 8 July 12:38 was from what spacecraft?
SELECT spacecraft FROM table_name_96 WHERE start_date_time = "8 july 12:38"
sql_create_context
CREATE TABLE table_name_6 ( competition VARCHAR, year VARCHAR, venue VARCHAR )
What competition did he compete in before 2007 in gothenburg, sweden?
SELECT competition FROM table_name_6 WHERE year < 2007 AND venue = "gothenburg, sweden"
sql_create_context
CREATE TABLE table_name_52 ( time VARCHAR, rank VARCHAR, lane VARCHAR, nationality VARCHAR )
What is the total time of the athlete from Canada with a lane less than 8 and a rank less than 8?
SELECT COUNT(time) FROM table_name_52 WHERE lane < 8 AND nationality = "canada" AND rank < 8
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
count the number of patients whose ethnicity is white and year of birth is less than 2064?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "WHITE" AND demographic.dob_year < "2064"
mimicsql_data
CREATE TABLE table_9723 ( "Year" real, "Miss Earth Venezuela" text, "1st Runner Up" text, "2nd Runner Up" text, "3rd Runner Up" text, "4th Runner Up" text )
who is the 1st runner-up when the miss earth Venezuela is mar a daniela torrealba?
SELECT "1st Runner Up" FROM table_9723 WHERE "Miss Earth Venezuela" = 'maría daniela torrealba'
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 marital status is divorced and tested with folate in lab?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "DIVORCED" AND lab.label = "Folate"
mimicsql_data
CREATE TABLE table_48726 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What was the week number when a game was played on November 19, 1967?
SELECT MIN("Week") FROM table_48726 WHERE "Date" = 'november 19, 1967'
wikisql
CREATE TABLE table_17011 ( "Institution" text, "Location" text, "Founded" real, "Type" text, "Enrollment" real, "Nickname" text, "Joined" real, "Left" real, "Current Conference" text )
What is the nickname of the school with an enrollment of 2386?
SELECT "Nickname" FROM table_17011 WHERE "Enrollment" = '2386'
wikisql
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_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), ...
For all employees who have the letters D or S in their first name, give me the comparison about the sum of department_id over the job_id , and group by attribute job_id, could you rank bars in asc order?
SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID
nvbench
CREATE TABLE table_name_82 ( kickoff_time VARCHAR, date VARCHAR )
What was the kickoff time for the December 14, 2003 game?
SELECT kickoff_time FROM table_name_82 WHERE date = "december 14, 2003"
sql_create_context
CREATE TABLE table_name_33 ( score VARCHAR, player VARCHAR )
Name the Score of craig stadler?
SELECT score FROM table_name_33 WHERE player = "craig stadler"
sql_create_context
CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases INTEGER, Drink TEXT ) CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT ) CREATE TABLE appellations ( No...
Compare the average of maximum price of wines each year, bin the year into the weekday interval, and I want to display in asc by the y axis.
SELECT Year, AVG(MAX(Price)) FROM wine ORDER BY AVG(MAX(Price))
nvbench
CREATE TABLE table_15280 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text )
Position of defensive back, and an Overall smaller than 69 is what lowest pick #?
SELECT MIN("Pick #") FROM table_15280 WHERE "Position" = 'defensive back' AND "Overall" < '69'
wikisql
CREATE TABLE table_name_53 ( laps INTEGER, time_retired VARCHAR, grid VARCHAR )
What is the mean number of laps where Time/retired was a water leak and the grid number was bigger than 12?
SELECT AVG(laps) FROM table_name_53 WHERE time_retired = "water leak" AND grid > 12
sql_create_context
CREATE TABLE table_21678 ( "Alaska" text, "Arizona" text, "Arkansas" text, "California" text, "Colorado" text )
Name the california where alaska tennessee
SELECT "California" FROM table_21678 WHERE "Alaska" = 'Tennessee'
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...
give me the number of patients whose age is less than 80 and drug name is finasteride?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "80" AND prescriptions.drug = "Finasteride"
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...
tell me the number of female patients who had other persistent mental disorders due to conditions classified elsewhere diagnoses.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.short_title = "Mental disor NEC oth dis"
mimicsql_data
CREATE TABLE table_42832 ( "Spoofed Title" text, "Actual Title" text, "Writer" text, "Artist" text, "Issue" real, "Date" text )
What is the name of the writer for issue 224?
SELECT "Writer" FROM table_42832 WHERE "Issue" = '224'
wikisql
CREATE TABLE fgwyjzb ( 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, ...
根据出院诊断疾病名称,不同疾病的平均患者年龄在医院8391729中分别都是多少呢?
SELECT gwyjzb.OUT_DIAG_DIS_NM, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '8391729' GROUP BY gwyjzb.OUT_DIAG_DIS_NM UNION SELECT fgwyjzb.OUT_DIAG_DIS_NM, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '8391729' GROUP BY fgwyjzb.OUT_DIAG_DIS_NM
css
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( intakeoutput...
retrieve the top five most common output events since 6 years ago?
SELECT t1.celllabel FROM (SELECT intakeoutput.celllabel, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM intakeoutput WHERE intakeoutput.cellpath LIKE '%output%' AND DATETIME(intakeoutput.intakeoutputtime) >= DATETIME(CURRENT_TIME(), '-6 year') GROUP BY intakeoutput.celllabel) AS t1 WHERE t1.c1 <= 5
eicu
CREATE TABLE table_203_824 ( id number, "pick #" number, "player" text, "position" text, "nationality" text, "nhl team" text, "college/junior/club team" text )
how many center position players are there ?
SELECT COUNT("player") FROM table_203_824 WHERE "position" = 'centre'
squall
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
how many patients are with death status 0 and with diagnosis chronic diastolic heart failure?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "0" AND diagnoses.long_title = "Chronic diastolic heart failure"
mimicsql_data
CREATE TABLE table_28923 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text )
How many parties were first elected in 1805?
SELECT COUNT("Party") FROM table_28923 WHERE "First elected" = '1805'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
give me the number of patients who had continuous intra-arterial blood gas monitoring and were hospitalized for more than 16 days.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "16" AND procedures.long_title = "Continuous intra-arterial blood gas monitoring"
mimicsql_data
CREATE TABLE table_68348 ( "Round" text, "Kick Off" text, "Opponents" text, "H / A" text, "Result" text, "Attendance" real, "Report" text )
What was the kickoff date for the round value of R4?
SELECT "Kick Off" FROM table_68348 WHERE "Round" = 'r4'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
tell me the sex of patient 006-195541.
SELECT DISTINCT patient.gender FROM patient WHERE patient.uniquepid = '006-195541'
eicu
CREATE TABLE table_27837 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text )
Who direcred the episode with production code 7d03?
SELECT "Directed by" FROM table_27837 WHERE "Production code" = '7D03'
wikisql
CREATE TABLE table_203_332 ( id number, "number" text, "year built" number, "builder" text, "status" text, "notes" text )
how many of the locomotives were built before 1940 ?
SELECT COUNT(*) FROM table_203_332 WHERE "year built" < 1940
squall
CREATE TABLE table_60176 ( "Shooter" text, "Event" text, "Rank points" text, "Score points" text, "Total" text )
What is Rank Points, when Event is 'WC Milan', and when Shooter is 'Lalita Yauhleuskaya ( AUS )'?
SELECT "Rank points" FROM table_60176 WHERE "Event" = 'wc milan' AND "Shooter" = 'lalita yauhleuskaya ( aus )'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE ftxmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, ...
08年11月4日到16年2月25日,科室07063的门诊诊疗量
SELECT COUNT(*) FROM txmzjzjlb WHERE txmzjzjlb.JZKSBM = '07063' AND txmzjzjlb.JZKSRQ BETWEEN '2008-11-04' AND '2016-02-25' UNION SELECT COUNT(*) FROM ftxmzjzjlb WHERE ftxmzjzjlb.JZKSBM = '07063' AND ftxmzjzjlb.JZKSRQ BETWEEN '2008-11-04' AND '2016-02-25'
css
CREATE TABLE Scientists ( SSN int, Name Char(30) ) CREATE TABLE Projects ( Code Char(4), Name Char(50), Hours int ) CREATE TABLE AssignedTo ( Scientist int, Project char(4) )
A bar chart for finding the number of the name of the project for which a scientist whose name contains Smith is assigned to, I want to order in asc by the total number.
SELECT T2.Name, COUNT(T2.Name) FROM AssignedTo AS T1 JOIN Projects AS T2 ON T1.Project = T2.Code JOIN Scientists AS T3 ON T1.Scientist = T3.SSN WHERE T3.Name LIKE '%Smith%' GROUP BY T2.Name ORDER BY COUNT(T2.Name)
nvbench
CREATE TABLE table_name_21 ( rank INTEGER, assists VARCHAR )
What is the sum of Rank, when Assists is '82'?
SELECT SUM(rank) FROM table_name_21 WHERE assists = 82
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) ...
what is the minimum hospital cost for a drug with a name called albumin 5% since 6 years ago?
SELECT MIN(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 medication.patientunitstayid FROM medication WHERE medication.drugname = 'albumin 5%')) AND DATETIME(cost.chargetime) >=...
eicu
CREATE TABLE table_12807904_3 ( played VARCHAR, points_for VARCHAR )
HOW MANY PLAYERS PLAYED IN THE GAME THAT WON WITH 438 POINTS
SELECT played FROM table_12807904_3 WHERE points_for = "438"
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...
provide the number of patients whose drug code is nvan500i and lab test category is blood gas?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "NVAN500I" AND lab."CATEGORY" = "Blood Gas"
mimicsql_data
CREATE TABLE table_77296 ( "Year" real, "Team" text, "Co-Drivers" text, "Class" text, "Laps" real, "Pos." text, "Class Pos." text )
What is Class Pos., when Year is before 2013, and when Laps is greater than 175?
SELECT "Class Pos." FROM table_77296 WHERE "Year" < '2013' AND "Laps" > '175'
wikisql
CREATE TABLE table_name_68 ( authority VARCHAR, decile VARCHAR, area VARCHAR )
Which Authority has a Decile smaller than 6, and an Area of opoutere?
SELECT authority FROM table_name_68 WHERE decile < 6 AND area = "opoutere"
sql_create_context
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREA...
Top developers in Saudi Arabia.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location, CreationDate, LastAccessDate, Views FROM Users WHERE LOWER(Location) LIKE '%saudi%' ORDER BY Reputation DESC
sede
CREATE TABLE table_name_17 ( song VARCHAR, draw VARCHAR, artist VARCHAR )
What Luca Barbarossa song had a draw smaller than 20?
SELECT song FROM table_name_17 WHERE draw < 20 AND artist = "luca barbarossa"
sql_create_context
CREATE TABLE table_80004 ( "Name" text, "Years" text, "Gender" text, "Area" text, "Authority" text, "Decile" real, "Roll" real )
How many deciles have Years of 9 13?
SELECT COUNT("Decile") FROM table_80004 WHERE "Years" = '9–13'
wikisql
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...
查一下给患者66407523开药品7498的医院有哪些
SELECT t_kc22.t_kc21_MED_SER_ORG_NO FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '66407523' AND t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_CD = '7498')
css
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...
杨玉泉这个病人在医院3427917入院诊断中,有多少疾病名称中包含紧张的医疗就诊记录,需要这些记录的编号
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '杨玉泉' AND t_kc21.MED_SER_ORG_NO = '3427917' AND t_kc21.IN_DIAG_DIS_NM LIKE '%紧张%'
css
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, ...
calculate the total number of patients aged below 24
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "24"
mimicsql_data
CREATE TABLE table_name_88 ( games INTEGER, name VARCHAR, assists VARCHAR )
What is the mean number of games for pablo prigioni when there are more than 14 assists?
SELECT AVG(games) FROM table_name_88 WHERE name = "pablo prigioni" AND assists > 14
sql_create_context
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE treatment ( treat...
count the number of patients who are dead after having been diagnosed with sepsis - severe during the same hospital visit until 2104.
SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT t1.uniquepid, t1.diagnosistime, t1.patienthealthsystemstayid FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = ...
eicu
CREATE TABLE table_27279050_3 ( first_driver_s_ VARCHAR, country VARCHAR )
Who is the first driver(s) when the country is romania?
SELECT first_driver_s_ FROM table_27279050_3 WHERE country = "Romania"
sql_create_context
CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
What are some of the useful courses I should take before ASIAN 416 ?
SELECT DISTINCT advisory_requirement FROM course WHERE department = 'ASIAN' AND number = 416
advising
CREATE TABLE table_55672 ( "Driver" text, "Constructor" text, "Laps" text, "Time/Retired" text, "Grid" text )
who is the constructor when the driver is jenson button?
SELECT "Constructor" FROM table_55672 WHERE "Driver" = 'jenson button'
wikisql
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, language text, marital_status text, ethnicity text, age number ) CREATE ...
how many hours have passed since patient 27172 last started to stay in careunit csru during their current hospital visit?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27172 AND admissions.dischtime IS NULL) AND transfers.careunit = 'csru' ORDER BY transfers.intime DESC LIMIT 1
mimic_iii
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostsWithDe...
Answer Score MIN MAX AVG.
SELECT MIN(Score) AS min, MAX(Score) AS max, AVG(Score) AS avg FROM Posts WHERE PostTypeId = 2
sede
CREATE TABLE fzzmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZD...
门诊给患者98667689诊断为疾病X64.071,那他的罗马指数(绝经前)的结果定量及单位是什么
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jyb...
css
CREATE TABLE table_69850 ( "Name" text, "Party" text, "Province" text, "Term expires" real, "Term of office" text )
How many times did Ken Wright expired in North Western?
SELECT COUNT("Term expires") FROM table_69850 WHERE "Province" = 'north western' AND "Name" = 'ken wright'
wikisql
CREATE TABLE table_17278 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text )
Which tittles have an original air date of March 19, 1998
SELECT "Title" FROM table_17278 WHERE "Original air date" = 'March 19, 1998'
wikisql
CREATE TABLE table_72961 ( "Rank" real, "Railway Station" text, "Annual entry/exit (millions) 2011\u201312" text, "Annual interchanges (millions) 2011\u201312" text, "Total Passengers (millions) 2011\u201312" text, "Location" text, "Main Services" text, "Number of Platforms" real )
What is the main service for the station with 14.849 million passengers 2011-12?
SELECT "Main Services" FROM table_72961 WHERE "Total Passengers (millions) 2011\u201312" = '14.849'
wikisql
CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE cite ( citingpaperid int, citedpa...
How many papers has david blei published in nips ?
SELECT DISTINCT COUNT(paper.paperid) FROM author, paper, venue, writes WHERE author.authorname = 'david blei' AND venue.venueid = paper.venueid AND venue.venuename = 'nips' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
scholar